Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 20 lines (18 sloc) 0.665 kb
300486fd »
2012-02-03 Add an admittedly poor RPM spec to build an admittedly poor RPM.
1 #!/bin/sh
2 #
3 # A silly little helper script to build the RPM.
4 set -e
5
6 name=${1:?"Usage: build <toolname>"}
6f54f150 »
2012-02-07 use rpmbuild; looks like that's what all the cool kids do
7 topdir=$(rpm --eval "%{_topdir}")
8 sourcedir=${topdir}/SOURCES
9 rpmdir="${topdir}/RPMS/noarch"
300486fd »
2012-02-03 Add an admittedly poor RPM spec to build an admittedly poor RPM.
10 version=$(awk '/define version/ { print $NF }' ${name}.spec)
11 tdir=${TMPDIR:-/tmp}/${name}-${version}
12 mkdir -p ${tdir}
13 echo "=> Copying sources..."
6f54f150 »
2012-02-07 use rpmbuild; looks like that's what all the cool kids do
14 ( cd .. && tar cf - . | tar xf - -C ${tdir}/ )
300486fd »
2012-02-03 Add an admittedly poor RPM spec to build an admittedly poor RPM.
15 echo "=> Creating source tarball under ${sourcedir}..."
16 ( cd ${tdir}/.. && tar zcf ${sourcedir}/${name}-${version}.tar.gz ${name}-${version} )
17 echo "=> Building RPM..."
6f54f150 »
2012-02-07 use rpmbuild; looks like that's what all the cool kids do
18 rpmbuild --quiet --clean -bb ${name}.spec
300486fd »
2012-02-03 Add an admittedly poor RPM spec to build an admittedly poor RPM.
19 echo "=> RPM built: ${rpmdir}/$(ls -rt ${rpmdir} | tail -1)"
Something went wrong with that request. Please try again.