[patch] DESTDIR does not handeled properly.

Peter Volkov <[email protected]>
Newsgroups gmane.linux.network.bridge.ebtables.devel
Message-ID <1186915689.15470.26.camel@localhost>
Hello.

ebtables build system (Makefile :) ) currently does not handle DESTDIR
correctly. DESTDIR is the temporary location for installation. In other
words program is not supposed to work from there, but should work after
all files moved from DESTDIR to /. Now during make install ebtables
generate scripts, and substitute some PATHs there, so that in result
scripts are supposed to work from destdir and do not work from /, which
is wrong. Attached patch fixes the issue. It uses DESTDIR only on for
directories we are going to install files into. Please, review and
commit. Thank you.

-- 
Peter.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

_______________________________________________
Ebtables-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ebtables-devel
ebtables-2.0.8.1-scripts-build.patch (text/x-patch, 2.6 KB)
--- ./Makefile.orig	2007-08-12 13:25:23.000000000 +0400
+++ ./Makefile	2007-08-12 13:36:13.000000000 +0400
@@ -15,15 +15,6 @@
 SYSCONFIGDIR:=/usr/share/doc/ebtables-2.0.8.1
 DESTDIR:=
 
-# include DESTDIR param
-override LIBDIR:=$(DESTDIR)$(LIBDIR)/$(PROGNAME)
-override MANDIR:=$(DESTDIR)$(MANDIR)
-override BINDIR:=$(DESTDIR)$(BINDIR)
-override ETCDIR:=$(DESTDIR)$(ETCDIR)
-override INITDIR:=$(DESTDIR)$(INITDIR)
-override SYSCONFIGDIR:=$(DESTDIR)$(SYSCONFIGDIR)
-
-
 CFLAGS:=-Wall -Wunused
 CFLAGS_SH_LIB:=-fPIC
 CC:=gcc
@@ -163,34 +154,34 @@
 .PHONY: scripts
 scripts: ebtables-save ebtables.sysv ebtables-config
 	cat ebtables-save | sed 's/__EXEC_PATH__/$(tmp1)/g' > ebtables-save_
-	install -m 0755 -o root -g root ebtables-save_ $(BINDIR)/ebtables-save
+	install -m 0755 -o root -g root ebtables-save_ $(DESTDIR)$(BINDIR)/ebtables-save
 	cat ebtables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables.sysv_
-	install -m 0755 -o root -g root ebtables.sysv_ $(INITDIR)/ebtables
+	install -m 0755 -o root -g root ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables
 	cat ebtables-config | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables-config_
-	install -m 0600 -o root -g root ebtables-config_ $(SYSCONFIGDIR)/ebtables-config
+	install -m 0600 -o root -g root ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config
 	rm -f ebtables-save_ ebtables.sysv_ ebtables-config_
 
 $(MANDIR)/man8/ebtables.8: ebtables.8
-	mkdir -p $(@D)
+	mkdir -p $(DESTDIR)$(@D)
 	sed 's/$$(VERSION)/$(PROGVERSION)/' ebtables.8 | sed 's/$$(DATE)/$(PROGDATE)/' > ebtables.8_
-	install -m 0644 -o root -g root ebtables.8_ $@
+	install -m 0644 -o root -g root ebtables.8_ $(DESTDIR)$@
 	rm -f ebtables.8_
 
 $(ETHERTYPESFILE): ethertypes
-	mkdir -p $(@D)
-	install -m 0644 -o root -g root $< $@
+	mkdir -p $(DESTDIR)$(@D)
+	install -m 0644 -o root -g root $< $(DESTDIR)$@
 
 .PHONY: exec
 exec: ebtables ebtables-restore
-	mkdir -p $(BINDIR)
-	install -m 0755 -o root -g root $(PROGNAME) $(BINDIR)/$(PROGNAME)
-	install -m 0755 -o root -g root ebtables-restore $(BINDIR)/ebtables-restore
+	mkdir -p $(DESTDIR)$(BINDIR)
+	install -m 0755 -o root -g root $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME)
+	install -m 0755 -o root -g root ebtables-restore $(DESTDIR)$(BINDIR)/ebtables-restore
 
 .PHONY: install
 install: $(MANDIR)/man8/ebtables.8 $(ETHERTYPESFILE) exec scripts
-	mkdir -p $(LIBDIR)
-	install -m 0755 extensions/*.so $(LIBDIR)
-	install -m 0755 *.so $(LIBDIR)
+	mkdir -p $(DESTDIR)$(LIBDIR)
+	install -m 0755 extensions/*.so $(DESTDIR)$(LIBDIR)
+	install -m 0755 *.so $(DESTDIR)$(LIBDIR)
 
 .PHONY: clean
 clean:
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQBGvuVoz6tlgEWSarMRAoNgAJ42hmpkE3PKTtVMhJhnIbZv/8/slACePE9F
Gf+HaFUFTkCxTadmjQr1P4s=
=q5sN
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.