view package @ 135:8e813497582e stable-5-20

fix rpm scripts
author carl
date Wed, 02 Aug 2006 21:33:34 -0700
parents aa07452e641b
children 9330b8d6a56b
line wrap: on
line source

#!/bin/bash

T=`grep AM_INIT_AUTOMAKE configure.in | cut -d'(' -f2`
NAME=`echo $T | cut -d, -f1`
VER=`echo $T | cut -d, -f2 | cut -d')' -f1`
BALL=$NAME-$VER.tar.gz
web=/home/httpd/html/510sg/$NAME
distlog=/tmp/distcheck

mkdir -p $web
chown --recursive root:root *
make -f *cvs
./configure >/dev/null
(cd xml; make; make distclean)
cp -a html/*html $web
make distcheck >$distlog 2>&1
if [ $? -eq 0 ]; then
    if [ -f $BALL ]; then
        # expand locally to see the tarball
        rm -rf junk
        mkdir junk
        cd junk
            tar xfz ../$BALL
            cd $NAME-$VER
                ./configure >/dev/null
                make >/dev/null
     ##         make install >/dev/null
     ##         if [ -f /etc/rc.d/init.d/$NAME ]; then
     ##             /etc/rc.d/init.d/$NAME stop
     ##         fi
     ##         make chkconfig
     ##         if [ -f /etc/rc.d/init.d/$NAME ]; then
     ##             chkconfig $NAME on
     ##             /etc/rc.d/init.d/$NAME start
     ##         fi
            cd ..
        cd ..

        # build rpm on target
        target=host62
        scp $BALL $target:/tmp
        ssh $target "cd /tmp; rpmbuild -ta $BALL"

        # add packages to the web site
        wp=$web/packages
        wp4=$wp/centos4
        mkdir -p $wp4
        rp=/usr/src/redhat
        mv -f $BALL $wp
        scp $target:$rp/SRPMS/$NAME-$VER*rpm $wp
        scp $target:$rp/RPMS/i386/$NAME-$VER*rpm $wp4
        (cd $web; chown --recursive web:web *; ls -alR)
        rpm -ql -p $wp4/$NAME-$VER*6.rpm
    fi
else
    tail -10 $distlog
fi
chown --recursive carl:carl *