aboutsummaryrefslogtreecommitdiffstats
path: root/config/zfs-build.m4
diff options
context:
space:
mode:
Diffstat (limited to 'config/zfs-build.m4')
-rw-r--r--config/zfs-build.m434
1 files changed, 34 insertions, 0 deletions
diff --git a/config/zfs-build.m4 b/config/zfs-build.m4
index f05a4dcd0..cccd87ff2 100644
--- a/config/zfs-build.m4
+++ b/config/zfs-build.m4
@@ -109,6 +109,11 @@ dnl # Check for rpm+rpmbuild to build RPM packages. If these tools
dnl # are missing it is non-fatal but you will not be able to build
dnl # RPM packages and will be warned if you try too.
dnl #
+dnl # By default the generic spec file will be used because it requires
+dnl # minimal dependencies. Distribution specific spec files can be
+dnl # placed under the 'rpm/<distribution>' directory and enabled using
+dnl # the --with-spec=<distribution> configure option.
+dnl #
AC_DEFUN([ZFS_AC_RPM], [
RPM=rpm
RPMBUILD=rpmbuild
@@ -133,6 +138,25 @@ AC_DEFUN([ZFS_AC_RPM], [
AC_MSG_RESULT([$HAVE_RPMBUILD])
])
+ RPM_DEFINE_COMMON=
+ RPM_DEFINE_UTIL=
+ RPM_DEFINE_KMOD='--define "kernels $(LINUX_VERSION)"'
+ RPM_DEFINE_DKMS=
+
+ SRPM_DEFINE_COMMON='--define "build_src_rpm 1"'
+ SRPM_DEFINE_UTIL=
+ SRPM_DEFINE_KMOD=
+ SRPM_DEFINE_DKMS=
+
+ RPM_SPEC_DIR="rpm/generic"
+ AC_ARG_WITH([spec],
+ AS_HELP_STRING([--with-spec=SPEC],
+ [Spec files 'generic|fedora']),
+ [RPM_SPEC_DIR="rpm/$withval"])
+
+ AC_MSG_CHECKING([whether spec files are available])
+ AC_MSG_RESULT([yes ($RPM_SPEC_DIR/*.spec.in)])
+
AC_SUBST(HAVE_RPM)
AC_SUBST(RPM)
AC_SUBST(RPM_VERSION)
@@ -140,6 +164,16 @@ AC_DEFUN([ZFS_AC_RPM], [
AC_SUBST(HAVE_RPMBUILD)
AC_SUBST(RPMBUILD)
AC_SUBST(RPMBUILD_VERSION)
+
+ AC_SUBST(RPM_SPEC_DIR)
+ AC_SUBST(RPM_DEFINE_UTIL)
+ AC_SUBST(RPM_DEFINE_KMOD)
+ AC_SUBST(RPM_DEFINE_DKMS)
+ AC_SUBST(RPM_DEFINE_COMMON)
+ AC_SUBST(SRPM_DEFINE_UTIL)
+ AC_SUBST(SRPM_DEFINE_KMOD)
+ AC_SUBST(SRPM_DEFINE_DKMS)
+ AC_SUBST(SRPM_DEFINE_COMMON)
])
dnl #