scripts for applyinvoices
[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/gackscentral.cron $FOLDER
32
33 chmod +x $FOLDER/*.sh
34 chmod +x $FOLDER/gackscli.py
35
36 # stuff for the modpython API
37 cp $SOURCE/lib/ravenlib/modpythonapi/ModPython.py $FOLDER
38 cp $SOURCE/lib/ravenlib/modpythonapi/BaseApi.py $FOLDER
39 cp $SOURCE/lib/ravenlib/modpythonapi/AuthenticatedApi.py $FOLDER
40 cp $SOURCE/lib/ravenlib/modpythonapi/ApiExceptionCodes.py $FOLDER
41
42 cp $GENIWRAPPER_UTIL/*.py $FOLDER
43 cp $GENIWRAPPER_TRUST/*.py $FOLDER
44
45 touch $FOLDER/__init__.py
46
47 #tar the dir up into the SOURCES folder
48 tar -czf SOURCES/$FOLDER.tar.gz $FOLDER
49
50 #remove the folder
51 rm -rf $FOLDER
52
53 #prepare the awk command
54 AWK="awk '{gsub(/@VER@/,\"$VER\"); gsub(/@REL@/,\"$REL\"); print;}' SPECS/gackscentral.spec.template"
55
56 #execute awk command
57 eval $AWK > .gackscentral.spec
58
59 #make rpm
60 rpmbuild -ba .gackscentral.spec --target noarch
61 RETSTAT=$?
62
63 rm .gackscentral.spec
64
65 #clean up the debug rpms that get created for some reason
66 for foo in `find ./ -name "*debuginfo*"`
67 do
68         rm -f $foo
69 done
70
71 exit $RETSTAT