diff --git a/mdadm-3.2.6-query-udev-dir-via-pkg-config.patch b/mdadm-3.2.6-query-udev-dir-via-pkg-config.patch new file mode 100644 index 0000000..78f611e --- /dev/null +++ b/mdadm-3.2.6-query-udev-dir-via-pkg-config.patch @@ -0,0 +1,54 @@ +From fa0d79e2b2642a2f8b04d34dfef866dbabc69e1e Mon Sep 17 00:00:00 2001 +From: Samuli Suominen +Date: Mon, 13 Aug 2012 13:44:22 -0400 +Subject: [PATCH] query udev dir via pkg-config + +Since udev is moving its internal dir around, query it via pkg-config +rather than hardcoding the old path. This should work with new/old +versions. + +Signed-off-by: Samuli Suominen +Signed-off-by: Mike Frysinger +Signed-off-by: NeilBrown +--- + Makefile | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 72f609e..a3e4027 100644 +--- a/Makefile ++++ b/Makefile +@@ -57,6 +57,8 @@ else + DEFAULT_METADATA=1.2 + endif + ++PKG_CONFIG ?= pkg-config ++ + SYSCONFDIR = /etc + CONFFILE = $(SYSCONFDIR)/mdadm.conf + CONFFILE2 = $(SYSCONFDIR)/mdadm/mdadm.conf +@@ -96,6 +98,11 @@ MAN4DIR = $(MANDIR)/man4 + MAN5DIR = $(MANDIR)/man5 + MAN8DIR = $(MANDIR)/man8 + ++UDEVDIR := $(shell $(PKG_CONFIG) --variable=udevdir udev 2>/dev/null) ++ifndef UDEVDIR ++ UDEVDIR = /lib/udev ++endif ++ + OBJS = mdadm.o config.o policy.o mdstat.o ReadMe.o util.o maps.o lib.o \ + Manage.o Assemble.o Build.o \ + Create.o Detail.o Examine.o Grow.o Monitor.o dlink.o Kill.o Query.o \ +@@ -255,7 +262,7 @@ install-man: mdadm.8 md.4 mdadm.conf.5 mdmon.8 + $(INSTALL) -D -m 644 mdadm.conf.5 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5 + + install-udev: udev-md-raid.rules +- $(INSTALL) -D -m 644 udev-md-raid.rules $(DESTDIR)/lib/udev/rules.d/64-md-raid.rules ++ $(INSTALL) -D -m 644 udev-md-raid.rules $(DESTDIR)$(UDEVDIR)/rules.d/64-md-raid.rules + + install-systemd: systemd/mdmon@.service + $(INSTALL) -D -m 644 systemd/mdmon@.service $(DESTDIR)$(SYSTEMD_DIR)/mdmon@.service + +-- +1.8.1.4 + diff --git a/mdadm.spec b/mdadm.spec index 6cde615..dff44d9 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -1,7 +1,7 @@ Summary: The mdadm program controls Linux md devices (software RAID arrays) Name: mdadm Version: 3.2.6 -Release: 15%{?dist} +Release: 16%{?dist} Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}.tar.xz Source1: mdmonitor.init Source2: raid-check @@ -13,6 +13,7 @@ Source7: mdadm.conf Source8: mdadm_event.conf Patch1: mdadm-3.2.6-Create.c-check-if-freesize-is-equal-0.patch Patch2: mdadm-3.2.6-imsm-Forbid-spanning-between-multiple-controllers.patch +Patch3: mdadm-3.2.6-query-udev-dir-via-pkg-config.patch Patch93: mdadm-3.2.6-Remove-offroot-argument-and-default-to-always-settin.patch Patch94: mdadm-3.2.6-Add-support-for-launching-mdmon-via-systemctl-instea.patch Patch95: mdadm-3.2.6-In-case-launching-mdmon-fails-print-an-error-message.patch @@ -79,6 +80,7 @@ is not used as the system init process. %patch1 -p1 -b .raidsize %patch2 -p1 -b .multictrl +%patch3 -p1 -b .udevquery # Fedora customization patches %patch97 -p1 -b .udev @@ -94,13 +96,13 @@ make %{?_smp_mflags} CXFLAGS="$RPM_OPT_FLAGS" SYSCONFDIR="%{_sysconfdir}" mdadm %install rm -rf %{buildroot} %if !%{fedora17} -make DESTDIR=%{buildroot} MANDIR=%{_mandir} BINDIR=/sbin SYSTEMD_DIR=%{_unitdir} install install-systemd +make DESTDIR=%{buildroot} MANDIR=%{_mandir} BINDIR=%{_sbindir} SYSTEMD_DIR=%{_unitdir} install install-systemd %else -make DESTDIR=%{buildroot} MANDIR=%{_mandir} BINDIR=/sbin SYSTEMD_DIR=%{_unitdir} install +make DESTDIR=%{buildroot} MANDIR=%{_mandir} BINDIR=%{_sbindir} SYSTEMD_DIR=%{_unitdir} install install -Dp -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/mdmonitor %endif install -Dp -m 755 %{SOURCE2} %{buildroot}%{_sbindir}/raid-check -install -Dp -m 644 %{SOURCE3} %{buildroot}/lib/udev/rules.d/65-md-incremental.rules +install -Dp -m 644 %{SOURCE3} %{buildroot}%{_udevrulesdir}/65-md-incremental.rules install -Dp -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/raid-check install -Dp -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/cron.d/raid-check mkdir -p -m 700 %{buildroot}/var/run/mdadm @@ -110,8 +112,8 @@ mkdir -p %{buildroot}%{_unitdir} install -m644 %{SOURCE6} %{buildroot}%{_unitdir} # tmpfile -mkdir -p %{buildroot}%{_prefix}/lib/tmpfiles.d -install -m 0644 %{SOURCE7} %{buildroot}%{_prefix}/lib/tmpfiles.d/%{name}.conf +mkdir -p %{buildroot}%{_tmpfilesdir} +install -m 0644 %{SOURCE7} %{buildroot}%{_tmpfilesdir}/%{name}.conf mkdir -p %{buildroot}%{_localstatedir}/run/ install -d -m 0710 %{buildroot}%{_localstatedir}/run/%{name}/ @@ -146,15 +148,14 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc TODO ChangeLog mdadm.conf-example COPYING misc/* -/lib/udev/rules.d/* -/sbin/* -%{_sbindir}/raid-check +%{_udevrulesdir}/* +%{_sbindir}/* %{_unitdir}/* %{_mandir}/man*/md* %config(noreplace) %{_sysconfdir}/cron.d/* %config(noreplace) %{_sysconfdir}/sysconfig/* %dir %{_localstatedir}/run/%{name}/ -%config(noreplace) %{_prefix}/lib/tmpfiles.d/%{name}.conf +%config(noreplace) %{_tmpfilesdir}/%{name}.conf /etc/libreport/events.d/* %if %{fedora17} @@ -163,6 +164,11 @@ rm -rf %{buildroot} %endif %changelog +* Tue Apr 22 2013 Jes Sorensen - 3.2.6-16 +- Rely on rpm macros to place files in correct directories, and match /usr + move +- Resolves bz955248 + * Thu Mar 7 2013 Jes Sorensen - 3.2.6-15 - Cleanup .spec file handling of different Fedora versions - Resolves bz914629