check in missing update to spec file
[raven.git] / rpm_builds / build-planetlab
1 #!/usr/local/bin/bash
2
3 if [ ! $# -eq 2 ]
4 then
5         echo "usage: build-planetlab <version> <release>"
6         exit 1
7 fi
8
9 VER=$1
10 REL=$2
11 SOURCE=`cat source`
12 FOLDER="stork-planetlab-$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/2.0/python/share/planetlab_share.py $FOLDER
21 cp $SOURCE/2.0/python/Proper.py $FOLDER
22 cp $SOURCE/2.0/python/stork_proper.py $FOLDER
23 touch $FOLDER/__init__.py
24
25 #tar the dir up into the SOURCES folder
26 tar -czf SOURCES/$FOLDER.tar.gz $FOLDER
27
28 #remove the folder
29 rm -rf $FOLDER
30
31 #prepare the awk command
32 AWK="awk '{gsub(/@VER@/,\"$VER\"); gsub(/@REL@/,\"$REL\"); print;}' SPECS/stork-planetlab.spec.template"
33
34 #execute awk command
35 eval $AWK > .stork-planetlab.spec
36
37 #make rpm
38 rpmbuild -ba .stork-planetlab.spec
39 RETSTAT=$?
40
41 rm .stork-planetlab.spec
42
43 #clean up the debug rpms that get created for some reason
44 for foo in `find ./ -name "*debuginfo*"`
45 do
46         rm -f $foo
47 done
48
49 exit $RETSTAT