PATCH: add DESTDIR support

From: Date: Thu, 07 Dec 2000 23:33:48 +0000
Subject: PATCH: add DESTDIR support
Groups: php.dev 
Request: Send a blank email to php-dev+get-40504@lists.php.net to get a copy of this message
Hi, and another patch, this time it add DESTDIR support for installation. Sorry it's only for pear and cgi, but you get the idea. It's extremly usefull for distributions or if you want to play and not overwrite the installed one right away. Petr Cech -- Debian GNU/Linux maintainer - www.debian.{org,cz} cech@atrey.karlin.mff.cuni.cz

--- php4-4.0.4.orig/Makefile.in +++ php4-4.0.4/Makefile.in @@ -1,4 +1,4 @@ - +DESTDIR = ZEND_DIR = $(srcdir)/Zend SUBDIRS = Zend main ext sapi $(TSRM_DIR) $(REGEX_DIR) . $(PEAR_DIR) @@ -32,7 +32,7 @@ install-sapi: @$(LIBTOOL) --silent --mode=install cp libphp4.la $(phptempdir)/libphp4.la >/dev/null 2>&1 - -@$(mkinstalldirs) $(bindir) + -@$(mkinstalldirs) $(DESTDIR)$(bindir) -@if test ! -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); then \ for i in 0.0.0 0.0 0; do \ if test -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME).$$i; then \ @@ -45,10 +45,10 @@ install-modules: @test -d modules && \ - $(mkinstalldirs) $(moduledir) && \ + $(mkinstalldirs) $(DESTDIR)$(moduledir) && \ echo "installing shared modules into $(moduledir)" && \ rm -f modules/*.la && \ - cp modules/* $(moduledir) >/dev/null 2>&1 || true + cp modules/* $(DESTDIR)$(moduledir) >/dev/null 2>&1 || true install-su: install-modules (cd pear && $(MAKE) install) --- php4-4.0.4.orig/pear/Makefile.in +++ php4-4.0.4/pear/Makefile.in @@ -52,16 +52,16 @@ XML/Parser.php install-data-local: PEAR.php - @if $(mkinstalldirs) $(peardir); then \ + @if $(mkinstalldirs) $(DESTDIR)$(peardir); then \ for i in $(PEAR_SUBDIRS); do \ - (set -x;$(mkinstalldirs) $(peardir)/$$i); \ + (set -x;$(mkinstalldirs) $(DESTDIR)$(peardir)/$$i); \ done; \ for i in $(PEAR_FILES); do \ dir=`echo $$i|sed 's%[^/][^/]*$$%%'`; \ - (set -x;$(INSTALL_DATA) $(srcdir)/$$i $(peardir)/$$dir); \ + (set -x;$(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(peardir)/$$dir); \ done; \ for i in PEAR.php; do \ - (set -x;$(INSTALL_DATA) $$i $(peardir)); \ + (set -x;$(INSTALL_DATA) $$i $(DESTDIR)$(peardir)); \ done; \ else \ cat $(srcdir)/install-pear.txt; \ exit 5; \ fi @@ -89,13 +89,13 @@ bin_PROGRAMS = phpize php-config pear install-build: - $(mkinstalldirs) $(phpbuilddir) $(bindir) && \ - (cd $(top_srcdir) && cp $(BUILD_FILES) $(phpbuilddir)) + $(mkinstalldirs) $(DESTDIR)$(phpbuilddir) $(DESTDIR)$(bindir) && \ + (cd $(top_srcdir) && cp $(BUILD_FILES) $(DESTDIR)$(phpbuilddir)) install-programs: - $(INSTALL) -m 755 $(srcdir)/phpextdist $(bindir)/phpextdist + $(INSTALL) -m 755 $(srcdir)/phpextdist $(DESTDIR)$(bindir)/phpextdist for prog in $(bin_PROGRAMS); do \ - $(INSTALL) -m 755 $$prog $(bindir)/$$prog; \ + $(INSTALL) -m 755 $$prog $(DESTDIR)$(bindir)/$$prog; \ done HEADER_DIRS = \ @@ -111,13 +111,13 @@ install-headers: -@for i in $(HEADER_DIRS); do \ - paths="$$paths $(phpincludedir)/$$i"; \ + paths="$$paths $(DESTDIR)$(phpincludedir)/$$i"; \ done; \ $(mkinstalldirs) $$paths && \ echo "creating header file hierarchy" && \ for i in $(HEADER_DIRS); do \ - (cd $(top_srcdir)/$$i && cp -p *.h $(phpincludedir)/$$i; \ - cd $(top_builddir)/$$i && cp -p *.h $(phpincludedir)/$$i) 2>/dev/null || true; \ + (cd $(top_srcdir)/$$i && cp -p *.h $(DESTDIR)$(phpincludedir)/$$i; \ + cd $(top_builddir)/$$i && cp -p *.h $(DESTDIR)$(phpincludedir)/$$i) 2>/dev/null || true; \ done Makefile: Makefile.in $(top_builddir)/config.status --- php4-4.0.4.orig/sapi/cgi/config.m4 +++ php4-4.0.4/sapi/cgi/config.m4 @@ -30,7 +30,7 @@ fi if test "$PHP_SAPI" = "cgi" ; then - INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_PROGRAM \$(bindir)/$SAPI_CGI" + INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_PROGRAM \$(DESTDIR)\$(bindir)/$SAPI_CGI" fi AC_MSG_CHECKING(for fhttpd module support)
« previous php.dev (#40504) next »