aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorPrakash Surya <[email protected]>2011-12-06 17:33:51 -0800
committerBrian Behlendorf <[email protected]>2011-12-14 16:44:10 -0800
commitc2dceb5cd5221f7e1bde915218f5d2cf69920959 (patch)
treec6cdcbea4bb00c969661e1c59eafda4393bbda6c /config
parent699d5ee8a99471b49b07e69108045301b865b0d6 (diff)
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 <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes: #68
Diffstat (limited to 'config')
-rw-r--r--config/arch.am40
-rw-r--r--config/spl-build.m446
2 files changed, 86 insertions, 0 deletions
diff --git a/config/arch.am b/config/arch.am
new file mode 100644
index 000000000..591013afd
--- /dev/null
+++ b/config/arch.am
@@ -0,0 +1,40 @@
+###############################################################################
+# Written by Prakash Surya <[email protected]>
+###############################################################################
+# 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;
diff --git a/config/spl-build.m4 b/config/spl-build.m4
index d0bd97cb4..2297937c0 100644
--- a/config/spl-build.m4
+++ b/config/spl-build.m4
@@ -298,6 +298,48 @@ AC_DEFUN([SPL_AC_DPKG], [
])
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
dnl # convert the RPM packages to the needed package type. This is
@@ -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
])