Skip to content

Instantly share code, notes, and snippets.

Created January 10, 2013 02:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/4498800 to your computer and use it in GitHub Desktop.
Save anonymous/4498800 to your computer and use it in GitHub Desktop.
script to build tar ball or SRPM
topdir="${WORKSPACE}/rpmbuild"
rpmdir="${topdir}/RPMS/$(uname -m)"
echo "%_topdir ${topdir}" > "${HOME}/.rpmmacros"
case "${TARGET}" in
*/httpd-*)
# patch for httpd-2.4.3
tarball="${TARGET##*/}"
module="${tarball%.tar.*}"
curl -O "${TARGET}"
tar jxf "${tarball}"
sed -e 's,%{epoch}:,,g' -i "${module}/httpd.spec"
tar jcf "${tarball}" "${module}"
rpmbuild -tb "${tarball}"
;;
*.src.rpm) curl -O "${TARGET}" && rpmbuild --rebuild "${TARGET##*/}";;
*.tar.bz2) curl -O "${TARGET}" && rpmbuild -tb "${TARGET##*/}";;
*) echo 'environment variable TARGET must be set.'; exit 1;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment