Add make rule for building Arch Linux packages

Added the necessary build infrastructure for building packages
compatible with the Arch Linux distribution. As such, one can now run:

    $ ./configure
    $ make pkg     # Alternatively, one can run 'make arch' as well

on an Arch Linux machine to create two binary packages compatible with
the pacman package manager, one for the spl userland utilties and
another for the spl kernel modules. The new packages can then be
installed by running:

    # pacman -U $package.pkg.tar.xz

In addition, source-only packages suitable for an Arch Linux chroot
environment or remote builder can also be built using the 'sarch' make
rule.

NOTE: Since the source dist tarball is created on the fly from the head
of the build tree, it's MD5 hash signature will be continually influx.
As a result, the md5sum variable was intentionally omitted from the
PKGBUILD files, and the '--skipinteg' makepkg option is used. This may
or may not have any serious security implications, as the source tarball
is not being downloaded from an outside source.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes: #68
This commit is contained in:
Prakash Surya
2011-12-06 17:33:51 -08:00
committed by Brian Behlendorf
parent 699d5ee8a9
commit c2dceb5cd5
12 changed files with 296 additions and 20 deletions
+40
View File
@@ -0,0 +1,40 @@
###############################################################################
# Written by Prakash Surya <surya1@llnl.gov>
###############################################################################
# Build targets for RPM packages.
###############################################################################
sarch-modules:
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" sarch-common
sarch-utils:
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" sarch-common
sarch: sarch-modules sarch-utils
arch-modules:
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-modules" arch-common
arch-utils:
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" arch-common
arch: arch-modules arch-utils
arch-local:
@(if test "${HAVE_MAKEPKG}" = "no"; then \
echo -e "\n" \
"*** Required util ${MAKEPKG} missing. Please install the\n" \
"*** package for your distribution which provides ${MAKEPKG},\n" \
"*** re-run configure, and try again.\n"; \
exit 1; \
fi;)
sarch-common: dist
pkgbuild=PKGBUILD-$(pkg); \
$(MAKE) $(AM_MAKEFLAGS) arch-local || exit 1; \
$(MAKEPKG) --allsource --skipinteg --nodeps -p $$pkgbuild || exit 1;
arch-common: dist
pkgbuild=PKGBUILD-$(pkg); \
$(MAKE) $(AM_MAKEFLAGS) arch-local || exit 1; \
$(MAKEPKG) --skipinteg -p $$pkgbuild || exit 1;
+46
View File
@@ -297,6 +297,48 @@ AC_DEFUN([SPL_AC_DPKG], [
AC_SUBST(DPKGBUILD_VERSION)
])
dnl #
dnl # Check for pacman+makepkg to build Arch Linux packages. If these
dnl # tools are missing it is non-fatal but you will not be able to
dnl # build Arch Linux packages and will be warned if you try too.
dnl #
AC_DEFUN([SPL_AC_PACMAN], [
PACMAN=pacman
MAKEPKG=makepkg
AC_MSG_CHECKING([whether $PACMAN is available])
tmp=$($PACMAN --version 2>/dev/null)
AS_IF([test -n "$tmp"], [
PACMAN_VERSION=$(echo $tmp |
$AWK '/Pacman/ { print $[3] }' |
$SED 's/^v//')
HAVE_PACMAN=yes
AC_MSG_RESULT([$HAVE_PACMAN ($PACMAN_VERSION)])
],[
HAVE_PACMAN=no
AC_MSG_RESULT([$HAVE_PACMAN])
])
AC_MSG_CHECKING([whether $MAKEPKG is available])
tmp=$($MAKEPKG --version 2>/dev/null)
AS_IF([test -n "$tmp"], [
MAKEPKG_VERSION=$(echo $tmp | $AWK '/makepkg/ { print $[3] }')
HAVE_MAKEPKG=yes
AC_MSG_RESULT([$HAVE_MAKEPKG ($MAKEPKG_VERSION)])
],[
HAVE_MAKEPKG=no
AC_MSG_RESULT([$HAVE_MAKEPKG])
])
AC_SUBST(HAVE_PACMAN)
AC_SUBST(PACMAN)
AC_SUBST(PACMAN_VERSION)
AC_SUBST(HAVE_MAKEPKG)
AC_SUBST(MAKEPKG)
AC_SUBST(MAKEPKG_VERSION)
])
dnl #
dnl # Until native packaging for various different packing systems
dnl # can be added the least we can do is attempt to use alien to
@@ -341,6 +383,8 @@ AC_DEFUN([SPL_AC_DEFAULT_PACKAGE], [
VENDOR=slackware ;
elif test -f /etc/gentoo-release ; then
VENDOR=gentoo ;
elif test -f /etc/arch-release ; then
VENDOR=arch ;
else
VENDOR= ;
fi
@@ -355,6 +399,7 @@ AC_DEFUN([SPL_AC_DEFAULT_PACKAGE], [
ubuntu) DEFAULT_PACKAGE=deb ;;
debian) DEFAULT_PACKAGE=deb ;;
slackware) DEFAULT_PACKAGE=tgz ;;
arch) DEFAULT_PACKAGE=arch;;
*) DEFAULT_PACKAGE=rpm ;;
esac
@@ -369,6 +414,7 @@ AC_DEFUN([SPL_AC_PACKAGE], [
SPL_AC_RPM
SPL_AC_DPKG
SPL_AC_ALIEN
SPL_AC_PACMAN
SPL_AC_DEFAULT_PACKAGE
])