#!/bin/bash set -x # This script makes the world nice-looking for the world. cvs up cvs commit # Name of the release? echo -n "Release name (e.g) panda-0.4.1: " read relname echo -n "Tag this release (y/n)? " read tag if [ $tag = "y" ] then echo -n "CVS tag name (e.g) panda-release-041: " read tagname cvs tag -b $tagname fi # Get a clean copy of the source rm -rf temp mkdir temp cd temp export CVSROOT="/home/httpd/html/cvs" cvs co panda cd panda # Clean out the old documentation echo "------------------------------------------------------------------------" echo "Updating documentation" rm man/*sgml man/*man # Generate the new documentation for item in `ls *.c` do ~mikal/opensource/autodocbook/autodocbook $item man done mv *.3 man/ cvs up cvs commit # Autotools echo "------------------------------------------------------------------------" echo "Running the autotools" libtoolize --force aclocal automake --add-missing autoconf ./configure make clean make # Make sure that the release passes some simple dmalloc tests echo "------------------------------------------------------------------------" echo "Checking for memory leaks" #dmalloc -b -l log -i 100 low #cd examples #./pandademo > /dev/null # #if [ `grep "not freed" log | wc -l | tr -d " "` -gt 0 ] #then # echo "" # echo "" # echo "Prospective release failed the memory leak test" # exit 42 #fi #cd .. # Get rid of core files echo "------------------------------------------------------------------------" echo "Clean up" make clean for item in `find . | grep core` do rm -i $item done # Get rid of compiled files that make clean wont remove find . -name "*obj" -type f -exec rm -i {} \; -print # Get rid of the timetrials -- they are too big rm -rf timetrials rm -rf testdata delname="Makefile config.cache config.log config.status logfile math config.h output.pdf .deps panda.ncb panda.opt autom4te.cache" # Get rid of makefiles for filename in $delname do for item in `find . -name $filename -print` do rm -rf $item done done # How much space do we use? echo "------------------------------------------------------------------------" echo "Release takes" `du -sk` "kbytes" # Now we can start packaging the various versions cd .. relnamenoexamples=`echo $relname | sed 's/-/-noexamples-/'` relnamewindows=`echo $relname | sed 's/-/-windows-/'` mkdir $relname mkdir $relnamenoexamples mkdir $relnamewindows # Windows is simply everything cp -R panda/* $relnamewindows/ # Now we do the full unix release cp -R panda/* $relname cd $relname rm -rf activex rm -rf Debug cd examples rm -rf Visual* cd ../.. # Now the no examples cp -R $relname/* $relnamenoexamples/ cd $relnamenoexamples rm -rf examples cd .. # Compress them all tar czf `echo $relname | sed 's/-/_/g' | sed 's/\./_/g'`.tgz $relname tar czf `echo $relnamenoexamples | sed 's/-/_/g' | sed 's/\./_/g'`.tgz $relnamenoexamples tar czf `echo $relnamewindows | sed 's/-/_/g' | sed 's/\./_/g'`.tgz $relnamewindows # Sign them all gpg --detach-sign --armour --output `echo $relname | sed 's/-/_/g' | sed 's/\./_/g'`.sig `echo $relname | sed 's/-/_/g' | sed 's/\./_/g'`.tgz gpg --detach-sign --armour --output `echo $relnamenoexamples | sed 's/-/_/g' | sed 's/\./_/g'`.sig `echo $relnamenoexamples | sed 's/-/_/g' | sed 's/\./_/g'`.tgz gpg --detach-sign --armour --output `echo $relnamewindows | sed 's/-/_/g' | sed 's/\./_/g'`.sig `echo $relnamewindows | sed 's/-/_/g' | sed 's/\./_/g'`.tgz # Now deal with the RPMS echo "Remember to email editor@planetpdf.com"