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

Arlin Davis arlin.r.davis at intel.com
Wed Sep 24 13:44: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>
---
 Makefile.am  |   33 ++++++++++++++++++---------------
 dapl.spec.in |    1 +
 2 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 4cb339f..8afa666 100755
--- a/Makefile.am
+++ b/Makefile.am
@@ -400,24 +400,27 @@ dist-hook: dapl.spec
 	cp dapl.spec $(distdir)
 	
 install-exec-hook:
-	if test -e $(sysconfdir)/dat.conf; then \
-		sed -e '/ofa-v2-.* u2/d' < $(sysconfdir)/dat.conf > /tmp/$$$$ofadapl; \
-		cp /tmp/$$$$ofadapl $(sysconfdir)/dat.conf; \
+	if ! test -d $(DESTDIR)$(sysconfdir); then \
+		mkdir -p $(DESTDIR)$(sysconfdir); \
 	fi; \
-	echo ofa-v2-ib0 u2.0 nonthreadsafe default libdaplofa.so.2 dapl.2.0 '"ib0 0" ""' >>
$(sysconfdir)/dat.conf; \
-	echo ofa-v2-ib1 u2.0 nonthreadsafe default libdaplofa.so.2 dapl.2.0 '"ib1 0" ""' >>
$(sysconfdir)/dat.conf; \
-	echo ofa-v2-mthca0-1 u2.0 nonthreadsafe default libdaploscm.so.2 dapl.2.0 '"mthca0 1" ""' >>
$(sysconfdir)/dat.conf; \
-	echo ofa-v2-mthca0-2 u2.0 nonthreadsafe default libdaploscm.so.2 dapl.2.0 '"mthca0 2" ""' >>
$(sysconfdir)/dat.conf; \
-	echo ofa-v2-mlx4_0-1 u2.0 nonthreadsafe default libdaploscm.so.2 dapl.2.0 '"mlx4_0 1" ""' >>
$(sysconfdir)/dat.conf; \
-	echo ofa-v2-mlx4_0-2 u2.0 nonthreadsafe default libdaploscm.so.2 dapl.2.0 '"mlx4_0 2" ""' >>
$(sysconfdir)/dat.conf;
-	echo ofa-v2-ipath0-1 u2.0 nonthreadsafe default libdaploscm.so.2 dapl.2.0 '"ipath0 1" ""' >>
$(sysconfdir)/dat.conf; \
-	echo ofa-v2-ipath0-2 u2.0 nonthreadsafe default libdaploscm.so.2 dapl.2.0 '"ipath0 2" ""' >>
$(sysconfdir)/dat.conf;
-	echo ofa-v2-ehca0-2 u2.0 nonthreadsafe default libdaploscm.so.2 dapl.2.0 '"ehca0 1" ""' >>
$(sysconfdir)/dat.conf;
+	if test -e $(DESTDIR)$(sysconfdir)/dat.conf; then \
+		sed -e '/ofa-v2-.* u2/d' < $(DESTDIR)$(sysconfdir)/dat.conf > /tmp/$$$$ofadapl; \
+		cp /tmp/$$$$ofadapl $(DESTDIR)$(sysconfdir)/dat.conf; \
+	fi; \
+	echo ofa-v2-ib0 u2.0 nonthreadsafe default libdaplofa.so.2 dapl.2.0 '"ib0 0" ""' >>
$(DESTDIR)$(sysconfdir)/dat.conf; \
+	echo ofa-v2-ib1 u2.0 nonthreadsafe default libdaplofa.so.2 dapl.2.0 '"ib1 0" ""' >>
$(DESTDIR)$(sysconfdir)/dat.conf; \
+	echo ofa-v2-mthca0-1 u2.0 nonthreadsafe default libdaploscm.so.2 dapl.2.0 '"mthca0 1" ""' >>
$(DESTDIR)$(sysconfdir)/dat.conf; \
+	echo ofa-v2-mthca0-2 u2.0 nonthreadsafe default libdaploscm.so.2 dapl.2.0 '"mthca0 2" ""' >>
$(DESTDIR)$(sysconfdir)/dat.conf; \
+	echo ofa-v2-mlx4_0-1 u2.0 nonthreadsafe default libdaploscm.so.2 dapl.2.0 '"mlx4_0 1" ""' >>
$(DESTDIR)$(sysconfdir)/dat.conf; \
+	echo ofa-v2-mlx4_0-2 u2.0 nonthreadsafe default libdaploscm.so.2 dapl.2.0 '"mlx4_0 2" ""' >>
$(DESTDIR)$(sysconfdir)/dat.conf;
+	echo ofa-v2-ipath0-1 u2.0 nonthreadsafe default libdaploscm.so.2 dapl.2.0 '"ipath0 1" ""' >>
$(DESTDIR)$(sysconfdir)/dat.conf; \
+	echo ofa-v2-ipath0-2 u2.0 nonthreadsafe default libdaploscm.so.2 dapl.2.0 '"ipath0 2" ""' >>
$(DESTDIR)$(sysconfdir)/dat.conf;
+	echo ofa-v2-ehca0-2 u2.0 nonthreadsafe default libdaploscm.so.2 dapl.2.0 '"ehca0 1" ""' >>
$(DESTDIR)$(sysconfdir)/dat.conf;
 
 uninstall-hook:
-	if test -e $(sysconfdir)/dat.conf; then \
-		sed -e '/ofa-v2-.* u2/d' < $(sysconfdir)/dat.conf > /tmp/$$$$ofadapl; \
-		cp /tmp/$$$$ofadapl $(sysconfdir)/dat.conf; \
+	if test -e $(DESTDIR)$(sysconfdir)/dat.conf; then \
+		sed -e '/ofa-v2-.* u2/d' < $(DESTDIR)$(sysconfdir)/dat.conf > /tmp/$$$$ofadapl; \
+		cp /tmp/$$$$ofadapl $(DESTDIR)$(sysconfdir)/dat.conf; \
 	fi;
 
 SUBDIRS = . test/dtest test/dapltest
diff --git a/dapl.spec.in b/dapl.spec.in
index b33271b..ce39cd9 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