import repository from arizona
[raven.git] / rpm_builds / build-cherryrepo
1 #!/usr/local/bin/bash
2
3 if [ ! $# -eq 2 ]
4 then
5         echo "usage: build-cherryrepo <version> <release>"
6         exit 1
7 fi
8
9 VER=$1
10 REL=$2
11 SOURCE=`cat source`
12 FOLDER="cherryrepo-$VER"
13
14
15 #create a folder to do the stuff in
16 mkdir $FOLDER
17
18 echo "# this file is automatically generated by the build script" > $FOLDER/cherryrepoversion.py
19 echo "VER= '"$VER"'" >> $FOLDER/cherryrepoversion.py
20 echo "REL= '"$REL"'" >> $FOLDER/cherryrepoversion.py
21 echo "VERREL = VER + '-' + REL" >> $FOLDER/cherryrepoversion.py
22
23 cp $SOURCE/apps/cherryrepo/browse.py $FOLDER
24 cp $SOURCE/apps/cherryrepo/compat.py $FOLDER
25 cp $SOURCE/apps/cherryrepo/debug.py $FOLDER
26 cp $SOURCE/apps/cherryrepo/errorpage.py $FOLDER
27 cp $SOURCE/apps/cherryrepo/home.py $FOLDER
28 cp $SOURCE/apps/cherryrepo/login.py $FOLDER
29 cp $SOURCE/apps/cherryrepo/passfile.py $FOLDER
30 cp $SOURCE/apps/cherryrepo/repobackend.py $FOLDER
31 cp $SOURCE/apps/cherryrepo/repoclassify.py $FOLDER
32 cp $SOURCE/apps/cherryrepo/repoconfig.py $FOLDER
33 cp $SOURCE/apps/cherryrepo/repoevent.py $FOLDER
34 cp $SOURCE/apps/cherryrepo/repoeventdaemon.py $FOLDER
35 cp $SOURCE/apps/cherryrepo/repofrontend.py $FOLDER
36 cp $SOURCE/apps/cherryrepo/repometafileupdate.py $FOLDER
37 cp $SOURCE/apps/cherryrepo/repoplc.py $FOLDER
38 cp $SOURCE/apps/cherryrepo/repopublish.py $FOLDER
39 cp $SOURCE/apps/cherryrepo/repoutil.py $FOLDER
40 cp $SOURCE/apps/cherryrepo/search.py $FOLDER
41 cp $SOURCE/apps/cherryrepo/storkcontrol.py $FOLDER
42 cp $SOURCE/apps/cherryrepo/uploadpage.py $FOLDER
43
44 cp $SOURCE/apps/cherryrepo/cherryrepo.init $FOLDER
45 cp $SOURCE/apps/cherryrepo/setup.py $FOLDER
46
47 cp $SOURCE/apps/cherryrepo/etc/*.stemp $FOLDER
48 cp $SOURCE/apps/cherryrepo/etc/app.conf $FOLDER
49 cp $SOURCE/apps/cherryrepo/static/*.png $FOLDER
50 cp $SOURCE/apps/cherryrepo/static/*.css $FOLDER
51
52 cp $SOURCE/2.0/python/pseprlib2.py $FOLDER
53 cp $SOURCE/2.0/python/pseprmessages.py $FOLDER
54 cp $SOURCE/2.0/python/storkpackage.py $FOLDER
55 cp $SOURCE/2.0/python/storktransaction.py $FOLDER
56 cp $SOURCE/2.0/python/package/storktar.py $FOLDER
57 cp $SOURCE/2.0/python/package/storkrpm.py $FOLDER
58 cp $SOURCE/2.0/python/package/storknestrpm.py $FOLDER
59 touch $FOLDER/__init__.py
60
61 chmod a+rx $FOLDER/*.py
62 chmod a+rx $FOLDER/*.init
63
64 #tar the dir up into the SOURCES folder
65 tar -czf SOURCES/$FOLDER.tar.gz $FOLDER
66
67 #remove the folder
68 rm -rf $FOLDER
69
70 #prepare the awk command
71 AWK="awk '{gsub(/@VER@/,\"$VER\"); gsub(/@REL@/,\"$REL\"); print;}' SPECS/cherryrepo.spec.template"
72
73 #execute awk command
74 eval $AWK > .stork-cherryrepo.spec
75
76 #make rpm
77 rpmbuild -ba .stork-cherryrepo.spec
78 RETSTAT=$?
79
80
81 rm .stork-cherryrepo.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