public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: xfs-oss <xfs@oss.sgi.com>
Subject: [PATCH] xfstests Makepkgs framework, builds rpms
Date: Thu, 01 Jan 2009 21:47:48 -0600	[thread overview]
Message-ID: <495D8E64.5070206@sandeen.net> (raw)
In-Reply-To: <495D42CE.6060806@sandeen.net>

With the install target in place, this lets us do Makepkgs:

== dist, log is Logs/dist
Wrote: /root/src/xfstests-dev.work/build/xfstests-1.0.0.src.tar.gz
Wrote: /root/src/xfstests-dev.work/build/tar/xfstests-1.0.0.tar.gz
Wrote: /root/src/xfstests-dev.work/build/rpm/xfstests-1.0.0-1.src.rpm
Wrote: /root/src/xfstests-dev.work/build/rpm/xfstests-1.0.0-1.x86_64.rpm

It's all largely cut & pasted from the xfsprogs framework.
I'll let the debian elves do the things they do for debian 
packaging if they're interested...

xfstests could use more work to make it package-friendly but this
is a good start at least.

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---

Index: xfstests-dev.work/Makepkgs
===================================================================
--- /dev/null
+++ xfstests-dev.work/Makepkgs
@@ -0,0 +1,88 @@
+#! /bin/sh
+#
+#	Make whichever packages have been requested.
+#	Defaults to RPMs.
+#
+LOGDIR=Logs
+
+type=rpm
+verbose=false
+
+MAKE=${MAKE:-make}
+test ! -z "$MAKE" && make=$MAKE
+
+for opt in $*
+do
+	case "$opt" in
+	clean)
+		;; # ignored, kept for backward compatibility
+	rpm)
+		type=rpm ;;
+	debian)
+		type=debian ;;
+	verbose)
+		verbose=true ;;
+	*)
+		echo "Usage: Makepkgs [verbose] [debian|rpm]"; exit 1 ;;
+	esac
+done
+
+# start with a clean manifest
+test -f files.rpm && rm -f files.rpm
+test -f filesdevel.rpm && rm -f filesdevel.rpm
+test -f fileslib.rpm && rm -f fileslib.rpm
+
+test ! -d $LOGDIR && mkdir $LOGDIR
+rm -rf $LOGDIR/* > /dev/null 2>&1
+
+# build Debian packages, cleans itself before starting
+SUDO=${SUDO:-sudo}
+test ! -z "$SUDO" && sudo=$SUDO
+if [ $type = debian ] ; then
+	LOGDEB=`pwd`
+	LOGDEB=../`basename $LOGDEB`.log
+	echo "== Debian build, log is $LOGDEB"; echo
+	if $verbose ; then
+		dpkg-buildpackage -r$SUDO | tee $LOGDEB
+	else
+		dpkg-buildpackage -r$SUDO > $LOGDEB || exit 1
+	fi
+	exit 0
+fi
+
+# build RPM packages - manual clean before starting
+echo "== clean, log is $LOGDIR/clean"
+if $verbose ; then
+	$MAKE clean 2>&1 | tee $LOGDIR/clean
+else
+	$MAKE clean > $LOGDIR/clean 2>&1  || exit 1
+fi
+
+echo
+echo "== configure, log is $LOGDIR/configure"
+rm -f .census	# force configure to run here
+if $verbose ; then
+	$MAKE configure 2>&1 | tee $LOGDIR/configure
+else
+	$MAKE configure > $LOGDIR/configure 2>&1 || exit 1
+fi
+
+echo
+echo "== default, log is $LOGDIR/default"
+if $verbose ; then
+	$MAKE default 2>&1 | tee $LOGDIR/default
+else
+	$MAKE default > $LOGDIR/default 2>&1 || exit 1
+fi
+
+echo
+echo "== dist, log is $LOGDIR/dist"
+[ ! -f .census ] && touch .census
+if $verbose ; then
+	$MAKE -C build dist 2>&1 | tee $LOGDIR/dist
+else
+	$MAKE -C build dist > $LOGDIR/dist 2>&1 || exit 1
+	grep '^Wrote:' $LOGDIR/dist | sed -e 's/\.\.\/\.\.\///'
+fi
+
+exit 0
Index: xfstests-dev.work/build/rpm/macros.template
===================================================================
--- /dev/null
+++ xfstests-dev.work/build/rpm/macros.template
@@ -0,0 +1,30 @@
+#
+# rpmrc.template
+#
+# Template to fudge rpm directory structure inside IRIX-like build
+# environment
+
+# Force 386 build on all platforms
+%_target i386-pc-linux
+%_target_cpu i386
+%_target_os linux
+
+# topdir == $(WORKAREA)
+%_topdir %topdir%
+
+# Following directories are specific to the topdir
+# This is where build is done. In our case it's the same as $WORKAREA
+%_builddir %topdir%
+
+# This is where foo.1.99.tar.gz is living in the real world.
+# Be careful not to run full rpm build as it will override the sources
+%_sourcedir %topdir%/build
+
+# This is where binary RPM and source RPM would end up
+%_rpmdir    %topdir%/build/rpm
+%_srcrpmdir %topdir%/build/rpm
+%_specdir   %topdir%/build/rpm
+
+# Leave RPM files in the same directory - we're not building for
+# multiple architectures
+%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
Index: xfstests-dev.work/build/rpm/xfstests.spec.in
===================================================================
--- /dev/null
+++ xfstests-dev.work/build/rpm/xfstests.spec.in
@@ -0,0 +1,49 @@
+Summary: XFS regression test suite
+Name: @pkg_name@
+Version: @pkg_version@
+Release: @pkg_release@
+Distribution: @pkg_distribution@
+Packager: Silicon Graphics, Inc. <http://www.sgi.com/>
+BuildRoot: @build_root@
+BuildRequires:  autoconf, xfsprogs-devel, e2fsprogs-devel
+BuildREquires:  libacl-devel, libattr-devel, libaio-devel
+Requires:       bash, xfsprogs, xfsdump, perl, acl, attr, bind-utils
+Requires:       bc, indent, quota
+Source: @pkg_name@-@pkg_version@.src.tar.gz
+License: GPL2+
+Vendor: Silicon Graphics, Inc.
+URL: http://oss.sgi.com/projects/xfs/
+Group: System Environment/Base
+
+%description
+The XFS regression test suite.  Also includes some support for
+acl, attr, dmapi, udf, and nfs testing.  Contains around 200 specific tests
+for userspace & kernelspace.
+
+%prep
+if [ -f .census ] ; then
+   if [ ! -d ${RPM_PACKAGE_NAME}-${RPM_PACKAGE_VERSION} ] ; then
+      ln -s . ${RPM_PACKAGE_NAME}-${RPM_PACKAGE_VERSION}
+   fi
+else
+%setup
+INSTALL_USER=root
+INSTALL_GROUP=root
+export INSTALL_USER INSTALL_GROUP
+@make@ configure
+fi
+
+%build
+@make@
+
+%install
+DIST_ROOT="$RPM_BUILD_ROOT"
+DIST_INSTALL=`pwd`/install.manifest
+export DIST_ROOT DIST_INSTALL
+@make@ install DIST_MANIFEST="$DIST_INSTALL"
+@make@ -C build/rpm rpmfiles DIST_MANIFEST="$DIST_INSTALL"
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files -f build/rpm/rpmfiles

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2009-01-02  3:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-01 22:25 [PATCH] create xfstests install target Eric Sandeen
2009-01-02  3:47 ` Eric Sandeen [this message]
2009-01-02 18:03   ` [PATCH] xfstests Makepkgs framework, builds rpms Christoph Hellwig
2009-01-02 18:02 ` [PATCH] create xfstests install target Christoph Hellwig
2009-01-02 18:26   ` Eric Sandeen
2009-01-03  3:46     ` Eric Sandeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=495D8E64.5070206@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox