Skip to content
Browse files

Some updates that I needed for the disttag change and fc3

  • Loading branch information...
1 parent 59e6035 commit 7dca4d2a480f431a6ea45095e9cd3fa13454c982 @dagwieers committed Nov 22, 2004
Showing with 163 additions and 72 deletions.
  1. +18 −12 dar-build
  2. +45 −30 dar-functions
  3. +13 −0 dar-kickoff
  4. +35 −20 dar-sync
  5. +3 −2 dar-update
  6. +7 −6 dar.conf
  7. +4 −0 dists/el2i/config
  8. +4 −0 dists/el3a/config
  9. +4 −0 dists/el3i/config
  10. +4 −0 dists/fc1i/config
  11. +5 −1 dists/fc2a/config
  12. +5 −1 dists/fc2i/config
  13. +4 −0 dists/rh6i/config
  14. +4 −0 dists/rh7i/config
  15. +4 −0 dists/rh8i/config
  16. +4 −0 dists/rh9i/config
View
30 dar-build
@@ -150,18 +150,20 @@ for app in $PKGS; do
### Check if already build (2 version schemes, multiple disttags)
for disttag in $DISTTAG; do
- NEWRPMFILE="$app-$VERSION-$RELEASE.$disttag.$TAG.$arch.rpm"
- OLDRPMFILE="$app-$VERSION-$RELEASE.$TAG.$disttag.$arch.rpm"
- for rpmfile in $NEWRPMFILE $OLDRPMFILE; do
- if [ -z "$FORCE_OVERWRITE" -a -f "$PACKAGEDIR/$app/$rpmfile" ]; then
- warning "Package \"$PACKAGEDIR/$app/$rpmfile\" already exists."
-
- if [ -z "$SOURCE_DISTS" ]; then
- SOURCE_DISTS="$DISTNICK"
+ for tag in $TAGS; do
+ NEWRPMFILE="$app-$VERSION-$RELEASE.$disttag.$tag.$arch.rpm"
+ OLDRPMFILE="$app-$VERSION-$RELEASE.$tag.$disttag.$arch.rpm"
+ for rpmfile in $NEWRPMFILE $OLDRPMFILE; do
+ if [ -z "$FORCE_OVERWRITE" -a -f "$PACKAGEDIR/$app/$rpmfile" ]; then
+ warning "Package \"$PACKAGEDIR/$app/$rpmfile\" already exists."
+
+ if [ -z "$SOURCE_DISTS" ]; then
+ SOURCE_DISTS="$DISTNICK"
+ fi
+
+ continue 4
fi
-
- continue 3;
- fi
+ done
done
done
@@ -238,7 +240,11 @@ for app in $PKGS; do
export DISTCC_HOSTS CC="$DISTCC_CC" CXX="$DISTCC_CXX" GXX="$DISTCC_CXX"
export PATH="/usr/lib/distcc/bin:$PATH"
else
- export MAKEFLAGS="-j1"
+ if [ "$CPUNR" -a $CPUNR -ne 0 -a $CPUNR -ne 1 ]; then
+ export MAKEFLAGS="-j$CPUNR"
+ else
+ export MAKEFLAGS="-j1"
+ fi
export -n DISTCC_HOSTS CC CXX GXX
fi
View
75 dar-functions
@@ -69,9 +69,10 @@ function rpmconf {
return 1
fi
- if [ "$DISTNICK" ]; then
- local RPMVER="$(chroot $CHROOTDIR/$DISTNICK rpm --version | cut -d' ' -f3)"
- fi
+ if [ "$3" != "nocheck" ]; then
+ if [ "$DISTNICK" ]; then
+ local RPMVER="$(chroot $CHROOTDIR/$DISTNICK rpm --version | cut -d' ' -f3)"
+ fi
(
if [ -z "$DISTNICK" ] || [ "$RPMVER" \< "4.1" ] || ! chroot "$CHROOTDIR/$DISTNICK" /bin/su - -m $BUILD_USER -c "rpmdb -D \"dist $DISTNAME\" -D \"$DISTNICK 1\" -D \"$DISTNAME 1\" -E \"%{expand:%(head -n128 $SPECFILE)}\"" | grep -i "^ *$CONFIG *:" | sed -e "s/^ *$CONFIG *: *//i" | head -1; then
@@ -89,6 +90,11 @@ function rpmconf {
s|^\s+||;
s|\s+$||;
"
+ else
+ if ! grep -i "^ *$CONFIG *:" $SPECFILE | sed -e "s/^ *$CONFIG *: *//i" | head -1; then
+ debug "Config $CONFIG not found in $SPECFILE"
+ fi
+ fi
}
function rpmmacro {
@@ -194,11 +200,13 @@ function set_source_dists {
}
function set_tag {
+ TAGS="$DEFAULT_TAGS"
if [ -n "$FORCE_TAG" ]; then
TAG="$FORCE_TAG"
else
TAG="$(metaconf Tag)"
fi
+ if [ -z "$DEFAULT_TAG" ]; then DEFAULT_TAG="${DEFAULT_TAGS/ */}"; fi
if [ -z "$TAG" ]; then TAG="$DEFAULT_TAG"; fi
}
@@ -249,9 +257,10 @@ function download_sources {
local i=1
RC=1
while [ $RC -ne 0 -a $i -lt 4 ]; do
- wget -q -T 10 -O "$filename" "$url"
-# lftpget "$url" -o "$filename"
-# lftpget "$url" -O "$(dirname $filename)"
+ wget -v -t3 -T1 -O "$filename" "$url"
+# wget -q -T1 -O "$filename" "$url"
+# lftpget "$url" -c -o "$filename"
+# lftpget "$url" -c -O "$(dirname $filename)" -o "$(basename $filename)"
RC=$?
i=$((i+1))
done
@@ -302,13 +311,12 @@ EOF
function build_content {
local DISTNAME="$1"
local DISTPATH="$2"
- local REPO="$DEFAULT_TAG"
-# find "$PACKAGEDIR/" -name "*.$REPO.$DIST.*.rpm" \
-# -o -name "*.$DIST.$REPO.*.rpm" | \
+# find "$PACKAGEDIR/" -name "*.$TAG.$DIST.*.rpm" \
+# -o -name "*.$DIST.$TAG.*.rpm" | \
# sed -e "
-# s|.\+/\(.\+\)-[0-9].\+-[0-9].*\.$REPO\.$DIST\..\+\.rpm|\1|;
-# s|.\+/\(.\+\)-[0-9].\+-[0-9].*\.$DIST\.$REPO\..\+\.rpm|\1|;
+# s|.\+/\(.\+\)-[0-9].\+-[0-9].*\.$TAG\.$DIST\..\+\.rpm|\1|;
+# s|.\+/\(.\+\)-[0-9].\+-[0-9].*\.$DIST\.$TAG\..\+\.rpm|\1|;
# " | sort | uniq >$FTPDIR/extra/state/packages-$DIST.list
for rpm in $FTPDIR/$DISTPATH/RPMS.$REPO/*.rpm; do
@@ -320,7 +328,6 @@ function build_content {
function build_repo_apt {
local DISTTAG="$1"
local DISTPATH="$2"
- local REPO="$DEFAULT_TAG"
### Creating directories
mkdir -p $FTPDIR/$DISTPATH/{base,RPMS.$REPO}/
@@ -333,17 +340,21 @@ function build_repo_apt {
### FIXME: This should not be done hardcoded, rather have a list of archs inside the dist-config
### FIXME: And iterate through that list
- for tag in $DISTTAG; do
+ for disttag in $DISTTAG; do
+ for tag in $TAGS; do
+
case "$DISTARCH" in
i386)
- echo $PACKAGEDIR/*/*.$REPO.$tag.{noarch,i386,i586,i686,athlon}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ &>/dev/null # Backward compatibility
- echo $PACKAGEDIR/*/*.{$tag,0}.$REPO.{noarch,i386,i586,i686,athlon}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ &>/dev/null
+ echo $PACKAGEDIR/*/*.$tag.$disttag.{noarch,i386,i586,i686,athlon}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ &>/dev/null # Backward compatibility
+ echo $PACKAGEDIR/*/*.{$disttag,0}.$tag.{noarch,i386,i586,i686,athlon}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ &>/dev/null
;;
x86_64)
- echo $PACKAGEDIR/*/*.$REPO.$tag.{noarch,i386,i586,i686,athlon,x86_64}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ &>/dev/null # Backward compatibility
- echo $PACKAGEDIR/*/*.{$tag,0}.$REPO.{noarch,i386,i586,i686,athlon,x86_64}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ &>/dev/null
+ echo $PACKAGEDIR/*/*.$tag.$disttag.{noarch,i386,i586,i686,athlon,x86_64}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ &>/dev/null # Backward compatibility
+ echo $PACKAGEDIR/*/*.{$disttag,0}.$tag.{noarch,i386,i586,i686,athlon,x86_64}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/RPMS.$REPO/ &>/dev/null
;;
esac
+
+ done
done
### Build Apt repository
@@ -355,7 +366,6 @@ function build_repo_apt {
function build_repo_yum {
local DISTTAG="$1"
local DISTPATH="$2"
- REPO="$DEFAULT_TAG"
### Creating directories
mkdir -p $FTPDIR/$DISTPATH/$REPO/{RPMS,headers}/
@@ -367,19 +377,23 @@ function build_repo_yum {
### FIXME: This should not be done hardcoded, rather have a list of archs inside the dist-config
### FIXME: And iterate through that list
### Hardlink files
- for tag in $DISTTAG; do
+ for disttag in $DISTTAG; do
+ for tag in $TAGS; do
+
case "$DISTARCH" in
i386)
- echo $PACKAGEDIR/*/*.$REPO.$tag.{noarch,i386,i586,i686,athlon}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ &>/dev/null # Backward compatibility
- echo $PACKAGEDIR/*/*.{$tag,0}.$REPO.{noarch,i386,i586,i686,athlon}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ &>/dev/null
+ echo $PACKAGEDIR/*/*.$tag.$disttag.{noarch,i386,i586,i686,athlon}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ &>/dev/null # Backward compatibility
+ echo $PACKAGEDIR/*/*.{$disttag,0}.$tag.{noarch,i386,i586,i686,athlon}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ &>/dev/null
;;
x86_64)
- echo $PACKAGEDIR/*/*.$REPO.$tag.{noarch,i386,i586,i686,athlon,x86_64}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ &>/dev/null # Backward compatibility
- echo $PACKAGEDIR/*/*.{$tag,0}.$REPO.{noarch,i386,i586,i686,athlon,x86_64}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ &>/dev/null
+ echo $PACKAGEDIR/*/*.$tag.$disttag.{noarch,i386,i586,i686,athlon,x86_64}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ &>/dev/null # Backward compatibility
+ echo $PACKAGEDIR/*/*.{$disttag,0}.$tag.{noarch,i386,i586,i686,athlon,x86_64}.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DISTPATH/$REPO/RPMS/ &>/dev/null
;;
esac
+
+ done
done
-# ln -f $PACKAGEDIR/*/*.$REPO.src.rpm $FTPDIR/$DISTPATH/$REPO/SRPMS/ &>/dev/null
+# ln -f $PACKAGEDIR/*/*.$TAG.src.rpm $FTPDIR/$DISTPATH/$REPO/SRPMS/ &>/dev/null
### Build Yum repository
# yum-arch -q -z -d -c $FTPDIR/$DISTPATH/$REPO/
@@ -388,19 +402,20 @@ function build_repo_yum {
function build_repo {
local DISTPATH="$1"
- REPO="$DEFAULT_TAG"
createrepo -q $FTPDIR/$DISTPATH/$REPO/
}
function build_repo_srpms {
- REPO="$DEFAULT_TAG"
+ local DIR="$1"
- mkdir -p $FTPDIR/extra/SRPMS.$REPO/
- echo $FTPDIR/$DISTPATH/SRPMS.$REPO/*.rpm | xargs rm -f
- echo $PACKAGEDIR/*/*.$REPO.src.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/extra/SRPMS.$REPO/ &>/dev/null
+ mkdir -p $FTPDIR/$DIR
+ echo $FTPDIR/$DIR/*.src.rpm | xargs rm -f
+ for tag in $TAGS; do
+ echo $PACKAGEDIR/*/*.$tag.src.rpm | xargs -n 1 | xargs -i ln -f {} $FTPDIR/$DIR/ &>/dev/null
+ done
- genbasedir --bloat --bz2only $FTPDIR/extra/ dag
+# genbasedir --bloat --bz2only $FTPDIR/$DISTPATH/ $REPO
}
export LD_ASSUME_KERNEL="2.4.9"
View
13 dar-kickoff
@@ -53,6 +53,19 @@ echo "PS1=\"[\u@$DIST \W]# \"" >> $ROOT/$DIST/root/.bashrc
cp -auvx /etc/{group,hosts,passwd,resolv.conf,modules.conf} $ROOT/$DIST/etc/
+### Customize /etc/rpm/macros
+
+### Fix /dev/null
+rm -f $ROOT/$DIST/dev/null
+mknod -m0666 $ROOT/$DIST/dev/null c 1 3
+
+### Fix /dev/ptmx
+mknod -m0666 $ROOT/$DIST/dev/ptmx c 5 2
+
+### Fix /dev/shm
+mkdir $ROOT/$DIST/dev/shm/
+chmod 1777 $ROOT/$DIST/dev/shm/
+
#chroot $ROOT/$DIST /bin/nice /usr/bin/apt install
exit 0
View
55 dar-sync
@@ -4,8 +4,8 @@ source "/usr/lib/dar/dar-functions"
daropts ":a:d:rs:" $@
-DISTS="$DEFAULT_DISTS"
-TAG="$DEFAULT_TAG"
+set_dists
+set_tag
#build_htaccess
@@ -25,27 +25,42 @@ if [ "$GPG_NAME" -a "$GPG_PATH" ]; then
fi
if [ "$CREATE_REPO" == "true" ]; then
- for dist in $DISTS; do
- if [ -r "$CONFIGDIR/dists/$dist/config" ]; then
- source "$CONFIGDIR/dists/$dist/config"
- else
- warning "Configfile $CONFIGDIR/dists/$dist/config missing. Aborting."
- continue
- fi
+ echo "Building SRPM repository."
+ build_repo_srpms "source"
+fi
+
+for dist in $DISTS; do
+ if [ -r "$CONFIGDIR/dists/$dist/config" ]; then
+ source "$CONFIGDIR/dists/$dist/config"
+ else
+ warning "Configfile $CONFIGDIR/dists/$dist/config missing. Aborting."
+ continue
+ fi
+ if [ "$CREATE_REPO" == "true" ]; then
echo "Building $dist repository in $DISTPATH."
- build_repo_apt "$DISTTAG" "$DISTPATH"
- build_repo_yum "$DISTTAG" "$DISTPATH"
- build_repo "$DISTPATH"
- build_env "$DISTNICK" "$DISTNAME"
- build_content "$DISTNAME" "$DISTPATH"
- done
+ ln -sf ../../../../source $FTPDIR/$DISTPATH/SRPMS.dag
+ if [ "$REPO_APT" == "yes" ]; then
+ build_repo_apt "$DISTTAG" "$DISTPATH"
+ fi
+ if [ "$REPO_YUM" == "yes" ]; then
+ build_repo_yum "$DISTTAG" "$DISTPATH"
+ fi
+ if [ "$REPO_CREATEREPO" == "yes" ]; then
+ build_repo "$DISTPATH"
+ fi
+ fi
+ build_env "$DISTNICK" "$DISTNAME"
+ build_content "$DISTNAME" "$DISTPATH"
- build_repo_srpms
-fi
+done
echo -n "Building source package list."
-find $PACKAGEDIR/ -name "*.$TAG.src.rpm" | sed -e "s|.\+/\(.\+\)-[0-9].\+-[0-9].*\.$TAG\.src\.rpm|\1|" | sort | uniq >$FTPDIR/extra/state/packages-src.list
+(
+ for TAG in $TAGS; do
+ find $PACKAGEDIR/ -name "*.$TAG.src.rpm" | sed -e "s|.\+/\(.\+\)-[0-9].\+-[0-9].*\.$TAG\.src\.rpm|\1|"
+ done
+) | sort | uniq >$FTPDIR/extra/state/packages-src.list
echo -e "\t($(wc -l $FTPDIR/extra/state/packages-src.list))"
echo -n "Building package list."
@@ -55,11 +70,11 @@ echo -e "\t($(wc -l $FTPDIR/extra/state/packages.list))"
echo -n "Building summary list."
rm -f $FTPDIR/extra/state/summaries.list
-for app in $(echo $PACKAGEDIR/*/); do
+for app in $(cd $PACKAGEDIR; echo *); do
app="$(basename $app)"
SPECFILE="$PACKAGEDIR/$app/$app.spec"
if [ -r "$SPECFILE" ]; then
- echo -e "$app\t$(rpmconf Summary)" >> $FTPDIR/extra/state/summaries.list
+ echo -e "$app\t$(rpmconf Summary "" nocheck)" >> $FTPDIR/extra/state/summaries.list
fi
done
echo -e "\t($(wc -l $FTPDIR/extra/state/summaries.list))"
View
5 dar-update
@@ -4,10 +4,11 @@
source "/usr/lib/dar/dar-functions"
-daropts ":a:d:r:s:" $@
+daropts ":a:d:rs:" $@
PKGS="$OPTS"
-DISTS="$DEFAULT_DISTS"
+#DISTS="$DEFAULT_DISTS"
+set_dists
### Update build environment
for distname in $DISTS; do
View
13 dar.conf
@@ -1,18 +1,19 @@
### Global variables
ROOT="/dar"
CONFIGDIR="/etc/dar"
-PACKAGEDIR="$ROOT/packages"
FTPDIR="$ROOT/pub"
+PACKAGEDIR="$FTPDIR/packages"
SPECSDIR="$ROOT/rpms"
CHROOTDIR="$ROOT/chroot"
BUILDDIR="$ROOT/build"
TEMPDIR="$ROOT/tmp"
-DEFAULT_DISTS="fc2a fc2i fc1i el3a el3i rh9i rh8i rh7i el2i rh6i"
-DEFAULT_SOURCE_DISTS="fc2i"
+DEFAULT_DISTS="fc3a fc3i fc2a fc2i fc1i el3a el3i rh9i rh7i el2i"
+DEFAULT_SOURCE_DISTS="fc3i"
DEFAULT_ARCHS="i386"
-DEFAULT_TAG="dag"
+DEFAULT_TAGS="rf dag"
+REPO="dag"
### Variables for dar-build
USE_SOAPBOX=0
@@ -22,11 +23,11 @@ USE_ROOT=0
RETAIN_LOGS="yes"
BUILD_USER="dag"
BUILD_GROUP="dag"
-CPUNR="4"
+CPUNR="1"
DISTCC_HOSTS="emyn localhost"
### Variables for dar-sync
-RSYNC_OPTIONS="--exclude bert/ --exclude dries/"
+RSYNC_OPTIONS="--exclude bert/ --exclude dries/ --exclude redhat/6.2 --exclude redhat/8.0"
RSYNC_TARGET="dag@rsync.sw.be:dag.wieers.com/pub/"
### Use wondershaper
RSYNC_LIMIT="12"
View
4 dists/el2i/config
@@ -15,3 +15,7 @@ DISTNICK="el2i"
DISTTAG="0.el2 rhel2.1"
DISTPATH="redhat/el2.1/en/i386"
DISTARCH="i386"
+
+REPO_APT="yes"
+REPO_YUM="no"
+REPO_CREATEREPO="no"
View
4 dists/el3a/config
@@ -15,3 +15,7 @@ DISTNICK="el3a"
DISTTAG="1.el3 rhel3"
DISTPATH="redhat/el3/en/x86_64"
DISTARCH="x86_64"
+
+REPO_APT="yes"
+REPO_YUM="yes"
+REPO_CREATEREPO="no"
View
4 dists/el3i/config
@@ -15,3 +15,7 @@ DISTNICK="el3i"
DISTTAG="1.el3 rhel3"
DISTPATH="redhat/el3/en/i386"
DISTARCH="i386"
+
+REPO_APT="yes"
+REPO_YUM="yes"
+REPO_CREATEREPO="no"
View
4 dists/fc1i/config
@@ -13,3 +13,7 @@ DISTNICK="fc1i"
DISTTAG="1.fc1 rhfc1"
DISTPATH="fedora/1/en/i386"
DISTARCH="i386"
+
+REPO_APT="yes"
+REPO_YUM="yes"
+REPO_CREATEREPO="no"
View
6 dists/fc2a/config
@@ -12,6 +12,10 @@ INSTALLCMD="yum install %p"
DISTNAME="fc2"
DISTNICK="fc2a"
-DISTTAG="1.fc2 rhfc2"
+DISTTAG="1.fc2"
DISTPATH="fedora/2/en/x86_64"
DISTARCH="x86_64"
+
+REPO_APT="yes"
+REPO_YUM="yes"
+REPO_CREATEREPO="no"
View
6 dists/fc2i/config
@@ -10,6 +10,10 @@ INSTALLCMD="apt-get -qq -y -m install %p"
DISTNAME="fc2"
DISTNICK="fc2i"
-DISTTAG="1.fc2 rhfc2"
+DISTTAG="1.fc2"
DISTPATH="fedora/2/en/i386"
DISTARCH="i386"
+
+REPO_APT="yes"
+REPO_YUM="yes"
+REPO_CREATEREPO="no"
View
4 dists/rh6i/config
@@ -13,3 +13,7 @@ DISTNICK="rh6i"
DISTTAG="0.rh6 rh62"
DISTPATH="redhat/6.2/en/i386"
DISTARCH="i386"
+
+REPO_APT="yes"
+REPO_YUM="no"
+REPO_CREATEREPO="no"
View
4 dists/rh7i/config
@@ -13,3 +13,7 @@ DISTNICK="rh7i"
DISTTAG="0.rh7 rh73"
DISTPATH="redhat/7.3/en/i386"
DISTARCH="i386"
+
+REPO_APT="yes"
+REPO_YUM="yes"
+REPO_CREATEREPO="no"
View
4 dists/rh8i/config
@@ -13,3 +13,7 @@ DISTNICK="rh8i"
DISTTAG="0.rh8 rh80"
DISTPATH="redhat/8.0/en/i386"
DISTARCH="i386"
+
+REPO_APT="yes"
+REPO_YUM="yes"
+REPO_CREATEREPO="no"
View
4 dists/rh9i/config
@@ -13,3 +13,7 @@ DISTNICK="rh9i"
DISTTAG="0.rh9 rh90"
DISTPATH="redhat/9/en/i386"
DISTARCH="i386"
+
+REPO_APT="yes"
+REPO_YUM="yes"
+REPO_CREATEREPO="no"

0 comments on commit 7dca4d2

Please sign in to comment.
Something went wrong with that request. Please try again.