Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Utilities / cmcurl-7.19.0 / packages / Linux / RPM / make_curl_rpm
blob544a23b67fc93bd342d38e380a0db7905e9ddb94
1 #! /bin/sh
2 # script to build curl RPM from src RPM (SSL and non-SSL versions)
4 # initialize
5 top_dir=/usr/src/redhat
6 sources_dir=$top_dir/SOURCES
7 specs_dir=$top_dir/SPECS
8 rpms_dir=$top_dir/RPMS
9 arch=`rpm --showrc | awk 'NF == 3 && $2 == "_arch" { print $3 }'`
11 # fill in your own name and email here
12 packager_name="Mr Joe Packager Person"
13 packager_email='<Joe@packager.person>'
15 # make sure we're running as root
16 if test `id -u` -ne `id -u root`
17 then
18 echo "you must build the RPM as root"
19 exit 1
22 # get version and release number
23 if test $# -lt 1
24 then
25 echo "version number?"
26 read version
27 else
28 version=$1
31 if test $# -lt 2
32 then
33 echo "release number?"
34 read release
35 else
36 release=$2
39 # build all the files
40 targets="curl curl-ssl"
41 for target in $targets
43 # make sure src RPM exist
44 src_rpm="$target-$version-$release.src.rpm"
45 if test -f $src_rpm
46 then
47 rpm -ivh $src_rpm
49 # replace packager in spec file
50 sed -e 's/^Packager: .*/Packager: $packager_name $packager_email/' $specs_dir/$target.spec > $specs_dir/$target-$version-$arch.spec
52 # build it
53 if ! rpm -ba $specs_dir/$target-$version-$arch.spec
54 then
55 echo "error building $target for $arch -- check output above"
58 echo "$target rpm is now in $rpms_dir/$arch"
59 else
60 echo $src_rpm does not exist
62 done