--- misc/scripts/shell/build.sh 2003/03/12 09:51:02 1.3 +++ misc/scripts/shell/build.sh 2005/07/18 14:14:32 1.16 @@ -4,7 +4,7 @@ # builds new-style dists from cvs source, and puts them # in a single location for download (eg. snapshots) # -# $Id: build.sh,v 1.3 2003/03/12 09:51:02 tdb Exp $ +# $Id: build.sh,v 1.16 2005/07/18 14:14:32 tdb Exp $ # base directory for staging STAGING=/u1/i-scream/staging @@ -15,12 +15,12 @@ exec > $LOG 2>&1 set -x # various directories -CMSSOURCE=$STAGING/cms/source +PROJECTS=$STAGING/projects BUILDS=$STAGING/builds DISTFILES=$STAGING/distfiles CVSROOT=/u1/i-scream/cvsmirror WEBSNAPSHOTS=/u1/i-scream/httpd/htdocs/snapshots -LIBURL=http://www.i-scream.org.uk/downloads/lib +LIBURL=http://www.i-scream.org/pub/i-scream/cms/lib # standard process for an i-scream style build iscreambuild() { @@ -31,9 +31,10 @@ iscreambuild() { if [ "X$TAG" != "X" ]; then cvs -d $CVSROOT update -dPr $TAG cvs2cl --stdout --no-wrap -r -t -w -S -g "-d $CVSROOT" -g "-q" -l "-r::$TAG" > build/ChangeLog + else + cvs2cl --stdout --no-wrap -r -t -w -S -g "-d $CVSROOT" -g "-q" > build/ChangeLog fi - LIBRARIES= - eval `grep "LIBRARIES=" configure` + LIBRARIES=`eval \`grep "LIBRARIES=" configure\`` for LIB in $LIBRARIES; do fetchlib $LIB cp $DISTFILES/$LIB build/lib @@ -51,19 +52,22 @@ gnubuild() { SOURCEDIR=$1 DESTDIR=$2 LIBTOOL=$3 + CONFIGUREARGS=$4 cd $SOURCEDIR if [ "X$TAG" != "X" ]; then cvs -d $CVSROOT update -dPr $TAG cvs2cl --stdout --no-wrap -r -t -w -S -g "-d $CVSROOT" -g "-q" -l "-r::$TAG" > ChangeLog + else + cvs2cl --stdout --no-wrap -r -t -w -S -g "-d $CVSROOT" -g "-q" > ChangeLog fi - aclocal + aclocal --skip autoheader autoconf if [ "X$LIBTOOL" = "Xyes" ]; then libtoolize -c fi automake -a -c - ./configure + ./configure $CONFIGUREARGS gnumake dist TARBALL=`ls *.tar.gz` mkdir -p $DESTDIR @@ -71,6 +75,24 @@ gnubuild() { gpg -abs --default-key=0x135D6B0A $DESTDIR/$TARBALL } +# standard process for a python distutils build +pydistbuild() { + SOURCEDIR=$1 + DESTDIR=$2 + cd $SOURCEDIR + if [ "X$TAG" != "X" ]; then + cvs -d $CVSROOT update -dPr $TAG + cvs2cl --stdout --no-wrap -r -t -w -S -g "-d $CVSROOT" -g "-q" -l "-r::$TAG" > ChangeLog + else + cvs2cl --stdout --no-wrap -r -t -w -S -g "-d $CVSROOT" -g "-q" > ChangeLog + fi + python setup.py sdist + TARBALL=`ls dist/*.tar.gz` + mkdir -p $DESTDIR + cp $TARBALL $DESTDIR + gpg -abs --default-key=0x135D6B0A $DESTDIR/`basename $TARBALL` +} + # grab a required library off the web to maintain a local copy fetchlib() { LIB=$1 @@ -84,7 +106,7 @@ fetchlib() { } # Full set of programs to be built -PROGS="server util corbaservices conient dbreporter rrdgraphing php winhost libstatgrab ihost" +PROGS="server util corbaservices conient rrdgraphing php libstatgrab ihost libukcprog idar pystatgrab" # Read command line args if [ "X$1" != "X" ]; then @@ -98,53 +120,59 @@ echo "+ Build started on `date`" # remove any old files so we have a fresh start echo "+ Cleaning up" -rm -Rf cms +rm -Rf projects rm -Rf $BUILDS/* +# make sure our local cvs is up-to-date +/usr/local/packages/cvsup/bin/cvsup -L 2 /u1/i-scream/cvsup/supfile + # pull the latest source from our local cvs echo "+ Updating CVS" -cvs -d $CVSROOT checkout cms/source -cd $CMSSOURCE +cvs -d $CVSROOT checkout projects +cd $PROJECTS # Build all listed programs for PROG in $PROGS; do case $PROG in server) - iscreambuild $CMSSOURCE/server $BUILDS/server yes + iscreambuild $PROJECTS/cms/source/server $BUILDS/server yes ;; util) - iscreambuild $CMSSOURCE/util $BUILDS/util yes + iscreambuild $PROJECTS/cms/source/util $BUILDS/util yes ;; corbaservices) - iscreambuild $CMSSOURCE/corbaservices $BUILDS/corbaservices yes + iscreambuild $PROJECTS/cms/source/corbaservices $BUILDS/corbaservices yes ;; conient) - iscreambuild $CMSSOURCE/conient $BUILDS/conient yes + iscreambuild $PROJECTS/cms/source/conient $BUILDS/conient yes ;; - dbreporter) - iscreambuild $CMSSOURCE/reports/DBReporter $BUILDS/dbreporter yes - ;; rrdgraphing) - iscreambuild $CMSSOURCE/reports/rrdgraphing $BUILDS/rrdgraphing no + iscreambuild $PROJECTS/cms/source/reports/rrdgraphing $BUILDS/rrdgraphing no ;; php) - iscreambuild $CMSSOURCE/reports/php $BUILDS/php no + iscreambuild $PROJECTS/cms/source/reports/php $BUILDS/php no ;; - winhost) - iscreambuild $CMSSOURCE/host/winhost $BUILDS/winhost no - ;; libstatgrab) - gnubuild $CMSSOURCE/libstatgrab $BUILDS/libstatgrab yes + gnubuild $PROJECTS/libstatgrab $BUILDS/libstatgrab yes ;; ihost) - gnubuild $CMSSOURCE/host/ihost $BUILDS/ihost no + gnubuild $PROJECTS/cms/source/ihost $BUILDS/ihost no --with-libstatgrab-prefix=/usr/local/packages/libstatgrab ;; + libukcprog) + gnubuild $PROJECTS/libukcprog $BUILDS/libukcprog yes + ;; + idar) + gnubuild $PROJECTS/cms/source/idar $BUILDS/idar no --with-curses-prefix=/usr/local/packages/ncurses + ;; + pystatgrab) + pydistbuild $PROJECTS/pystatgrab $BUILDS/pystatgrab + ;; esac done # sync builds to the web tree echo "+ Copying to snapshots web tree" -echo rsync -rlpogtxHv $BUILDS/. $WEBSNAPSHOTS +rsync -rlpogtxHv $BUILDS/. $WEBSNAPSHOTS echo "+ Done"