import repository from arizona
[raven.git] / rpm_builds / build-client
1 #!/usr/local/bin/bash
2
3 if [ ! $# -eq 2 ]
4 then
5         echo "usage: build-client <version> <release>"
6         exit 1
7 fi
8
9 VER=$1
10 REL=$2
11 SOURCE=`cat source`
12 FOLDER="stork-client-$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/tempest.init $FOLDER
29 cp $SOURCE/apps/tempest/groups.dtd $FOLDER
30 cp $SOURCE/apps/tempest/packages.dtd $FOLDER
31 cp $SOURCE/apps/tempest/xmlgroupparse.py $FOLDER
32 cp $SOURCE/apps/tempest/xmlpackageparse.py $FOLDER
33
34 touch $FOLDER/__init__.py
35
36 #tar the dir up into the SOURCES folder
37 tar -czf SOURCES/$FOLDER.tar.gz $FOLDER
38
39 #remove the folder
40 rm -rf $FOLDER
41
42 #prepare the awk command
43 AWK="awk '{gsub(/@VER@/,\"$VER\"); gsub(/@REL@/,\"$REL\"); print;}' SPECS/stork-client.spec.template"
44
45 #execute awk command
46 eval $AWK > .stork-client.spec
47
48 #make rpm
49 rpmbuild -ba .stork-client.spec --target noarch
50 RETSTAT=$?
51
52
53 rm .stork-client.spec
54
55 #clean up the debug rpms that get created for some reason
56 for foo in `find ./ -name "*debuginfo*"`
57 do
58         rm -f $foo
59 done
60
61
62
63 exit $RETSTAT