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