| 6 |
|
# |
| 7 |
|
# $Id$ |
| 8 |
|
|
| 9 |
< |
# todo: ./configure on server pulls from net - make local? |
| 10 |
< |
|
| 9 |
> |
# base directory for staging |
| 10 |
|
STAGING=/u1/i-scream/staging |
| 11 |
|
|
| 12 |
+ |
# log everything :-) |
| 13 |
|
LOG=$STAGING/build.log |
| 14 |
|
exec > $LOG 2>&1 |
| 15 |
|
set -x |
| 16 |
|
|
| 17 |
+ |
# various directories |
| 18 |
|
CMSSOURCE=$STAGING/cms/source |
| 19 |
|
BUILDS=$STAGING/builds |
| 20 |
+ |
DISTFILES=$STAGING/distfiles |
| 21 |
|
CVSROOT=/u1/i-scream/cvsmirror |
| 22 |
|
WEBSNAPSHOTS=/u1/i-scream/httpd/htdocs/snapshots |
| 23 |
+ |
LIBURL=http://www.i-scream.org.uk/downloads/lib |
| 24 |
|
|
| 25 |
+ |
# standard process for an i-scream style build |
| 26 |
+ |
iscreambuild() { |
| 27 |
+ |
SOURCEDIR=$1 |
| 28 |
+ |
DESTDIR=$2 |
| 29 |
+ |
BIN=$3 |
| 30 |
+ |
cd $SOURCEDIR |
| 31 |
+ |
if [ "X$TAG" != "X" ]; then |
| 32 |
+ |
cvs -d $CVSROOT update -dPr $TAG |
| 33 |
+ |
cvs2cl --stdout --no-wrap -r -t -w -S -g "-d $CVSROOT" -g "-q" -l "-r::$TAG" > build/ChangeLog |
| 34 |
+ |
fi |
| 35 |
+ |
LIBRARIES=eval `grep "LIBRARIES=" configure` |
| 36 |
+ |
for LIB in $LIBRARIES; do |
| 37 |
+ |
fetchlib $LIB |
| 38 |
+ |
cp $DISTFILES/$LIB build/lib |
| 39 |
+ |
done |
| 40 |
+ |
./configure |
| 41 |
+ |
if [ "X$BIN" = "Xyes" ]; then |
| 42 |
+ |
gnumake dist-bin dest=$DESTDIR CVSROOT=$CVSROOT |
| 43 |
+ |
gnumake clean |
| 44 |
+ |
fi |
| 45 |
+ |
gnumake dist dest=$DESTDIR CVSROOT=$CVSROOT |
| 46 |
+ |
} |
| 47 |
+ |
|
| 48 |
+ |
# standard process for a gnu autoconf/automake/libtool style build |
| 49 |
+ |
gnubuild() { |
| 50 |
+ |
SOURCEDIR=$1 |
| 51 |
+ |
DESTDIR=$2 |
| 52 |
+ |
LIBTOOL=$3 |
| 53 |
+ |
CONFIGUREARGS=$4 |
| 54 |
+ |
cd $SOURCEDIR |
| 55 |
+ |
if [ "X$TAG" != "X" ]; then |
| 56 |
+ |
cvs -d $CVSROOT update -dPr $TAG |
| 57 |
+ |
cvs2cl --stdout --no-wrap -r -t -w -S -g "-d $CVSROOT" -g "-q" -l "-r::$TAG" > ChangeLog |
| 58 |
+ |
fi |
| 59 |
+ |
aclocal |
| 60 |
+ |
autoheader |
| 61 |
+ |
autoconf |
| 62 |
+ |
if [ "X$LIBTOOL" = "Xyes" ]; then |
| 63 |
+ |
libtoolize -c |
| 64 |
+ |
fi |
| 65 |
+ |
automake -a -c |
| 66 |
+ |
./configure $CONFIGUREARGS |
| 67 |
+ |
gnumake dist |
| 68 |
+ |
TARBALL=`ls *.tar.gz` |
| 69 |
+ |
mkdir -p $DESTDIR |
| 70 |
+ |
cp $TARBALL $DESTDIR |
| 71 |
+ |
gpg -abs --default-key=0x135D6B0A $DESTDIR/$TARBALL |
| 72 |
+ |
} |
| 73 |
+ |
|
| 74 |
+ |
# standard process for a python distutils build |
| 75 |
+ |
pydistbuild() { |
| 76 |
+ |
SOURCEDIR=$1 |
| 77 |
+ |
DESTDIR=$2 |
| 78 |
+ |
cd $SOURCEDIR |
| 79 |
+ |
if [ "X$TAG" != "X" ]; then |
| 80 |
+ |
cvs -d $CVSROOT update -dPr $TAG |
| 81 |
+ |
cvs2cl --stdout --no-wrap -r -t -w -S -g "-d $CVSROOT" -g "-q" -l "-r::$TAG" > ChangeLog |
| 82 |
+ |
fi |
| 83 |
+ |
python setup.py sdist |
| 84 |
+ |
TARBALL=`ls dist/*.tar.gz` |
| 85 |
+ |
mkdir -p $DESTDIR |
| 86 |
+ |
cp $TARBALL $DESTDIR |
| 87 |
+ |
gpg -abs --default-key=0x135D6B0A $DESTDIR/`basename $TARBALL` |
| 88 |
+ |
} |
| 89 |
+ |
|
| 90 |
+ |
# grab a required library off the web to maintain a local copy |
| 91 |
+ |
fetchlib() { |
| 92 |
+ |
LIB=$1 |
| 93 |
+ |
if [ ! -f $DISTFILES/$LIB ]; then |
| 94 |
+ |
wget -P $DISTFILES $LIBURL/$LIB |
| 95 |
+ |
fi |
| 96 |
+ |
if [ ! -f $DISTFILES/$LIB ]; then |
| 97 |
+ |
echo Required library $LIB does not exist at $LIBURL |
| 98 |
+ |
exit 1 |
| 99 |
+ |
fi |
| 100 |
+ |
} |
| 101 |
+ |
|
| 102 |
+ |
# Full set of programs to be built |
| 103 |
+ |
PROGS="server util corbaservices conient dbreporter rrdgraphing php winhost libstatgrab ihost" |
| 104 |
+ |
|
| 105 |
+ |
# Read command line args |
| 106 |
+ |
if [ "X$1" != "X" ]; then |
| 107 |
+ |
PROGS=$1 |
| 108 |
+ |
fi |
| 109 |
+ |
if [ "X$2" != "X" ]; then |
| 110 |
+ |
TAG=$2 |
| 111 |
+ |
fi |
| 112 |
+ |
|
| 113 |
|
echo "+ Build started on `date`" |
| 114 |
|
|
| 115 |
+ |
# remove any old files so we have a fresh start |
| 116 |
|
echo "+ Cleaning up" |
| 25 |
– |
|
| 117 |
|
rm -Rf cms |
| 118 |
|
rm -Rf $BUILDS/* |
| 119 |
|
|
| 120 |
< |
echo "+ Updating CVS" |
| 120 |
> |
# make sure our local cvs is up-to-date |
| 121 |
> |
/usr/local/packages/cvsup/bin/cvsup -L 2 /u1/i-scream/cvsup/supfile |
| 122 |
|
|
| 123 |
+ |
# pull the latest source from our local cvs |
| 124 |
+ |
echo "+ Updating CVS" |
| 125 |
|
cvs -d $CVSROOT checkout cms/source |
| 126 |
|
cd $CMSSOURCE |
| 127 |
|
|
| 128 |
< |
echo "+ Building Server" |
| 128 |
> |
# Build all listed programs |
| 129 |
> |
for PROG in $PROGS; do |
| 130 |
> |
case $PROG in |
| 131 |
> |
server) |
| 132 |
> |
iscreambuild $CMSSOURCE/server $BUILDS/server yes |
| 133 |
> |
;; |
| 134 |
> |
util) |
| 135 |
> |
iscreambuild $CMSSOURCE/util $BUILDS/util yes |
| 136 |
> |
;; |
| 137 |
> |
corbaservices) |
| 138 |
> |
iscreambuild $CMSSOURCE/corbaservices $BUILDS/corbaservices yes |
| 139 |
> |
;; |
| 140 |
> |
conient) |
| 141 |
> |
iscreambuild $CMSSOURCE/conient $BUILDS/conient yes |
| 142 |
> |
;; |
| 143 |
> |
rrdgraphing) |
| 144 |
> |
iscreambuild $CMSSOURCE/reports/rrdgraphing $BUILDS/rrdgraphing no |
| 145 |
> |
;; |
| 146 |
> |
php) |
| 147 |
> |
iscreambuild $CMSSOURCE/reports/php $BUILDS/php no |
| 148 |
> |
;; |
| 149 |
> |
libstatgrab) |
| 150 |
> |
gnubuild $CMSSOURCE/libstatgrab $BUILDS/libstatgrab yes |
| 151 |
> |
;; |
| 152 |
> |
ihost) |
| 153 |
> |
gnubuild $CMSSOURCE/ihost $BUILDS/ihost no --with-libstatgrab-prefix=/usr/local/packages/libstatgrab |
| 154 |
> |
;; |
| 155 |
> |
libukcprog) |
| 156 |
> |
gnubuild $CMSSOURCE/libukcprog $BUILDS/libukcprog yes |
| 157 |
> |
;; |
| 158 |
> |
idar) |
| 159 |
> |
gnubuild $CMSSOURCE/idar $BUILDS/idar no --with-curses-prefix=/usr/local/packages/ncurses |
| 160 |
> |
;; |
| 161 |
> |
pystatgrab) |
| 162 |
> |
pydistbuild $CMSSOURCE/pystatgrab $BUILDS/libstatgrab |
| 163 |
> |
;; |
| 164 |
> |
esac |
| 165 |
> |
done |
| 166 |
|
|
| 167 |
< |
cd $CMSSOURCE/server |
| 37 |
< |
./configure |
| 38 |
< |
gnumake dist-bin dest=$BUILDS/server |
| 39 |
< |
gnumake clean |
| 40 |
< |
gnumake dist dest=$BUILDS/server |
| 41 |
< |
|
| 42 |
< |
echo "+ Building Util Package" |
| 43 |
< |
|
| 44 |
< |
cd $CMSSOURCE/util |
| 45 |
< |
./configure |
| 46 |
< |
gnumake dist-bin dest=$BUILDS/util |
| 47 |
< |
gnumake clean |
| 48 |
< |
gnumake dist dest=$BUILDS/util |
| 49 |
< |
|
| 50 |
< |
echo "+ Building Corba Services Package" |
| 51 |
< |
|
| 52 |
< |
cd $CMSSOURCE/corbaservices |
| 53 |
< |
./configure |
| 54 |
< |
gnumake dist-bin dest=$BUILDS/corbaservices |
| 55 |
< |
gnumake clean |
| 56 |
< |
gnumake dist dest=$BUILDS/corbaservices |
| 57 |
< |
|
| 58 |
< |
echo "+ Building Conient Package" |
| 59 |
< |
|
| 60 |
< |
cd $CMSSOURCE/conient |
| 61 |
< |
./configure |
| 62 |
< |
gnumake dist-bin dest=$BUILDS/conient |
| 63 |
< |
gnumake clean |
| 64 |
< |
gnumake dist dest=$BUILDS/conient |
| 65 |
< |
|
| 66 |
< |
echo "+ Building DBReporter Package" |
| 67 |
< |
|
| 68 |
< |
cd $CMSSOURCE/reports/DBReporter |
| 69 |
< |
./configure |
| 70 |
< |
gnumake dist-bin dest=$BUILDS/dbreporter |
| 71 |
< |
gnumake clean |
| 72 |
< |
gnumake dist dest=$BUILDS/dbreporter |
| 73 |
< |
|
| 74 |
< |
echo "+ Building RRD Graphing Package" |
| 75 |
< |
|
| 76 |
< |
cd $CMSSOURCE/reports/rrdgraphing |
| 77 |
< |
./configure |
| 78 |
< |
gnumake dist dest=$BUILDS/rrdgraphing |
| 79 |
< |
|
| 80 |
< |
echo "+ Building PHP Pages Package" |
| 81 |
< |
|
| 82 |
< |
cd $CMSSOURCE/reports/php |
| 83 |
< |
./configure |
| 84 |
< |
gnumake dist dest=$BUILDS/php |
| 85 |
< |
|
| 86 |
< |
echo "+ Building Winhost Package" |
| 87 |
< |
|
| 88 |
< |
cd $CMSSOURCE/host/winhost |
| 89 |
< |
./configure |
| 90 |
< |
gnumake dist dest=$BUILDS/winhost |
| 91 |
< |
|
| 92 |
< |
echo "+ Making libstatgrab" |
| 93 |
< |
|
| 94 |
< |
cd $CMSSOURCE/libstatgrab |
| 95 |
< |
aclocal |
| 96 |
< |
autoheader |
| 97 |
< |
autoconf |
| 98 |
< |
libtoolize -c |
| 99 |
< |
automake -a -c |
| 100 |
< |
./configure |
| 101 |
< |
gnumake dist |
| 102 |
< |
LIBSTATGRAB=`ls libstatgrab-*.tar.gz` |
| 103 |
< |
mkdir -p $BUILDS/libstatgrab |
| 104 |
< |
cp $LIBSTATGRAB $BUILDS/libstatgrab |
| 105 |
< |
gpg -abs --default-key=0x135D6B0A $BUILDS/libstatgrab/$LIBSTATGRAB |
| 106 |
< |
|
| 107 |
< |
echo "+ Making ihost" |
| 108 |
< |
|
| 109 |
< |
cd $CMSSOURCE/host/ihost |
| 110 |
< |
aclocal |
| 111 |
< |
autoheader |
| 112 |
< |
autoconf |
| 113 |
< |
automake -a -c |
| 114 |
< |
./configure |
| 115 |
< |
gnumake dist |
| 116 |
< |
IHOST=`ls ihost-*.tar.gz` |
| 117 |
< |
mkdir -p $BUILDS/ihost |
| 118 |
< |
cp $IHOST $BUILDS/ihost |
| 119 |
< |
gpg -abs --default-key=0x135D6B0A $BUILDS/ihost/$IHOST |
| 120 |
< |
|
| 167 |
> |
# sync builds to the web tree |
| 168 |
|
echo "+ Copying to snapshots web tree" |
| 169 |
< |
|
| 123 |
< |
cp -R $BUILDS/* $WEBSNAPSHOTS |
| 169 |
> |
rsync -rlpogtxHv $BUILDS/. $WEBSNAPSHOTS |
| 170 |
|
|
| 171 |
|
echo "+ Done" |
| 172 |
|
|