import repository from arizona
[raven.git] / rpm_builds / build-nestconfig
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-nest-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/nest_stork.conf $FOLDER/stork.conf
21
22 #tar the dir up into the SOURCES folder
23 tar -czf SOURCES/$FOLDER.tar.gz $FOLDER
24
25 #remove the folder
26 rm -rf $FOLDER
27
28 #prepare the awk command
29 AWK="awk '{gsub(/@VER@/,\"$VER\"); gsub(/@REL@/,\"$REL\"); print;}' SPECS/stork-nest-config.spec.template"
30
31 #execute awk command
32 eval $AWK > .stork-nest-config.spec
33
34 #make rpm
35 rpmbuild -ba .stork-nest-config.spec
36 RETSTAT=$?
37
38 rm .stork-nest-config.spec
39
40 #clean up the debug rpms that get created for some reason
41 for foo in `find ./ -name "*debuginfo*"`
42 do
43         rm -f $foo
44 done
45
46
47
48
49 exit $RETSTAT