summaryrefslogtreecommitdiffstats
path: root/rpm/generic
diff options
context:
space:
mode:
Diffstat (limited to 'rpm/generic')
-rw-r--r--rpm/generic/zfs.spec.in25
1 files changed, 23 insertions, 2 deletions
diff --git a/rpm/generic/zfs.spec.in b/rpm/generic/zfs.spec.in
index 5dc69416d..0e7efbf3e 100644
--- a/rpm/generic/zfs.spec.in
+++ b/rpm/generic/zfs.spec.in
@@ -1,12 +1,32 @@
%global _sbindir /sbin
%global _libdir /%{_lib}
-%if 0%{?fedora} >= 17
+
+# Set the default udev directory based on distribution.
+%if 0%{!?_udevdir}
+%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 || 0%{?centos} >= 7
%global _udevdir %{_prefix}/lib/udev
-%global _dracutdir %{_prefix}/lib/dracut
%else
%global _udevdir /lib/udev
+%endif
+%endif
+
+# Set the default udevrule directory based on distribution.
+%if 0%{!?_udevruledir}
+%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 || 0%{?centos} >= 7
+%global _udevruledir %{_prefix}/lib/udevrule/rules.d
+%else
+%global _udevruledir /lib/udevrule/rules.d
+%endif
+%endif
+
+# Set the default dracut directory based on distribution.
+%if 0%{!?_dracutdir}
+%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 || 0%{?centos} >= 7
+%global _dracutdir %{_prefix}/lib/dracut
+%else
%global _dracutdir %{_prefix}/share/dracut
%endif
+%endif
%bcond_with debug
%bcond_with blkid
@@ -192,6 +212,7 @@ image which is ZFS aware.
%configure \
--with-config=user \
--with-udevdir=%{_udevdir} \
+ --with-udevruledir=%{_udevruledir} \
--with-dracutdir=%{_dracutdir} \
--disable-static \
%{debug} \