check in missing update to spec file
[raven.git] / rpm_builds / build-stork
1 #!/usr/local/bin/bash
2
3 if [ ! $# -eq 2 ]
4 then
5         echo "usage: build-stork <version> <release>"
6         exit 1
7 fi
8
9 VER=$1
10 REL=$2
11 SOURCE=`cat source`
12 FOLDER="stork-$VER"
13
14 #create a folder to do the stuff in
15 mkdir $FOLDER 
16
17 echo "# this file is automatically generated by the build script" > $FOLDER/storkversion.py
18 echo "VER= '"$VER"'" >> $FOLDER/storkversion.py
19 echo "REL= '"$REL"'" >> $FOLDER/storkversion.py
20 echo "VERREL = VER + '-' + REL" >> $FOLDER/storkversion.py
21
22 #mv the source files we need to there
23
24 cp $SOURCE/apps/stork/storkdependency.py $FOLDER
25 cp $SOURCE/apps/stork/storkusername.py $FOLDER
26 cp $SOURCE/apps/stork/stork.py $FOLDER
27 cp $SOURCE/apps/stork/storkquery.py $FOLDER
28 cp $SOURCE/pyspecer/stork/nr06.certificate $FOLDER
29 cp $SOURCE/apps/stork/storkconfigsync.py $FOLDER
30 cp $SOURCE/apps/stork/storkerror.py $FOLDER
31 cp $SOURCE/apps/stork/storkexception.py $FOLDER
32 cp $SOURCE/apps/stork/storkoutputfuncs.py $FOLDER
33 cp $SOURCE/apps/stork/storkmetapoll.py $FOLDER
34 cp $SOURCE/apps/stork/storkmutex.py $FOLDER
35 cp $SOURCE/apps/stork/storkpackagelist.py $FOLDER
36 cp $SOURCE/apps/stork/storkpackagesort.py $FOLDER
37 cp $SOURCE/apps/stork/storkpoison.py $FOLDER
38 cp $SOURCE/apps/stork/storkrepolist.py $FOLDER
39 cp $SOURCE/apps/stork/storkrepodl.py $FOLDER
40 cp $SOURCE/apps/stork/storkreposync.py $FOLDER
41 cp $SOURCE/apps/stork/storkstats.py $FOLDER
42 cp $SOURCE/apps/stork/storktrustedpackagesparse.py $FOLDER
43 cp $SOURCE/apps/stork/storktpqualify.py $FOLDER
44 #cp $SOURCE/apps/stork/storktprank.py $FOLDER
45 #cp $SOURCE/apps/stork/storktpcache.py $FOLDER
46 cp $SOURCE/apps/stork/storkstatuscodes.py $FOLDER
47 #cp $SOURCE/apps/stork/storkwarning.py $FOLDER
48 #cp $SOURCE/apps/stork/showshare.py $FOLDER
49 cp $SOURCE/apps/stork/storklog.py $FOLDER
50 cp $SOURCE/2.0/owl/conf.d/stork.conf $FOLDER/stork_owl.conf
51 cp $SOURCE/2.0/owl/scripts.d/stork $FOLDER/stork_owl
52 touch $FOLDER/__init__.py
53
54 #tar the dir up into the SOURCES folder
55 tar -czf SOURCES/$FOLDER.tar.gz $FOLDER
56
57 #remove the folder
58 rm -rf $FOLDER
59
60 #prepare the awk command
61 AWK="awk '{gsub(/@VER@/,\"$VER\"); gsub(/@REL@/,\"$REL\"); print;}' SPECS/stork.spec.template"
62
63 #execute awk command
64 eval $AWK > .stork.spec
65
66 #make rpm
67 rpmbuild -ba .stork.spec --target noarch
68 RETSTAT=$?
69
70
71 rm .stork.spec
72
73 #clean up the debug rpms that get created for some reason
74 for foo in `find ./ -name "*debuginfo*"`
75 do
76         rm -f $foo
77 done
78
79 exit $RETSTAT