diff --git a/config/user-systemd.m4 b/config/user-systemd.m4 index 5d1f5618a9..3e6a4a281f 100644 --- a/config/user-systemd.m4 +++ b/config/user-systemd.m4 @@ -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], diff --git a/rpm/generic/zfs-dkms.spec.in b/rpm/generic/zfs-dkms.spec.in index c332d8d536..7b6612b89c 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 da2798c3d8..4a8f662316 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 7c96caacfa..55edbc83fa 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 diff --git a/rpm/redhat/zfs-kmod.spec.in b/rpm/redhat/zfs-kmod.spec.in index 28a6484180..473f2d0325 100644 --- a/rpm/redhat/zfs-kmod.spec.in +++ b/rpm/redhat/zfs-kmod.spec.in @@ -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}