dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/mdadm-3.2.6-query-udev-dir-via-pkg-config.patch

373056
From fa0d79e2b2642a2f8b04d34dfef866dbabc69e1e Mon Sep 17 00:00:00 2001
373056
From: Samuli Suominen <ssuominen@gentoo.org>
373056
Date: Mon, 13 Aug 2012 13:44:22 -0400
373056
Subject: [PATCH] query udev dir via pkg-config
373056
373056
Since udev is moving its internal dir around, query it via pkg-config
373056
rather than hardcoding the old path.  This should work with new/old
373056
versions.
373056
373056
Signed-off-by: Samuli Suominen <ssuominen@gentoo.org>
373056
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
373056
Signed-off-by: NeilBrown <neilb@suse.de>
373056
---
373056
 Makefile | 9 ++++++++-
373056
 1 file changed, 8 insertions(+), 1 deletion(-)
373056
373056
diff --git a/Makefile b/Makefile
373056
index 72f609e..a3e4027 100644
373056
--- a/Makefile
373056
+++ b/Makefile
373056
@@ -57,6 +57,8 @@ else
373056
  DEFAULT_METADATA=1.2
373056
 endif
373056
 
373056
+PKG_CONFIG ?= pkg-config
373056
+
373056
 SYSCONFDIR = /etc
373056
 CONFFILE = $(SYSCONFDIR)/mdadm.conf
373056
 CONFFILE2 = $(SYSCONFDIR)/mdadm/mdadm.conf
373056
@@ -96,6 +98,11 @@ MAN4DIR = $(MANDIR)/man4
373056
 MAN5DIR = $(MANDIR)/man5
373056
 MAN8DIR = $(MANDIR)/man8
373056
 
373056
+UDEVDIR := $(shell $(PKG_CONFIG) --variable=udevdir udev 2>/dev/null)
373056
+ifndef UDEVDIR
373056
+ UDEVDIR = /lib/udev
373056
+endif
373056
+
373056
 OBJS =  mdadm.o config.o policy.o mdstat.o  ReadMe.o util.o maps.o lib.o \
373056
 	Manage.o Assemble.o Build.o \
373056
 	Create.o Detail.o Examine.o Grow.o Monitor.o dlink.o Kill.o Query.o \
373056
@@ -255,7 +262,7 @@ install-man: mdadm.8 md.4 mdadm.conf.5 mdmon.8
373056
 	$(INSTALL) -D -m 644 mdadm.conf.5 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5
373056
 
373056
 install-udev: udev-md-raid.rules
373056
-	$(INSTALL) -D -m 644 udev-md-raid.rules $(DESTDIR)/lib/udev/rules.d/64-md-raid.rules
373056
+	$(INSTALL) -D -m 644 udev-md-raid.rules $(DESTDIR)$(UDEVDIR)/rules.d/64-md-raid.rules
373056
 
373056
 uninstall:
373056
 	rm -f $(DESTDIR)$(MAN8DIR)/mdadm.8 $(DESTDIR)$(MAN8DIR)/mdmon.8 $(DESTDIR)$(MAN4DIR)/md.4 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5 $(DESTDIR)$(BINDIR)/mdadm
373056
373056
-- 
373056
1.8.1.4
373056