updated spec file for recent stuff added to gacks
[raven.git] / rpm_builds / build-gackscentral
1 #!/bin/bash
2
3
4 if [ ! $# -eq 2 ]
5 then
6         echo "usage: build-gackscentral <version> <release>"
7         exit 1
8 fi
9
10 VER=$1
11 REL=$2
12 GENIWRAPPER_DIR=/home/smbaker/projects/sfa/trunk/sfa
13 GENIWRAPPER_UTIL=$GENIWRAPPER_DIR/util
14 GENIWRAPPER_TRUST=$GENIWRAPPER_DIR/trust
15 SOURCE=`cat source`
16 FOLDER="gackscentral-$VER"
17
18
19 #create a folder to do the stuff in
20 mkdir $FOLDER
21
22
23 #mv the source files we need to there
24 cp $SOURCE/apps/gacks/*.py $FOLDER
25 cp $SOURCE/apps/gacks/etc/*.conf $FOLDER
26
27 cp $SOURCE/apps/gacks/localhost-gacks-defragment.sh $FOLDER
28 cp $SOURCE/apps/gacks/localhost-gacks-garbagecollect.sh $FOLDER
29 cp $SOURCE/apps/gacks/localhost-gacks-runasap.sh $FOLDER
30 cp $SOURCE/apps/gacks/localhost-gacks-applyinvoices.sh $FOLDER
31 cp $SOURCE/apps/gacks/localhost-gacks-mailinvoices.sh $FOLDER
32 cp $SOURCE/apps/gacks/gackscentral.cron $FOLDER
33
34 cp $SOURCE/apps/gacks/gacksbackend.init $FOLDER
35
36 chmod +x $FOLDER/*.sh
37 chmod +x $FOLDER/gackscli.py
38
39 # stuff for the modpython API
40 cp $SOURCE/lib/ravenlib/modpythonapi/ModPython.py $FOLDER
41 cp $SOURCE/lib/ravenlib/modpythonapi/BaseApi.py $FOLDER
42 cp $SOURCE/lib/ravenlib/modpythonapi/AuthenticatedApi.py $FOLDER
43 cp $SOURCE/lib/ravenlib/modpythonapi/ApiExceptionCodes.py $FOLDER
44
45 cp $GENIWRAPPER_UTIL/*.py $FOLDER
46 cp $GENIWRAPPER_TRUST/*.py $FOLDER
47
48 touch $FOLDER/__init__.py
49
50 #tar the dir up into the SOURCES folder
51 tar -czf SOURCES/$FOLDER.tar.gz $FOLDER
52
53 #remove the folder
54 rm -rf $FOLDER
55
56 #prepare the awk command
57 AWK="awk '{gsub(/@VER@/,\"$VER\"); gsub(/@REL@/,\"$REL\"); print;}' SPECS/gackscentral.spec.template"
58
59 #execute awk command
60 eval $AWK > .gackscentral.spec
61
62 #make rpm
63 rpmbuild -ba .gackscentral.spec --target noarch
64 RETSTAT=$?
65
66 rm .gackscentral.spec
67
68 #clean up the debug rpms that get created for some reason
69 for foo in `find ./ -name "*debuginfo*"`
70 do
71         rm -f $foo
72 done
73
74 exit $RETSTAT