trying to get HEAD building again. If you want the code
[gd/samba-autobuild/.git] / packaging / Mandrake / makerpms-cvs.sh
1 #!/bin/bash
2 # makerpms-cvs.sh
3 # A quick script to build RPMs from cvs to test packaging
4 # Buchan Milne <bgmilne@cae.co.za>
5
6 [ $# -lt 1 ] &&  echo "Usage: $0 <Samba version>" && exit 1
7
8 VERSION=$1
9 RELEASE=0.`date +%Y%m%d`
10 shift
11
12 # Replace PRELEASE and PVERSION with release number in all files ending with
13 # .tmpl
14
15 FILES=$(find . -name "*.tmpl" -type f)
16
17 for i in $FILES;do 
18         NEW=$(echo $i|sed -e 's/\.tmpl//g'); 
19         cat $i |sed -e 's/PVERSION/'$VERSION'/g; s/PRELEASE/'$RELEASE'/g'> $NEW ;
20 done
21
22 #Change up three directories, rename directory to samba-$VERSION, change back
23 #then run makerpms.sh
24
25
26 CURRENT=$(pwd)
27 pushd $(dirname $(dirname $(dirname $CURRENT)))
28 SAMBA_DIR=$(basename $(dirname $(dirname $CURRENT)))
29 mv $SAMBA_DIR samba-$VERSION
30 pushd samba-$VERSION/source
31 ./autogen.sh
32 popd
33 pushd samba-$VERSION/packaging/Mandrake
34 sh makerpms.sh $@
35 popd
36 mv samba-$VERSION $SAMBA_DIR
37 popd