From 8aa758ee7a14e93ded1d55b4aca7a54aa47d7174 Mon Sep 17 00:00:00 2001 From: Nathan Cutler Date: Thu, 25 Jun 2015 22:37:52 +0200 Subject: [PATCH] ceph.spec.in: use _udevrulesdir to eliminate conditionals The conditionals governing where 50-rbd.rules is installed were not doing the right thing on SUSE distros. Start using the %_udevrulesdir RPM macro, while taking care that it is defined and set to the right value. Use it to eliminate some conditionals around other udev rules files as well. http://tracker.ceph.com/issues/12166 Fixes: #12166 Signed-off-by: Nathan Cutler --- ceph.spec.in | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/ceph.spec.in b/ceph.spec.in index e8b819af209a5..0682a22b31d0d 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -9,6 +9,8 @@ %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %endif +%{!?_udevrulesdir: %global _udevrulesdir /lib/udev/rules.d} + # Use systemd files on RHEL 7 and above and in SUSE/openSUSE. # Note: We don't install unit files for the services yet. For now, # the _with_systemd variable only implies that we'll install @@ -563,13 +565,8 @@ install -m 0644 -D etc/sysconfig/SuSEfirewall2.d/services/ceph-osd-mds %{buildro %endif # udev rules -%if 0%{?rhel} >= 7 || 0%{?fedora} -install -m 0644 -D udev/50-rbd.rules $RPM_BUILD_ROOT/usr/lib/udev/rules.d/50-rbd.rules -install -m 0644 -D udev/60-ceph-partuuid-workaround.rules $RPM_BUILD_ROOT/usr/lib/udev/rules.d/60-ceph-partuuid-workaround.rules -%else -install -m 0644 -D udev/50-rbd.rules $RPM_BUILD_ROOT/lib/udev/rules.d/50-rbd.rules -install -m 0644 -D udev/60-ceph-partuuid-workaround.rules $RPM_BUILD_ROOT/lib/udev/rules.d/60-ceph-partuuid-workaround.rules -%endif +install -m 0644 -D udev/50-rbd.rules $RPM_BUILD_ROOT%{_udevrulesdir}/50-rbd.rules +install -m 0644 -D udev/60-ceph-partuuid-workaround.rules $RPM_BUILD_ROOT%{_udevrulesdir}/60-ceph-partuuid-workaround.rules %if (0%{?rhel} && 0%{?rhel} < 7) install -m 0644 -D udev/95-ceph-osd-alt.rules $RPM_BUILD_ROOT/lib/udev/rules.d/95-ceph-osd.rules @@ -686,13 +683,8 @@ fi %{_libdir}/rados-classes/libcls_version.so* %dir %{_libdir}/ceph/erasure-code %{_libdir}/ceph/erasure-code/libec_*.so* -%if 0%{?rhel} >= 7 || 0%{?fedora} -/usr/lib/udev/rules.d/60-ceph-partuuid-workaround.rules -/usr/lib/udev/rules.d/95-ceph-osd.rules -%else -/lib/udev/rules.d/60-ceph-partuuid-workaround.rules -/lib/udev/rules.d/95-ceph-osd.rules -%endif +%{_udevrulesdir}/60-ceph-partuuid-workaround.rules +%{_udevrulesdir}/95-ceph-osd.rules %config %{_sysconfdir}/bash_completion.d/ceph %config(noreplace) %{_sysconfdir}/logrotate.d/ceph %if 0%{?suse_version} @@ -764,11 +756,7 @@ fi %{_initrddir}/rbdmap %{python_sitelib}/ceph_argparse.py* %{python_sitelib}/ceph_daemon.py* -%if 0%{?rhel} >= 7 || 0%{?fedora} -/usr/lib/udev/rules.d/50-rbd.rules -%else -/lib/udev/rules.d/50-rbd.rules -%endif +%{_udevrulesdir}/50-rbd.rules %postun -n ceph-common # Package removal cleanup -- 2.47.3