check in missing update to spec file
[raven.git] / rpm_builds / build-raven
1 #!/bin/bash
2
3
4 if [ ! $# -eq 2 ]
5 then
6         echo "usage: build-raven <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_DIR=/home/smbaker/projects/stork/trunk/legacy/sfa-legacy/trunk/sfa
14 GENIWRAPPER_DIR=/home/smbaker/projects/stork/trunk/our-sfa-build/sfa
15 GENIWRAPPER_UTIL=$GENIWRAPPER_DIR/util
16 GENIWRAPPER_TRUST=$GENIWRAPPER_DIR/trust
17 SOURCE=`cat source`
18 FOLDER="raven-$VER"
19
20
21 #create a folder to do the stuff in
22 mkdir $FOLDER
23
24 echo "# this file is automatically generated by the build script" > $FOLDER/ravenversion.py
25 echo "VER= '"$VER"'" >> $FOLDER/ravenversion.py
26 echo "REL= '"$REL"'" >> $FOLDER/ravenversion.py
27 echo "VERREL = VER + '-' + REL" >> $FOLDER/ravenversion.py
28
29 #mv the source files we need to there
30
31 cp $SOURCE/apps/ravenpublish/arizonaconfig_compat.py $FOLDER
32 cp $SOURCE/apps/ravenpublish/builder.py $FOLDER
33 cp $SOURCE/apps/ravenpublish/container.py $FOLDER
34 cp $SOURCE/apps/ravenpublish/errorparser.py $FOLDER
35 cp $SOURCE/apps/ravenpublish/kongclient.py $FOLDER
36 cp $SOURCE/apps/ravenpublish/konggui.py $FOLDER
37 cp $SOURCE/apps/ravenpublish/kongscreen.py $FOLDER
38 cp $SOURCE/apps/ravenpublish/raven.py $FOLDER
39 cp $SOURCE/apps/ravenpublish/ravengui.py $FOLDER
40 cp $SOURCE/apps/ravenpublish/ravengui_passphrase.py $FOLDER
41 cp $SOURCE/apps/ravenpublish/ravenscreen.py $FOLDER
42 cp $SOURCE/apps/ravenpublish/ravenbuilder.py $FOLDER
43 cp $SOURCE/apps/ravenpublish/slicerun.py $FOLDER
44 cp $SOURCE/apps/ravenpublish/get_protogeni_cred.py $FOLDER
45 cp $SOURCE/apps/ravenpublish/raven.man $FOLDER
46 cp $SOURCE/apps/ravenpublish/etc/* $FOLDER
47 cp $SOURCE/apps/ravenpublish/actions.d/* $FOLDER
48
49 chmod +x $FOLDER/raven.py
50 chmod +x $FOLDER/ravenbuilder.py
51 chmod +x $FOLDER/ravengui.py
52 chmod +x $FOLDER/get_protogeni_cred.py
53
54 # ravenlib
55 cp $SOURCE/lib/ravenlib/crypto.py $FOLDER
56 cp $SOURCE/lib/ravenlib/client/repoclient.py $FOLDER
57 cp $SOURCE/lib/ravenlib/files/pacpackages.py $FOLDER
58 cp $SOURCE/lib/ravenlib/files/tpfile.py $FOLDER
59 cp $SOURCE/lib/ravenlib/modpythonapi/BaseClient.py $FOLDER
60 cp $SOURCE/lib/ravenlib/modpythonapi/AuthenticatedClient.py $FOLDER
61 cp $SOURCE/lib/ravenlib/modpythonapi/ApiExceptionCodes.py $FOLDER
62
63 cp $GENIWRAPPER_UTIL/*.py $FOLDER
64 cp $GENIWRAPPER_TRUST/*.py $FOLDER
65
66 touch $FOLDER/__init__.py
67
68 #tar the dir up into the SOURCES folder
69 tar -czf SOURCES/$FOLDER.tar.gz $FOLDER
70
71 #remove the folder
72 rm -rf $FOLDER
73
74 #substitute VER and REL in the spec.template
75 AWK="awk '{gsub(/@VER@/,\"$VER\"); gsub(/@REL@/,\"$REL\"); print;}' SPECS/raven.spec.template"
76 eval $AWK > .raven.spec
77
78 rpmbuild -ba .raven.spec --target noarch
79 RETSTAT=$?
80
81 rm .raven.spec
82
83 #clean up the debug rpms that get created for some reason
84 for foo in `find ./ -name "*debuginfo*"`
85 do
86         rm -f $foo
87 done
88
89 exit $RETSTAT