]> git.proxmox.com Git - mirror_zfs.git/commitdiff
rpm: Fix `make rpm` on Debian/Ubuntu
authorsiv0 <github@nomore.at>
Fri, 6 Oct 2023 16:53:23 +0000 (18:53 +0200)
committerGitHub <noreply@github.com>
Fri, 6 Oct 2023 16:53:23 +0000 (09:53 -0700)
The recent patch to change the bash completion install location based
on the Distribution, ignored that it should still be possible to
create RPMs on Debian derived systems. Additionally `make deb` itself
creates RPMs and converts them via `alien`.

This patch adds the bashcompletiondir variable to the rpm defines and
uses this for the location, where to get the bash completion file.

It still changes the location on Debian/Ubuntu systems in the final
packages from /etc/bash_completion.d to
/usr/share/bash-completion/completions

Fixes: e69ade32e116e72d03068c03799924c3f1a15c95
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Closes #15355
Closes #15365

config/zfs-build.m4
rpm/generic/zfs.spec.in

index 5ea6aa29a3de0b4531a47c24fb3d1de02553525e..e4197dc1424e296512c563b7e36cca1d89886922 100644 (file)
@@ -358,6 +358,9 @@ AC_DEFUN([ZFS_AC_RPM], [
        AS_IF([test -n "$udevruledir" ], [
                RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' --define "_udevruledir $(udevruledir)"'
        ])
+       AS_IF([test -n "$bashcompletiondir" ], [
+               RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' --define "_bashcompletiondir $(bashcompletiondir)"'
+       ])
        RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_SYSTEMD)'
        RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PYZFS)'
        RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PAM)'
index 8c538a00d2037bf8aefdf312f12685d871b4d225..711e6c751dc0333137e87ecfb14f311d11b470b2 100644 (file)
@@ -522,7 +522,7 @@ systemctl --system daemon-reload >/dev/null || true
 %config(noreplace) %{_sysconfdir}/%{name}/vdev_id.conf.*.example
 %attr(440, root, root) %config(noreplace) %{_sysconfdir}/sudoers.d/*
 
-%config(noreplace) %{_sysconfdir}/bash_completion.d/zfs
+%config(noreplace) %{_bashcompletiondir}/zfs
 
 %files -n libzpool5
 %{_libdir}/libzpool.so.*