diff options
author | Prakash Surya <[email protected]> | 2011-12-07 17:02:42 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2011-12-14 19:14:23 -0800 |
commit | 6ba3b44614fa6482bd2d7363964b65f0289b0f4f (patch) | |
tree | 6525d48a5839bf8fbdc1ef41fcbf8b8b5271fac5 /config | |
parent | a38718a63d79116d6cb614dd2821e2a3955e5c8c (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 the Arch Linux machine to create two binary packages compatible with
the pacman package manager, one for the zfs userland utilities and
another for the zfs 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 build 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 #491
Diffstat (limited to 'config')
-rw-r--r-- | config/arch.am | 40 | ||||
-rw-r--r-- | config/zfs-build.m4 | 44 |
2 files changed, 84 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/zfs-build.m4 b/config/zfs-build.m4 index 5215463f0..597713139 100644 --- a/config/zfs-build.m4 +++ b/config/zfs-build.m4 @@ -175,6 +175,48 @@ AC_DEFUN([ZFS_AC_ALIEN], [ ]) 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([ZFS_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 # Using the VENDOR tag from config.guess set the default dnl # package type for 'make pkg': (rpm | deb | tgz) dnl # @@ -214,6 +256,7 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [ slackware) DEFAULT_PACKAGE=tgz ;; gentoo) DEFAULT_PACKAGE=tgz ;; lunar) DEFAULT_PACKAGE=tgz ;; + arch) DEFAULT_PACKAGE=arch;; *) DEFAULT_PACKAGE=rpm ;; esac @@ -254,5 +297,6 @@ AC_DEFUN([ZFS_AC_PACKAGE], [ ZFS_AC_RPM ZFS_AC_DPKG ZFS_AC_ALIEN + ZFS_AC_PACMAN ZFS_AC_DEFAULT_PACKAGE ]) |