]> granicus.if.org Git - zfs/commitdiff
Fix systemd spec file macros
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 12 Nov 2018 02:06:36 +0000 (18:06 -0800)
committerGitHub <noreply@github.com>
Mon, 12 Nov 2018 02:06:36 +0000 (18:06 -0800)
Ensure that the _unitdir, _presetdir, _modulesloaddir, and
_systemdgeneratordir macros are always defined.  If not set
them to the expected default values.  Pass all of these options
to ./configure and package the resulting files in those locations.

Additionally, set __brp_mangle_shebangs_exclude_from until the
conversion to Python 3 is complete so they may be built cleanly
under mock.

Reviewed-by: Neal Gompa <ngompa@datto.com>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #7567
Closes #8119

config/user-systemd.m4
rpm/generic/zfs-dkms.spec.in
rpm/generic/zfs-kmod.spec.in
rpm/generic/zfs.spec.in
rpm/redhat/zfs-kmod.spec.in

index 5d1f5618a948b7863208b2b4d0cccf84b343fca2..3e6a4a281f3c9c197ef7e4cb95a9fdd4482c1e19 100644 (file)
@@ -18,7 +18,7 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_SYSTEMD], [
        AC_ARG_WITH(systemdmodulesloaddir,
                AC_HELP_STRING([--with-systemdmodulesloaddir=DIR],
                [install systemd module load files into dir [[/usr/lib/modules-load.d]]]),
-               systemdmoduleloaddir=$withval,systemdmodulesloaddir=/usr/lib/modules-load.d)
+               systemdmodulesloaddir=$withval,systemdmodulesloaddir=/usr/lib/modules-load.d)
 
        AC_ARG_WITH(systemdgeneratordir,
                AC_HELP_STRING([--with-systemdgeneratordir=DIR],
index c332d8d5366d89eaaf69bc06a4ece147598127ea..7b6612b89c0c05e340a54d78b60c3cf215cba846 100644 (file)
@@ -4,6 +4,9 @@
 %define not_rpm 1
 %endif
 
+# See comment in zfs.spec.in.
+%global __brp_mangle_shebangs_exclude_from arc_summary.py|arcstat.py|dbufstat.py|test-runner.py|zts-report.py
+
 %define module  @PACKAGE@
 %define mkconf  scripts/dkms.mkconf
 
index da2798c3d8d28f867c9dad540955e987d943181f..4a8f662316cc68020e925f9ff123bc6058cfe91f 100644 (file)
@@ -1,5 +1,8 @@
 %define module  @PACKAGE@
 
+# See comment in zfs.spec.in.
+%global __brp_mangle_shebangs_exclude_from arc_summary.py|arcstat.py|dbufstat.py|test-runner.py|zts-report.py
+
 %if !%{defined ksrc}
 %if 0%{?rhel}%{?fedora}
 %define ksrc    ${kernel_version##*___}
index 7c96caacfa170b65b10eb49d180ba7e835fc6499..55edbc83fa80bd76a6acc0425aae11c917f7529c 100644 (file)
 %endif
 %endif
 
-# Set the default _initconfdir when undefined.
 %if %{undefined _initconfdir}
 %global _initconfdir /etc/sysconfig
 %endif
 
+%if %{undefined _unitdir}
+%global _unitdir %{_prefix}/lib/systemd/system
+%endif
+
+%if %{undefined _presetdir}
+%global _presetdir %{_prefix}/lib/systemd/system-preset
+%endif
+
+%if %{undefined _modulesloaddir}
+%global _modulesloaddir %{_prefix}/lib/modules-load.d
+%endif
+
+%if %{undefined _systemdgeneratordir}
+%global _systemdgeneratordir %{_prefix}/lib/systemd/system-generators
+%endif
+
 %bcond_with    debug
 %bcond_with    debuginfo
 %bcond_with    asan
@@ -278,7 +293,7 @@ image which is ZFS aware.
 %endif
 
 %if 0%{?_systemd}
-    %define systemd --enable-systemd --with-systemdunitdir=%{_unitdir} --with-systemdpresetdir=%{_presetdir} --disable-sysvinit
+    %define systemd --enable-systemd --with-systemdunitdir=%{_unitdir} --with-systemdpresetdir=%{_presetdir} --with-systemdmodulesloaddir=%{_modulesloaddir} --with-systemdgeneratordir=%{_systemdgeneratordir} --disable-sysvinit
     %define systemd_svcs zfs-import-cache.service zfs-import-scan.service zfs-mount.service zfs-share.service zfs-zed.service zfs.target zfs-import.target
 %else
     %define systemd --enable-sysvinit --disable-systemd
@@ -374,10 +389,10 @@ systemctl --system daemon-reload >/dev/null || true
 %{_udevdir}/zvol_id
 %{_udevdir}/rules.d/*
 %if 0%{?_systemd}
-/usr/lib/modules-load.d/*
 %{_unitdir}/*
 %{_presetdir}/*
-%{_generatordir}/*
+%{_modulesloaddir}/*
+%{_systemdgeneratordir}/*
 %else
 %config(noreplace) %{_sysconfdir}/init.d/*
 %config(noreplace) %{_initconfdir}/zfs
index 28a64841800d43fcfed58519152777ef494526b8..473f2d0325099ed5d5c93865d5fe471b1e03fadb 100644 (file)
@@ -1,6 +1,9 @@
 %bcond_with     debug
 %bcond_with     debuginfo
 
+# See comment in zfs.spec.in.
+%global __brp_mangle_shebangs_exclude_from arc_summary.py|arcstat.py|dbufstat.py|test-runner.py|zts-report.py
+
 Name:           @PACKAGE@-kmod
 Version:        @VERSION@
 Release:        @RELEASE@%{?dist}