r379: Fix syntax error in example mysql table
[Samba/gebeck_regimport.git] / packaging / Mandrake / makerpms-cvs.sh
blob08c4370b314219f69b8408ec230b27447796f216
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>
6 [ $# -lt 1 ] && echo "Usage: $0 <Samba version>" && exit 1
8 VERSION=$1
9 RELEASE=0.`date +%Y%m%d`
10 shift
12 # Replace PRELEASE and PVERSION with release number in all files ending with
13 # .tmpl
15 FILES=$(find . -name "*.tmpl" -type f)
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
22 #Change up three directories, rename directory to samba-$VERSION, change back
23 #then run makerpms.sh
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