check in missing update to spec file
[raven.git] / rpm_builds / build-clientconfig
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-config-$VER"
13
14
15 #create a folder to do the stuff in
16 mkdir $FOLDER 
17
18
19 #mv the source files we need to there
20 cp $SOURCE/pyspecer/stork/client_stork.conf $FOLDER/stork.conf
21 cp $SOURCE/pyspecer/stork/default.publickey $FOLDER/default.publickey
22
23 #tar the dir up into the SOURCES folder
24 tar -czf SOURCES/$FOLDER.tar.gz $FOLDER
25
26 #remove the folder
27 rm -rf $FOLDER
28
29 #prepare the awk command
30 AWK="awk '{gsub(/@VER@/,\"$VER\"); gsub(/@REL@/,\"$REL\"); print;}' SPECS/stork-client-config.spec.template"
31
32 #execute awk command
33 eval $AWK > .stork-client-config.spec
34
35 #make rpm
36 rpmbuild -ba .stork-client-config.spec --target noarch
37 RETSTAT=$?
38
39 rm .stork-client-config.spec
40
41 #clean up the debug rpms that get created for some reason
42 for foo in `find ./ -name "*debuginfo*"`
43 do
44         rm -f $foo
45 done
46
47
48 exit $RETSTAT