Skip to content
Browse files

use rpmbuild; looks like that's what all the cool kids do

  • Loading branch information...
1 parent 300486f commit 6f54f150b7151b1d3f59c9e78215b4c5f26aad10 @jschauma committed Feb 7, 2012
Showing with 8 additions and 6 deletions.
  1. +5 −4 rpm/build
  2. +3 −2 rpm/scanmaster.spec
View
9 rpm/build
@@ -4,15 +4,16 @@
set -e
name=${1:?"Usage: build <toolname>"}
-sourcedir=$(rpm --showrc | awk '/sourcedir/ { print $NF }')
-rpmdir="$(rpm --showrc | awk '/^rpmdir/ { print $NF }')/noarch"
+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 .. && pax -rw . ${tdir}/ )
+( 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..."
-rpm --quiet --buildarch noarch --clean -bb ${name}.spec
+rpmbuild --quiet --clean -bb ${name}.spec
echo "=> RPM built: ${rpmdir}/$(ls -rt ${rpmdir} | tail -1)"
View
5 rpm/scanmaster.spec
@@ -1,8 +1,9 @@
%define name scanmaster
%define release 1
%define version 3.3.0
-%define mybuilddir %{builddir}/%{name}-%{version}-root
+%define mybuilddir %{_builddir}/%{name}-%{version}-root
+BuildArch: noarch
BuildRoot: %{mybuilddir}
Summary: the scanmaster suite of scripts
License: BSD
@@ -22,7 +23,7 @@ It works best if the scans can take advantage of a set of scanslave nodes
with access to shared NFS space, though that is not a hard requirement.
This is an admittedly poor RPM. Fixes and corrections would be most
-welcome. Please contact jschauma@netmeister.org.
+welcome.
%prep
%setup -q

0 comments on commit 6f54f15

Please sign in to comment.
Something went wrong with that request. Please try again.