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