107
|
1 #!/bin/bash
|
|
2
|
|
3 T=`grep AM_INIT_AUTOMAKE configure.in | cut -d'(' -f2`
|
|
4 NAME=`echo $T | cut -d, -f1`
|
|
5 VER=`echo $T | cut -d, -f2 | cut -d')' -f1`
|
|
6 BALL=$NAME-$VER.tar.gz
|
|
7 web=/home/httpd/html/510sg/$NAME
|
|
8 distlog=/tmp/distcheck
|
|
9
|
109
|
10 echo $NAME $VER $BALL
|
|
11 exit
|
|
12
|
107
|
13 # make $BALL
|
|
14 chown --recursive root:root *
|
|
15 make -f *cvs
|
|
16 ./configure >/dev/null
|
|
17 (cd xml; make; make distclean)
|
|
18 cp -a html/*html $web
|
|
19 make distcheck >$distlog 2>&1
|
|
20 if [ $? -eq 0 ]; then
|
|
21 if [ -f $BALL ]; then
|
|
22 # expand locally to see the tarball
|
|
23 rm -rf junk
|
|
24 mkdir junk
|
|
25 cd junk
|
|
26 tar xfz ../$BALL
|
|
27 cd $NAME-$VER
|
|
28 ./configure >/dev/null
|
|
29 make >/dev/null
|
|
30 make install >/dev/null
|
|
31 if [ -f /etc/rc.d/init.d/$NAME ]; then
|
|
32 /etc/rc.d/init.d/$NAME stop
|
|
33 fi
|
|
34 make chkconfig
|
108
|
35 if [ -f /etc/rc.d/init.d/$NAME ]; then
|
|
36 chkconfig $NAME on
|
|
37 /etc/rc.d/init.d/$NAME start
|
|
38 fi
|
107
|
39 cd ..
|
|
40 cd ..
|
|
41
|
|
42 # build rpm on target
|
|
43 target=host62
|
|
44 scp $BALL $target:/tmp
|
|
45 ssh $target "cd /tmp; rpmbuild -ta $BALL >/dev/null 2>&1"
|
|
46
|
|
47 # add packages to the web site
|
|
48 wp=$web/packages
|
|
49 wp4=$wp/centos4
|
|
50 rp=/usr/src/redhat
|
|
51 cp -a $BALL $wp
|
|
52 scp $target:$rp/SRPMS/$NAME-$VER*rpm $wp4
|
|
53 scp $target:$rp/RPMS/i386/$NAME-$VER*rpm $wp4
|
|
54 (cd $web; chown --recursive web:web *; ls -alR)
|
|
55 rpm -ql -p $wp4/$NAME-$VER*6.rpm
|
|
56 fi
|
|
57 else
|
|
58 tail -10 $distlog
|
|
59 fi
|
|
60 chown --recursive carl:carl *
|