Blame SOURCES/0003-use-pkg-config-to-find-udev-rules-dir.patch

f567cd
From dd1eb4ed6a00bd5e25b952962a1dfebc213fa920 Mon Sep 17 00:00:00 2001
f567cd
From: Michal Schmidt <mschmidt@redhat.com>
f567cd
Date: Wed, 12 Aug 2015 16:58:32 +0200
f567cd
Subject: [PATCH] use pkg-config to find udev rules dir
f567cd
f567cd
---
f567cd
 Makefile | 9 ++++++++-
f567cd
 1 file changed, 8 insertions(+), 1 deletion(-)
f567cd
f567cd
diff --git a/Makefile b/Makefile
f567cd
index 92e4295740..5568eb84b5 100644
f567cd
--- a/Makefile
f567cd
+++ b/Makefile
f567cd
@@ -116,6 +116,13 @@ VERSION_RELEASE := $(VERSION)-$(RELEASE)
f567cd
 
f567cd
 LDLIBS := -lrt -lpthread -ldl ${EXTRA_LIBS}
f567cd
 
f567cd
+PKG_CONFIG ?= pkg-config
f567cd
+
f567cd
+UDEVDIR := $(shell $(PKG_CONFIG) --variable=udevdir udev 2>/dev/null)
f567cd
+ifndef UDEVDIR
f567cd
+	UDEVDIR = /lib/udev
f567cd
+endif
f567cd
+
f567cd
 all: symlinks
f567cd
 	for subdir in $(SUBDIRS); do \
f567cd
 		$(MAKE) -C $$subdir $@ ;\
f567cd
@@ -159,7 +166,7 @@ install: all
f567cd
 		ln -sf psm2.h psm.h ; \
f567cd
 		ln -sf psm2_mq.h psm_mq.h ; \
f567cd
 		ln -sf psm2_am.h psm_am.h)
f567cd
-	install -m 0644 -D 40-psm-compat.rules ${DESTDIR}/etc/udev/rules.d/40-psm-compat.rules
f567cd
+	install -m 0644 -D 40-psm-compat.rules ${DESTDIR}$(UDEVDIR)/rules.d/40-psm-compat.rules
f567cd
 
f567cd
 install-noship: all
f567cd
 	mkdir -p ${DESTDIR}/usr/include/hfi1diag
f567cd
-- 
f567cd
2.4.3
f567cd