make_curl_rpm 1.3 KB

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