import repository from arizona
[raven.git] / rpm_builds / build-mp-repository
1 #!/bin/bash
2
3
4 if [ ! $# -eq 2 ]
5 then
6         echo "usage: build-mp-repository <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 GENIWRAPPER_COMPAT=/home/smbaker/projects/stork/trunk/apps/geni
18 SOURCE=`cat source`
19 FOLDER="stork-mp-repository-$VER"
20
21
22 #create a folder to do the stuff in
23 mkdir $FOLDER
24
25
26 #mv the source files we need to there
27 cp $SOURCE/apps/mprepo/static/*.png $FOLDER
28 cp $SOURCE/apps/mprepo/static/*.css $FOLDER
29 cp $SOURCE/apps/mprepo/etc/*.stemp $FOLDER
30 cp $SOURCE/apps/mprepo/etc/*.conf $FOLDER
31
32 # stuff for the API
33 cp $SOURCE/apps/mprepo/API.py $FOLDER
34 cp $SOURCE/lib/ravenlib/modpythonapi/ModPython.py $FOLDER
35 cp $SOURCE/lib/ravenlib/modpythonapi/BaseApi.py $FOLDER
36 cp $SOURCE/lib/ravenlib/modpythonapi/AuthenticatedApi.py $FOLDER
37 cp $SOURCE/lib/ravenlib/modpythonapi/ApiExceptionCodes.py $FOLDER
38
39 cp $SOURCE/apps/mprepo/API.py $FOLDER
40 cp $SOURCE/apps/mprepo/index.py $FOLDER
41 cp $SOURCE/apps/mprepo/mprfrontend.py $FOLDER
42 cp $SOURCE/apps/mprepo/frontend.py $FOLDER
43 cp $SOURCE/apps/mprepo/repoauth.py $FOLDER
44 cp $SOURCE/apps/mprepo/html.py $FOLDER
45 cp $SOURCE/apps/mprepo/repogeni.py $FOLDER
46 cp $SOURCE/apps/mprepo/repouid.py $FOLDER
47 cp $SOURCE/apps/mprepo/repo_xmlrpc_server.py $FOLDER
48 cp $SOURCE/apps/mprepo/passfile.py $FOLDER
49 cp $SOURCE/apps/mprepo/repobackend.py $FOLDER
50 cp $SOURCE/apps/mprepo/repoclassify.py $FOLDER
51 cp $SOURCE/apps/mprepo/repoconfig.py $FOLDER
52 cp $SOURCE/apps/mprepo/repometafileupdate.py $FOLDER
53 cp $SOURCE/apps/mprepo/repoplc.py $FOLDER
54 cp $SOURCE/apps/mprepo/repopublish.py $FOLDER
55 cp $SOURCE/apps/mprepo/repopubsub.py $FOLDER
56 cp $SOURCE/apps/mprepo/repoutil.py $FOLDER
57 cp $SOURCE/apps/mprepo/repo_xmlrpc_server.init $FOLDER
58 cp $SOURCE/apps/mprepo/repopubsub.init $FOLDER
59
60 cp $GENIWRAPPER_COMPAT/*.py $FOLDER
61 cp $GENIWRAPPER_UTIL/*.py $FOLDER
62 cp $GENIWRAPPER_TRUST/*.py $FOLDER
63
64 cp $SOURCE/apps/mprepo/static/index.html $FOLDER
65
66 # The distributed repository rpm should not contain our
67 # private key, the user should make their own
68 #cp $SOURCE/repository/StorkRepository_nr06.privatekey $FOLDER
69
70 touch $FOLDER/__init__.py
71
72 #tar the dir up into the SOURCES folder
73 tar -czf SOURCES/$FOLDER.tar.gz $FOLDER
74
75 #remove the folder
76 rm -rf $FOLDER
77
78 #prepare the awk command
79 AWK="awk '{gsub(/@VER@/,\"$VER\"); gsub(/@REL@/,\"$REL\"); print;}' SPECS/stork-mp-repository.spec.template"
80
81 #execute awk command
82 eval $AWK > .stork-mp-repository.spec
83
84 #make rpm
85 rpmbuild -ba .stork-mp-repository.spec
86 RETSTAT=$?
87
88 rm .stork-mp-repository.spec
89
90 #clean up the debug rpms that get created for some reason
91 for foo in `find ./ -name "*debuginfo*"`
92 do
93         rm -f $foo
94 done
95
96 exit $RETSTAT