2 # script to build curl RPM from src RPM (SSL and non-SSL versions)
5 top_dir
=/usr
/src
/redhat
6 sources_dir
=$top_dir/SOURCES
7 specs_dir
=$top_dir/SPECS
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`
18 echo "you must build the RPM as root"
22 # get version and release number
25 echo "version number?"
33 echo "release number?"
40 targets
="curl curl-ssl"
41 for target
in $targets
43 # make sure src RPM exist
44 src_rpm
="$target-$version-$release.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
53 if ! rpm
-ba $specs_dir/$target-$version-$arch.spec
55 echo "error building $target for $arch -- check output above"
58 echo "$target rpm is now in $rpms_dir/$arch"
60 echo $src_rpm does not exist