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