check in missing update to spec file
[raven.git] / rpm_builds / build-arizona_lib
1 #!/usr/local/bin/bash
2
3 if [ ! $# -eq 2 ]
4 then
5         echo "usage: build-arizona_lib <version> <release>"
6         exit 1
7 fi
8
9 VER=$1
10 REL=$2
11 SOURCE=`cat source`
12 FOLDER="arizona-lib-$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/storkversion.py
19 echo "VER= '"$VER"'" >> $FOLDER/storkversion.py
20 echo "REL= '"$REL"'" >> $FOLDER/storkversion.py
21 echo "VERREL = VER + '-' + REL" >> $FOLDER/storkversion.py
22
23 cp $SOURCE/lib/arizona-lib/setup.py $FOLDER
24 cp $SOURCE/lib/arizona-lib/arizonacomm.py $FOLDER
25 cp $SOURCE/lib/arizona-lib/arizonaconfig.py $FOLDER
26 cp $SOURCE/lib/arizona-lib/arizonacrypt.py $FOLDER
27 cp $SOURCE/lib/arizona-lib/arizonacurl.py $FOLDER
28 cp $SOURCE/lib/arizona-lib/arizonaerror.py $FOLDER
29 cp $SOURCE/lib/arizona-lib/arizonageneral.py $FOLDER
30 cp $SOURCE/lib/arizona-lib/arizonareport.py $FOLDER
31 cp $SOURCE/lib/arizona-lib/arizonatemplate.py $FOLDER
32 cp $SOURCE/lib/arizona-lib/arizonatransfer.py $FOLDER
33 cp $SOURCE/lib/arizona-lib/arizonaunittest.py $FOLDER
34 cp $SOURCE/lib/arizona-lib/arizonawarning.py $FOLDER
35 cp $SOURCE/lib/arizona-lib/arizonaxml.py $FOLDER
36 cp $SOURCE/lib/arizona-lib/aztransfer.py $FOLDER
37 cp $SOURCE/lib/arizona-lib/download_indicator.py $FOLDER
38 cp $SOURCE/lib/arizona-lib/planetlabAPI.py $FOLDER
39 cp $SOURCE/lib/arizona-lib/planetlabCall.py $FOLDER
40 cp $SOURCE/lib/arizona-lib/securerandom.py $FOLDER
41 cp $SOURCE/lib/arizona-lib/storkbtdownloadheadless.py $FOLDER
42 mkdir -p $FOLDER/transfer/
43 cp $SOURCE/lib/arizona-lib/transfer/arizonatransfer_ftp.py $FOLDER/transfer
44 cp $SOURCE/lib/arizona-lib/transfer/arizonatransfer_http.py $FOLDER/transfer
45 cp $SOURCE/lib/arizona-lib/transfer/arizonatransfer_https.py $FOLDER/transfer
46 cp $SOURCE/lib/arizona-lib/transfer/arizonatransfer_coblitz.py $FOLDER/transfer
47 cp $SOURCE/lib/arizona-lib/transfer/arizonatransfer_coral.py $FOLDER/transfer
48 cp $SOURCE/lib/arizona-lib/transfer/arizonatransfer_nestproxy.py $FOLDER/transfer
49 cp $SOURCE/lib/arizona-lib/transfer/arizonatransfer_bittorrent.py $FOLDER/transfer
50 cp $SOURCE/lib/arizona-lib/transfer/arizonatransfer_s3.py $FOLDER/transfer
51
52 cp $SOURCE/2.0/owl/conf.d/arizonatransfer.conf $FOLDER/arizonatransfer_owl.conf
53 cp $SOURCE/2.0/owl/scripts.d/arizonatransfer $FOLDER/arizonatransfer_owl
54
55 chmod a+x $FOLDER/aztransfer.py
56
57
58 #mv the source files we need to there
59
60 touch $FOLDER/__init__.py
61
62 #tar the dir up into the SOURCES folder
63 tar -czf SOURCES/$FOLDER.tar.gz $FOLDER
64
65 #remove the folder
66 rm -rf $FOLDER
67
68 #prepare the awk command
69 AWK="awk '{gsub(/@VER@/,\"$VER\"); gsub(/@REL@/,\"$REL\"); print;}' SPECS/arizona-lib.spec.template"
70
71 #execute awk command
72 eval $AWK > .stork-arizona_lib.spec
73
74 #make rpm
75 rpmbuild -ba .stork-arizona_lib.spec --target noarch
76 RETSTAT=$?
77
78
79 rm .stork-arizona_lib.spec
80
81 #clean up the debug rpms that get created for some reason
82 for foo in `find ./ -name "*debuginfo*"`
83 do
84         rm -f $foo
85 done
86
87 exit $RETSTAT