ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/misc/scripts/shell/build.sh
Revision: 1.16
Committed: Mon Jul 18 14:14:32 2005 UTC (19 years, 4 months ago) by tdb
Content type: application/x-sh
Branch: MAIN
CVS Tags: HEAD
Changes since 1.15: +2 -2 lines
Log Message:
Use ukc tweak to aclocal.

File Contents

# User Rev Content
1 tdb 1.1 #!/bin/sh
2    
3     # Build script
4     # builds new-style dists from cvs source, and puts them
5     # in a single location for download (eg. snapshots)
6     #
7 tdb 1.16 # $Id: build.sh,v 1.15 2005/02/10 17:57:59 tdb Exp $
8 tdb 1.1
9 tdb 1.3 # base directory for staging
10 tdb 1.1 STAGING=/u1/i-scream/staging
11    
12 tdb 1.3 # log everything :-)
13 tdb 1.1 LOG=$STAGING/build.log
14     exec > $LOG 2>&1
15     set -x
16    
17 tdb 1.3 # various directories
18 tdb 1.14 PROJECTS=$STAGING/projects
19 tdb 1.1 BUILDS=$STAGING/builds
20 tdb 1.3 DISTFILES=$STAGING/distfiles
21 tdb 1.1 CVSROOT=/u1/i-scream/cvsmirror
22     WEBSNAPSHOTS=/u1/i-scream/httpd/htdocs/snapshots
23 tdb 1.12 LIBURL=http://www.i-scream.org/pub/i-scream/cms/lib
24 tdb 1.3
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 tdb 1.11 else
35     cvs2cl --stdout --no-wrap -r -t -w -S -g "-d $CVSROOT" -g "-q" > build/ChangeLog
36 tdb 1.3 fi
37 tdb 1.15 LIBRARIES=`eval \`grep "LIBRARIES=" configure\``
38 tdb 1.3 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     # standard process for a gnu autoconf/automake/libtool style build
51     gnubuild() {
52     SOURCEDIR=$1
53     DESTDIR=$2
54     LIBTOOL=$3
55 tdb 1.8 CONFIGUREARGS=$4
56 tdb 1.3 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 tdb 1.11 else
61     cvs2cl --stdout --no-wrap -r -t -w -S -g "-d $CVSROOT" -g "-q" > ChangeLog
62 tdb 1.3 fi
63 tdb 1.16 aclocal --skip
64 tdb 1.3 autoheader
65     autoconf
66     if [ "X$LIBTOOL" = "Xyes" ]; then
67     libtoolize -c
68     fi
69     automake -a -c
70 tdb 1.8 ./configure $CONFIGUREARGS
71 tdb 1.3 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 tdb 1.10 # 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 tdb 1.11 else
87     cvs2cl --stdout --no-wrap -r -t -w -S -g "-d $CVSROOT" -g "-q" > ChangeLog
88 tdb 1.10 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 tdb 1.3 # 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     # Full set of programs to be built
109 tdb 1.13 PROGS="server util corbaservices conient rrdgraphing php libstatgrab ihost libukcprog idar pystatgrab"
110 tdb 1.3
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 tdb 1.1
119     echo "+ Build started on `date`"
120    
121 tdb 1.3 # remove any old files so we have a fresh start
122 tdb 1.1 echo "+ Cleaning up"
123 tdb 1.14 rm -Rf projects
124 tdb 1.1 rm -Rf $BUILDS/*
125    
126 tdb 1.8 # make sure our local cvs is up-to-date
127 tdb 1.9 /usr/local/packages/cvsup/bin/cvsup -L 2 /u1/i-scream/cvsup/supfile
128 tdb 1.8
129 tdb 1.3 # pull the latest source from our local cvs
130 tdb 1.1 echo "+ Updating CVS"
131 tdb 1.14 cvs -d $CVSROOT checkout projects
132     cd $PROJECTS
133 tdb 1.1
134 tdb 1.3 # Build all listed programs
135     for PROG in $PROGS; do
136     case $PROG in
137     server)
138 tdb 1.14 iscreambuild $PROJECTS/cms/source/server $BUILDS/server yes
139 tdb 1.3 ;;
140     util)
141 tdb 1.14 iscreambuild $PROJECTS/cms/source/util $BUILDS/util yes
142 tdb 1.3 ;;
143     corbaservices)
144 tdb 1.14 iscreambuild $PROJECTS/cms/source/corbaservices $BUILDS/corbaservices yes
145 tdb 1.3 ;;
146     conient)
147 tdb 1.14 iscreambuild $PROJECTS/cms/source/conient $BUILDS/conient yes
148 tdb 1.3 ;;
149     rrdgraphing)
150 tdb 1.14 iscreambuild $PROJECTS/cms/source/reports/rrdgraphing $BUILDS/rrdgraphing no
151 tdb 1.3 ;;
152     php)
153 tdb 1.14 iscreambuild $PROJECTS/cms/source/reports/php $BUILDS/php no
154 tdb 1.3 ;;
155     libstatgrab)
156 tdb 1.14 gnubuild $PROJECTS/libstatgrab $BUILDS/libstatgrab yes
157 tdb 1.3 ;;
158     ihost)
159 tdb 1.14 gnubuild $PROJECTS/cms/source/ihost $BUILDS/ihost no --with-libstatgrab-prefix=/usr/local/packages/libstatgrab
160 tdb 1.6 ;;
161     libukcprog)
162 tdb 1.14 gnubuild $PROJECTS/libukcprog $BUILDS/libukcprog yes
163 tdb 1.7 ;;
164     idar)
165 tdb 1.14 gnubuild $PROJECTS/cms/source/idar $BUILDS/idar no --with-curses-prefix=/usr/local/packages/ncurses
166 tdb 1.10 ;;
167     pystatgrab)
168 tdb 1.14 pydistbuild $PROJECTS/pystatgrab $BUILDS/pystatgrab
169 tdb 1.3 ;;
170     esac
171     done
172 tdb 1.1
173 tdb 1.3 # sync builds to the web tree
174 tdb 1.1 echo "+ Copying to snapshots web tree"
175 tdb 1.4 rsync -rlpogtxHv $BUILDS/. $WEBSNAPSHOTS
176 tdb 1.1
177     echo "+ Done"
178    
179     echo "+ Build completed on `date`"