ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/misc/scripts/shell/build.sh
Revision: 1.9
Committed: Tue Feb 10 20:28:13 2004 UTC (20 years, 3 months ago) by tdb
Content type: application/x-sh
Branch: MAIN
Changes since 1.8: +2 -2 lines
Log Message:
Be more verbose with cvsup of repo.

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