aboutsummaryrefslogtreecommitdiffstats
path: root/rpm/generic
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2018-11-11 18:06:36 -0800
committerGitHub <[email protected]>2018-11-11 18:06:36 -0800
commitecd3728b264b94de239932555b7046f1ddb936b2 (patch)
treed0309d351a139a174827823e764414ef3376eeae /rpm/generic
parent0500bfd0b9f1393af5bae274551147c5b31e7ccc (diff)
Fix systemd spec file macros
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 <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #7567 Closes #8119
Diffstat (limited to 'rpm/generic')
-rw-r--r--rpm/generic/zfs-dkms.spec.in3
-rw-r--r--rpm/generic/zfs-kmod.spec.in3
-rw-r--r--rpm/generic/zfs.spec.in23
3 files changed, 25 insertions, 4 deletions
diff --git a/rpm/generic/zfs-dkms.spec.in b/rpm/generic/zfs-dkms.spec.in
index c332d8d53..7b6612b89 100644
--- a/rpm/generic/zfs-dkms.spec.in
+++ b/rpm/generic/zfs-dkms.spec.in
@@ -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
diff --git a/rpm/generic/zfs-kmod.spec.in b/rpm/generic/zfs-kmod.spec.in
index da2798c3d..4a8f66231 100644
--- a/rpm/generic/zfs-kmod.spec.in
+++ b/rpm/generic/zfs-kmod.spec.in
@@ -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##*___}
diff --git a/rpm/generic/zfs.spec.in b/rpm/generic/zfs.spec.in
index 7c96caacf..55edbc83f 100644
--- a/rpm/generic/zfs.spec.in
+++ b/rpm/generic/zfs.spec.in
@@ -28,11 +28,26 @@
%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