import repository from arizona
[raven.git] / rpm_builds / build-repository
1 #!/bin/bash
2
3
4 if [ ! $# -eq 2 ]
5 then
6         echo "usage: build-repository <version> <release>"
7         exit 1
8 fi
9
10 VER=$1
11 REL=$2
12 SOURCE=`cat source`
13 FOLDER="stork-repository-$VER"
14
15
16 #create a folder to do the stuff in
17 mkdir $FOLDER 
18
19
20 #mv the source files we need to there
21 cp $SOURCE/repository/php/testphp/*.php $FOLDER
22 cp $SOURCE/repository/php/testphp/*.html $FOLDER
23 cp $SOURCE/repository/php/testphp/instructions $FOLDER
24 cp $SOURCE/repository/php/testphp/packageselector $FOLDER
25 cp $SOURCE/repository/php/testphp/xmlrpc.inc $FOLDER
26 cp $SOURCE/repository/php/testphp/stork.css $FOLDER
27
28 cp $SOURCE/repository/php/testphp/images/stork-header.png $FOLDER
29 cp $SOURCE/repository/php/testphp/images/powered_by_pl_grey.png $FOLDER
30 cp $SOURCE/repository/php/testphp/images/template_logo_small_grey.png $FOLDER
31 cp $SOURCE/repository/php/testphp/images/bigrotation2.gif $FOLDER
32 cp $SOURCE/repository/php/testphp/images/stork-sort-up.png $FOLDER
33 cp $SOURCE/repository/php/testphp/images/stork-sort-down.png $FOLDER
34
35 cp $SOURCE/repository/index.html $FOLDER
36
37 cp $SOURCE/2.0/python/storkvalidatepubkey.py $FOLDER
38 cp $SOURCE/2.0/python/storksignedfiletype.py $FOLDER
39 cp $SOURCE/2.0/python/storkvalidatepackage.py $FOLDER
40 cp $SOURCE/2.0/python/storkverifysignedfile.py $FOLDER
41 cp $SOURCE/2.0/python/storkextractmeta.py $FOLDER
42 cp $SOURCE/2.0/python/storkmetafileupdate.py $FOLDER
43 cp $SOURCE/2.0/python/storklinkrepository.py $FOLDER
44 cp $SOURCE/2.0/python/attemptpsepr.init $FOLDER
45 cp $SOURCE/2.0/python/storkpseprattempt.py $FOLDER
46 cp $SOURCE/2.0/python/pseprpusher.py $FOLDER
47 cp $SOURCE/2.0/python/pseprlib2.py $FOLDER
48 cp $SOURCE/2.0/python/pseprmessages.py $FOLDER
49 cp $SOURCE/2.0/python/storkrepbuild.py $FOLDER
50
51 cp $SOURCE/2.0/python/storks3.py $FOLDER
52 cp $SOURCE/2.0/python/s3/S3.py $FOLDER
53 cp $SOURCE/2.0/python/s3/__init__.py $FOLDER
54
55 # The distributed repository rpm should not contain our
56 # private key, the user should make their own
57 #cp $SOURCE/repository/StorkRepository_nr06.privatekey $FOLDER
58
59 cp $SOURCE/repository/check_space $FOLDER
60 cp $SOURCE/repository/stork2repscripts/stork_fsck.sh $FOLDER
61 cp $SOURCE/repository/stork2repscripts/storkmakemetalive.sh $FOLDER
62
63 touch $FOLDER/__init__.py
64
65 #tar the dir up into the SOURCES folder
66 tar -czf SOURCES/$FOLDER.tar.gz $FOLDER
67
68 #remove the folder
69 rm -rf $FOLDER
70
71 #prepare the awk command
72 AWK="awk '{gsub(/@VER@/,\"$VER\"); gsub(/@REL@/,\"$REL\"); print;}' SPECS/stork-repository.spec.template"
73
74 #execute awk command
75 eval $AWK > .stork-repository.spec
76
77 #make rpm
78 rpmbuild -ba .stork-repository.spec
79 RETSTAT=$?
80
81 rm .stork-repository.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