view package @ 47:5fb8d997feed

more fixes for 64 bit format
author carl
date Sun, 13 Jan 2008 12:55:59 -0800
parents c03974357771
children 7d5c637aaafb
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

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
            cd ..
        cd ..

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

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

        # add packages to the web site
        wp=$web/packages
        wp4=$wp/centos4
        wp5=$wp/centos5
        mkdir -p $wp4 $wp5
        rp=/usr/src/redhat
        mv -f $BALL $wp
        scp $target4:$rp/SRPMS/$NAME-$VER*rpm $wp
        scp $target4:$rp/RPMS/i386/$NAME-$VER*rpm $wp4
        scp $target5:$rp/RPMS/i386/$NAME-$VER*rpm $wp5
        (cd $web; chown --recursive web:web *; ls -alR)
        rpm -ql -p $wp4/$NAME-$VER*6.rpm
        rpm -ql -p $wp5/$NAME-$VER*6.rpm
    fi
else
    tail -10 $distlog
fi
chown --recursive carl:carl *
#args="--recursive -z -e ssh --times --perms --links --relative --owner --group --numeric-ids --delete"
#echo rsync $args $web ns1:/
#rsync $args $web ns1:/
#
#if [ -f /usr/local/bin/pst2ldif ]; then
#    pushd /home/ldap
#        pst=outlook.pst
#        #rm -f pst2ldif.log my.log
#        /usr/local/bin/pst2ldif -b 'o=ams-cc.com, c=US' -c 'newPerson' $pst >ams.ldif2
#        #./readpstlog pst2ldif.log | less >my.log
#        #hexdump -C $pst >pst.dump
#
#        grep '^dn:' ams.ldif2 | sort >aaa
#        grep '^dn:' ams.ldif  | sort >bbb
#        echo 'differences from nightly ldap'
#        diff aaa bbb
#        echo 'end differences'
#        rm -f aaa bbb
#    popd
#fi