summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/arch.am40
-rw-r--r--config/zfs-build.m444
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
])