check in missing update to spec file
[raven.git] / rpm_builds / build-gacksnm
1 #!/bin/bash
2
3
4 if [ ! $# -eq 2 ]
5 then
6         echo "usage: build-gacksnm <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_UTIL=$GENIWRAPPER_DIR/util
14 GENIWRAPPER_TRUST=$GENIWRAPPER_DIR/trust
15 SOURCE=`cat source`
16 FOLDER="gacksnm-$VER"
17
18
19 #create a folder to do the stuff in
20 mkdir $FOLDER
21
22
23 #mv the source files we need to there
24 cp $SOURCE/apps/gacks/gacksnm.init $FOLDER
25 cp $SOURCE/apps/gacks/gacksnm.pkey $FOLDER
26 cp $SOURCE/apps/gacks/gacksnm.conf $FOLDER
27 cp $SOURCE/apps/gacks/*.py $FOLDER
28 cp $SOURCE/apps/gacks/etc/*.conf $FOLDER
29
30 cp $GENIWRAPPER_UTIL/*.py $FOLDER
31 cp $GENIWRAPPER_TRUST/*.py $FOLDER
32
33 touch $FOLDER/__init__.py
34
35 #tar the dir up into the SOURCES folder
36 tar -czf SOURCES/$FOLDER.tar.gz $FOLDER
37
38 #remove the folder
39 rm -rf $FOLDER
40
41 #prepare the awk command
42 AWK="awk '{gsub(/@VER@/,\"$VER\"); gsub(/@REL@/,\"$REL\"); print;}' SPECS/gacksnm.spec.template"
43
44 #execute awk command
45 eval $AWK > .gacksnm.spec
46
47 #make rpm
48 rpmbuild -ba .gacksnm.spec --target noarch
49 RETSTAT=$?
50
51 rm .gacksnm.spec
52
53 #clean up the debug rpms that get created for some reason
54 for foo in `find ./ -name "*debuginfo*"`
55 do
56         rm -f $foo
57 done
58
59 exit $RETSTAT