#7 Fix udev rules location (#1809117)
Opened 4 years ago by vtrefny. Modified 4 years ago
rpms/ vtrefny/mdadm master_fix-udev-rule-location  into  rawhide

file modified
+4 -1
@@ -1,3 +1,5 @@ 

+ %global udevdir %(pkg-config --variable=udevdir udev)

+ 

  Name:        mdadm

  Version:     4.1

  #define subversion rc2
@@ -24,6 +26,7 @@ 

  Patch98:     mdadm-2.5.2-static.patch

  

  BuildRequires: systemd-rpm-macros binutils-devel gcc

+ BuildRequires: systemd

  Requires: libreport-filesystem

  Requires(post): systemd coreutils

  Requires(preun): systemd
@@ -43,7 +46,7 @@ 

  make %{?_smp_mflags} CXFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" SYSCONFDIR="%{_sysconfdir}" mdadm mdmon

  

  %install

- make DESTDIR=%{buildroot} MANDIR=%{_mandir} BINDIR=%{_sbindir} SYSTEMD_DIR=%{_unitdir} UDEVDIR=%{_udevrulesdir} install install-systemd

+ make DESTDIR=%{buildroot} MANDIR=%{_mandir} BINDIR=%{_sbindir} SYSTEMD_DIR=%{_unitdir} UDEVDIR=%{udevdir} install install-systemd

  install -Dp -m 755 %{SOURCE1} %{buildroot}%{_sbindir}/raid-check

  install -Dp -m 644 %{SOURCE2} %{buildroot}%{_udevrulesdir}/65-md-incremental.rules

  install -Dp -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/raid-check

mdadm variable UDEVDIR expects the location without the "rules.d"
directory (so for example "/usr/lib/udev") so we can't use the
RPM _udevrulesdir macro.

rebased onto a6c4083

4 years ago

I've fixed the failing build, forgot to add systemd to build requires to make the pkg-config work.

Looks good to me. This should fix https://bugzilla.redhat.com/show_bug.cgi?id=1809117 which is really nasty if you're affected by it.

This really is a case of "wildcards considered harmful".

@vtrefny do you think the line in %files should be narrowed down, too? Just in case so this doesn't happen again. I.e. from this:

%{_udevrulesdir}/*

To this:

%{_udevrulesdir}/*.rules