Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

20 lines (18 sloc) 0.665 kb
#!/bin/sh
#
# A silly little helper script to build the RPM.
set -e
name=${1:?"Usage: build <toolname>"}
topdir=$(rpm --eval "%{_topdir}")
sourcedir=${topdir}/SOURCES
rpmdir="${topdir}/RPMS/noarch"
version=$(awk '/define version/ { print $NF }' ${name}.spec)
tdir=${TMPDIR:-/tmp}/${name}-${version}
mkdir -p ${tdir}
echo "=> Copying sources..."
( cd .. && tar cf - . | tar xf - -C ${tdir}/ )
echo "=> Creating source tarball under ${sourcedir}..."
( cd ${tdir}/.. && tar zcf ${sourcedir}/${name}-${version}.tar.gz ${name}-${version} )
echo "=> Building RPM..."
rpmbuild --quiet --clean -bb ${name}.spec
echo "=> RPM built: ${rpmdir}/$(ls -rt ${rpmdir} | tail -1)"
Jump to Line
Something went wrong with that request. Please try again.