check in missing update to spec file
[raven.git] / rpm_builds / build-tempest
1 #!/usr/local/bin/bash
2
3 if [ ! $# -eq 2 ]
4 then
5         echo "usage: build-tempest <version> <release>"
6         exit 1
7 fi
8
9 VER=$1
10 REL=$2
11 SOURCE=`cat source`
12 FOLDER="tempest-$VER"
13
14
15 #create a folder to do the stuff in
16 mkdir $FOLDER 
17
18 echo "# this file is automatically generated by the build script" > $FOLDER/tempestversion.py
19 echo "VER= '"$VER"'" >> $FOLDER/tempestversion.py
20 echo "REL= '"$REL"'" >> $FOLDER/tempestversion.py
21 echo "VERREL = VER + '-' + REL" >> $FOLDER/tempestversion.py
22
23 #mv the source files we need to there
24 cp $SOURCE/pyspecer/stork/StorkRepository_nr06.publickey $FOLDER/StorkRepository_nr06.publickey
25 cp $SOURCE/pyspecer/stork/nr06.certificate $FOLDER
26 cp $SOURCE/apps/tempest/tempest.py $FOLDER
27 cp $SOURCE/apps/tempest/tempestd.py $FOLDER
28 cp $SOURCE/apps/tempest/tempestpubsub.py $FOLDER
29 cp $SOURCE/apps/tempest/tempest.init $FOLDER
30 cp $SOURCE/apps/tempest/groups.dtd $FOLDER
31 cp $SOURCE/apps/tempest/packages.dtd $FOLDER
32 cp $SOURCE/apps/tempest/xmlgroupparse.py $FOLDER
33 cp $SOURCE/apps/tempest/xmlpackageparse.py $FOLDER
34 cp $SOURCE/apps/tempest/actions.d/bootstrap.packages.pacman $FOLDER
35 cp $SOURCE/apps/tempest/actions.d/unmanaged.packages.pacman $FOLDER
36 cp $SOURCE/apps/tempest/owl/scripts.d/tempestd $FOLDER/tempestd_owl
37 cp $SOURCE/apps/tempest/owl/conf.d/tempestd.conf $FOLDER/tempestd_owl.conf
38
39 touch $FOLDER/__init__.py
40
41 #tar the dir up into the SOURCES folder
42 tar -czf SOURCES/$FOLDER.tar.gz $FOLDER
43
44 #remove the folder
45 rm -rf $FOLDER
46
47 #prepare the awk command
48 AWK="awk '{gsub(/@VER@/,\"$VER\"); gsub(/@REL@/,\"$REL\"); print;}' SPECS/tempest.spec.template"
49
50 #execute awk command
51 eval $AWK > .tempest.spec
52
53 #make rpm
54 rpmbuild -ba .tempest.spec --target noarch
55 RETSTAT=$?
56
57
58 rm .tempest.spec
59
60 #clean up the debug rpms that get created for some reason
61 for foo in `find ./ -name "*debuginfo*"`
62 do
63         rm -f $foo
64 done
65
66
67
68 exit $RETSTAT