check in missing update to spec file
[raven.git] / rpm_builds / build-grm
1 #!/bin/bash
2
3
4 if [ ! $# -eq 2 ]
5 then
6         echo "usage: build-grm <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="grm-$VER"
17
18
19 #create a folder to do the stuff in
20 mkdir $FOLDER
21
22 cp $SOURCE/apps/mprepo/static/*.png $FOLDER
23 cp $SOURCE/apps/mprepo/static/*.css $FOLDER
24 cp $SOURCE/apps/mprepo/etc/*.stemp $FOLDER
25 cp $SOURCE/apps/mprepo/etc/*.conf $FOLDER
26
27 #mv the source files we need to there
28 cp $SOURCE/apps/mprepo/grm.py $FOLDER/index.py
29 cp $SOURCE/apps/mprepo/grmfrontend.py $FOLDER
30 cp $SOURCE/apps/mprepo/frontend.py $FOLDER
31 cp $SOURCE/apps/mprepo/repoauth.py $FOLDER
32 cp $SOURCE/apps/mprepo/html.py $FOLDER
33 cp $SOURCE/apps/mprepo/passfile.py $FOLDER
34 cp $SOURCE/apps/mprepo/repoconfig.py $FOLDER
35 cp $SOURCE/apps/mprepo/repogeni.py $FOLDER
36 cp $SOURCE/apps/mprepo/repoplc.py $FOLDER
37 cp $SOURCE/apps/mprepo/repoutil.py $FOLDER
38 cp $SOURCE/apps/gacks/gackshandle.py $FOLDER
39 cp $SOURCE/apps/gacks/gacksjob.py $FOLDER
40 cp $SOURCE/apps/gacks/gacksclient.py $FOLDER
41 cp $SOURCE/apps/gacks/gacksreceipt.py $FOLDER
42 cp $SOURCE/apps/gacks/gackslog.py $FOLDER
43 cp $SOURCE/apps/gacks/gackslog_mysql.py $FOLDER
44
45 # stuff for the modpython API
46 cp $SOURCE/lib/ravenlib/modpythonapi/ModPython.py $FOLDER
47 cp $SOURCE/lib/ravenlib/modpythonapi/BaseApi.py $FOLDER
48 cp $SOURCE/lib/ravenlib/modpythonapi/AuthenticatedApi.py $FOLDER
49 cp $SOURCE/lib/ravenlib/modpythonapi/BaseClient.py $FOLDER
50 cp $SOURCE/lib/ravenlib/modpythonapi/AuthenticatedClient.py $FOLDER
51 cp $SOURCE/lib/ravenlib/modpythonapi/ApiExceptionCodes.py $FOLDER
52
53 #cp $GENIWRAPPER_UTIL/*.py $FOLDER
54 #cp $GENIWRAPPER_TRUST/*.py $FOLDER
55
56 touch $FOLDER/__init__.py
57
58 #tar the dir up into the SOURCES folder
59 tar -czf SOURCES/$FOLDER.tar.gz $FOLDER
60
61 #remove the folder
62 rm -rf $FOLDER
63
64 #prepare the awk command
65 AWK="awk '{gsub(/@VER@/,\"$VER\"); gsub(/@REL@/,\"$REL\"); print;}' SPECS/grm.spec.template"
66
67 #execute awk command
68 eval $AWK > .grm.spec
69
70 #make rpm
71 rpmbuild -ba .grm.spec --target noarch
72 RETSTAT=$?
73
74 rm .grm.spec
75
76 #clean up the debug rpms that get created for some reason
77 for foo in `find ./ -name "*debuginfo*"`
78 do
79         rm -f $foo
80 done
81
82 exit $RETSTAT