[Expat-discuss] Re: DESTDIR patches

Enrico Weigelt weigelt at metux.de
Tue Dec 14 21:47:16 CET 2004


* Karl Waclawek <karl at waclawek.net> wrote:

<snip>
> 2) Bug # 985235: expat-1.95.6-destdir.patch
sounds like mine ?

<snip>
> 3) Enrico's patch: Enrico.diff, Enrico, what is your bug #?
uff ? I've really got no idea if I ever had one ... 
I simply posted my patch on some hot day in July ...

> They are all basically the same. One of them initializes
> DESTDIR to an empty string.  Is that OK to do, or better left out?
hmm, better leave it out. 
it seems that this initialization overwrites variables coming from
env, while those coming from commandline survive. thats at least my 
personal experience w/ gmake-3.79.1

I'm making heavy use of env for my buildfarm, so I'd really have it
not to be initialized.


*BUT* we probably should have a short talk about DESTDIR vs. INSTALL_ROOT.
Many autoconf-based packages use DESTDIR, so I also tool this. 
But INSTALL_ROOT is also very common and seems to be clearer for me - 
it really states that evryting's installed as normal, but within some
other root directory. (ie. PREFIX does something really different)

Its probably best to support both. 
I've attached a patch which sets $(DESTDIR) to $(INSTALL_ROOT) 
if $(INSTALL_ROOT) is set.


cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service

  phone:     +49 36207 519931         www:       http://www.metux.de/
  fax:       +49 36207 519932         email:     contact at metux.de
  cellphone: +49 174 7066481
---------------------------------------------------------------------
 -- DSL ab 0 Euro. -- statische IP -- UUCP -- Hosting -- Webshops --
---------------------------------------------------------------------
-------------- next part --------------
diff -ruN expat-1.95.8.orig/Makefile.in expat-1.95.8/Makefile.in
--- expat-1.95.8.orig/Makefile.in	Tue Dec 14 21:40:57 2004
+++ expat-1.95.8/Makefile.in	Tue Dec 14 21:43:34 2004
@@ -44,6 +44,9 @@
 APIHEADER = $(srcdir)/lib/expat.h $(srcdir)/lib/expat_external.h
 LIBRARY = libexpat.la
 
+ifdef INSTALL_ROOT
+DESTDIR=$(INSTALL_ROOT)
+endif
 
 default:  buildlib xmlwf/xmlwf
 
-------------- next part --------------
diff -ruN expat-1.95.8.orig/Makefile.in expat-1.95.8/Makefile.in
--- expat-1.95.8.orig/Makefile.in	2004-12-03 16:48:45.000000000 +0100
+++ expat-1.95.8/Makefile.in	2004-12-03 16:50:03.000000000 +0100
@@ -73,22 +73,22 @@
 	tests/runtests
 
 install: xmlwf/xmlwf installlib
-	$(mkinstalldirs) $(bindir) $(man1dir)
-	$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf $(bindir)/xmlwf
-	$(INSTALL_DATA) $(MANFILE) $(man1dir)
+	$(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir)
+	$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf $(DESTDIR)$(bindir)/xmlwf
+	$(INSTALL_DATA) $(MANFILE) $(DESTDIR)$(man1dir)
 
 installlib: $(LIBRARY) $(APIHEADER)
-	$(mkinstalldirs) $(libdir) $(includedir)
-	$(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(libdir)/$(LIBRARY)
-	$(INSTALL_DATA) $(APIHEADER) $(includedir)
+	$(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
+	$(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(DESTDIR)$(libdir)/$(LIBRARY)
+	$(INSTALL_DATA) $(APIHEADER) $(DESTDIR)$(includedir)
 
 uninstall: uninstalllib
-	$(LIBTOOL) --mode=uninstall rm -f $(bindir)/xmlwf
-	rm -f $(man1dir)/xmlwf.1
+	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/xmlwf
+	rm -f $(DESTDIR)$(man1dir)/xmlwf.1
 
 uninstalllib:
-	$(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(LIBRARY)
-	rm -f $(includedir)/$(APIHEADER)
+	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(LIBRARY)
+	rm -f $(DESTDIR)$(includedir)/$(APIHEADER)
 
 # for VPATH builds (invoked by configure)
 mkdir-init:


More information about the Expat-discuss mailing list