[ofa-general] [PATCH][v1.2] build/install: $(DESTDIR) prepend needed on install hooks for dat.conf

Arlin Davis arlin.r.davis at intel.com
Wed Sep 24 14:23:08 PDT 2008


All install directives that automake creates automatically
have $(DESTDIR) prepended to them so that a make
DESTDIR=<some_path> install will work. The hand written
install hooks for dat.conf was missing DESTDIR.

Signed-off-by: Doug Ledford <dledford at redhat.com>
Signed-off-by: Arlin Davis <ardavis at ichips.intel.com>

---
 Makefile.am  |   27 +++++++++++++++------------
 dapl.spec.in |    1 +
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 29e6b3b..1dd996c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -383,22 +383,25 @@ dist-hook: dapl.spec
 	cp dapl.spec $(distdir)
 
 install-exec-hook:
-	if test -e $(sysconfdir)/dat.conf; then \
+	if ! test -d $(DESTDIR)$(sysconfdir); then \
+		mkdir -p $(DESTDIR)$(sysconfdir); \
+	fi; \
+	if test -e $(DESTDIR)$(sysconfdir)/dat.conf; then \
 		echo "exec-hook"; \
-		sed -e '/OpenIB-.*/d' < $(sysconfdir)/dat.conf > /tmp/$$$$OpenIBdapl; \
-		cp /tmp/$$$$OpenIBdapl $(sysconfdir)/dat.conf; \
+		sed -e '/OpenIB-.*/d' < $(DESTDIR)$(sysconfdir)/dat.conf > /tmp/$$$$OpenIBdapl; \
+		cp /tmp/$$$$OpenIBdapl $(DESTDIR)$(sysconfdir)/dat.conf; \
 	fi; \
-	echo OpenIB-cma u1.2 nonthreadsafe default libdaplcma.so.1 dapl.1.2 '"ib0 0" ""' >>
$(sysconfdir)/dat.conf; \
-	echo OpenIB-cma-1 u1.2 nonthreadsafe default libdaplcma.so.1 dapl.1.2 '"ib1 0" ""' >>
$(sysconfdir)/dat.conf; \
-        echo OpenIB-mthca0-1 u1.2 nonthreadsafe default libdaplscm.so.1 dapl.1.2 '"mthca0 1" ""' >>
$(sysconfdir)/dat.conf; \
-        echo OpenIB-mthca0-2 u1.2 nonthreadsafe default libdaplscm.so.1 dapl.1.2 '"mthca0 2" ""' >>
$(sysconfdir)/dat.conf; \
-        echo OpenIB-mlx4_0-1 u1.2 nonthreadsafe default libdaplscm.so.1 dapl.1.2 '"mlx4_0 1" ""' >>
$(sysconfdir)/dat.conf; \
-        echo OpenIB-mlx4_0-2 u1.2 nonthreadsafe default libdaplscm.so.1 dapl.1.2 '"mlx4_0 2" ""' >>
$(sysconfdir)/dat.conf;
+	echo OpenIB-cma u1.2 nonthreadsafe default libdaplcma.so.1 dapl.1.2 '"ib0 0" ""' >>
$(DESTDIR)$(sysconfdir)/dat.conf; \
+	echo OpenIB-cma-1 u1.2 nonthreadsafe default libdaplcma.so.1 dapl.1.2 '"ib1 0" ""' >>
$(DESTDIR)$(sysconfdir)/dat.conf; \
+        echo OpenIB-mthca0-1 u1.2 nonthreadsafe default libdaplscm.so.1 dapl.1.2 '"mthca0 1" ""' >>
$(DESTDIR)$(sysconfdir)/dat.conf; \
+        echo OpenIB-mthca0-2 u1.2 nonthreadsafe default libdaplscm.so.1 dapl.1.2 '"mthca0 2" ""' >>
$(DESTDIR)$(sysconfdir)/dat.conf; \
+        echo OpenIB-mlx4_0-1 u1.2 nonthreadsafe default libdaplscm.so.1 dapl.1.2 '"mlx4_0 1" ""' >>
$(DESTDIR)$(sysconfdir)/dat.conf; \
+        echo OpenIB-mlx4_0-2 u1.2 nonthreadsafe default libdaplscm.so.1 dapl.1.2 '"mlx4_0 2" ""' >>
$(DESTDIR)$(sysconfdir)/dat.conf;
 
 uninstall-hook:
-	if test -e $(sysconfdir)/dat.conf; then \
-		sed -e '/OpenIB-.* u1/d' < $(sysconfdir)/dat.conf > /tmp/$$$$OpenIBdapl; \
-		cp /tmp/$$$$OpenIBdapl $(sysconfdir)/dat.conf; \
+	if test -e $(DESTDIR)$(sysconfdir)/dat.conf; then \
+		sed -e '/OpenIB-.* u1/d' < $(DESTDIR)$(sysconfdir)/dat.conf > /tmp/$$$$OpenIBdapl; \
+		cp /tmp/$$$$OpenIBdapl $(DESTDIR)$(sysconfdir)/dat.conf; \
 	fi;
 	
 SUBDIRS = . test/dtest test/dapltest
diff --git a/dapl.spec.in b/dapl.spec.in
index 8c8f62a..b3d103e 100644
--- a/dapl.spec.in
+++ b/dapl.spec.in
@@ -83,6 +83,7 @@ rm -rf %{buildroot}
 make DESTDIR=%{buildroot} install
 # remove unpackaged files from the buildroot
 rm -f %{buildroot}%{_libdir}/*.la
+rm -f %{buildroot}%{_sysconfdir}/*.conf
 
 %clean
 rm -rf %{buildroot}
-- 
1.5.2.5






More information about the general mailing list