check in missing update to spec file
[raven.git] / rpm_builds / build-tppublish
1 #!/usr/local/bin/bash
2
3 if [ ! $# -eq 2 ]
4 then
5         echo "usage: build-client <version> <release>"
6         exit 1
7 fi
8
9 VER=$1
10 REL=$2
11 SOURCE=`cat source`
12 FOLDER="stork-tppublish-$VER"
13
14
15 #create a folder to do the stuff in
16 mkdir $FOLDER
17
18
19 #mv the source files we need to there
20 cp $SOURCE/apps/tppublish/storktptohtml.py $FOLDER/
21 cp $SOURCE/apps/tppublish/tppublish.sh $FOLDER/
22 cp $SOURCE/apps/tppublish/tppublish_tag.sh $FOLDER/
23 cp $SOURCE/apps/tppublish/tppublish.cron $FOLDER/
24
25 #tar the dir up into the SOURCES folder
26 tar -czf SOURCES/$FOLDER.tar.gz $FOLDER
27
28 #remove the folder
29 rm -rf $FOLDER
30
31 #prepare the awk command
32 AWK="awk '{gsub(/@VER@/,\"$VER\"); gsub(/@REL@/,\"$REL\"); print;}' SPECS/stork-tppublish.spec.template"
33
34 #execute awk command
35 eval $AWK > .stork-tppublish.spec
36
37 #make rpm
38 rpmbuild -ba .stork-tppublish.spec --target noarch
39 RETSTAT=$?
40
41 rm .stork-tppublish.spec
42
43 #clean up the debug rpms that get created for some reason
44 for foo in `find ./ -name "*debuginfo*"`
45 do
46         rm -f $foo
47 done
48
49
50 exit $RETSTAT