zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: add DESTDIR functionality to install
@ 1999-08-21  2:39 Clint Adams
  1999-08-27 15:39 ` Bart Schaefer
  1999-08-30 12:28 ` Peter Stephenson
  0 siblings, 2 replies; 5+ messages in thread
From: Clint Adams @ 1999-08-21  2:39 UTC (permalink / raw)
  To: zsh-workers

This enables use of the DESTDIR variable which greatly facilitates
the installation of zsh in an alternate location without unwanted
behavior that can result from changing $(prefix).

e.g. make install DESTDIR=/tmp/test-chroot

--- zsh-3.1.6.orig/Config/funcinst.mk
+++ zsh-3.1.6/Config/funcinst.mk
@@ -33,6 +33,7 @@
 	  FUNCTIONS_INSTALL="$(FUNCTIONS_INSTALL)" \
 	  FUNCTIONS_SUBDIRS="$(FUNCTIONS_SUBDIRS)" \
 	  INSTALL_DATA="$(INSTALL_DATA)" \
+	  DESTDIR="$(DESTDIR)" \
 	  $(SHELL) $(sdir_top)/Config/installfns.sh || exit 1; \
 	fi; \
 	exit 0
@@ -42,6 +43,7 @@
 	  fndir="$(fndir)" sdir="$(sdir)" \
 	  FUNCTIONS_INSTALL="$(FUNCTIONS_INSTALL)" \
 	  FUNCTIONS_SUBDIRS="$(FUNCTIONS_SUBDIRS)" \
+	  DESTDIR="$(DESTDIR)" \
 	  $(SHELL) $(sdir_top)/Config/uninstallfns.sh || exit 1; \
 	fi; \
 	exit 0
--- zsh-3.1.6.orig/Config/installfns.sh
+++ zsh-3.1.6/Config/installfns.sh
@@ -4,7 +4,7 @@
   add_old=1
 fi
 
-$sdir_top/mkinstalldirs $fndir || exit 1;
+$sdir_top/mkinstalldirs $DESTDIR$fndir || exit 1;
 
 # If the source directory is somewhere else, we need to force
 # the shell to expand it in that directory, then strip it off.
@@ -36,8 +36,8 @@
         : ${add_old:=1}
       fi
     fi
-    $sdir_top/mkinstalldirs $instdir || exit 1
-    $INSTALL_DATA $sdir/$file $instdir || exit 1
+    $sdir_top/mkinstalldirs $DESTDIR$instdir || exit 1
+    $INSTALL_DATA $sdir/$file $DESTDIR$instdir || exit 1
   fi
 done
 
--- zsh-3.1.6.orig/Doc/Makefile.in
+++ zsh-3.1.6/Doc/Makefile.in
@@ -164,24 +164,24 @@
 
 # install man pages, creating install directory if necessary
 install.man: $(MAN)
-	$(sdir_top)/mkinstalldirs $(mandir)/man1
+	$(sdir_top)/mkinstalldirs $(DESTDIR)$(mandir)/man1
 	for file in $(MAN); do \
 	  if test -f $$file; then \
-	    $(INSTALL_DATA) $$file $(mandir)/man1; \
+	    $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man1; \
 	  elif test -f $(sdir)/$$file; then \
-	    $(INSTALL_DATA) $(sdir)/$$file $(mandir)/man1; \
+	    $(INSTALL_DATA) $(sdir)/$$file $(DESTDIR)$(mandir)/man1; \
 	  else :; \
 	  fi || exit 1; \
 	done
 
 # install info pages, creating install directory if necessary
 install.info: zsh.info
-	$(sdir_top)/mkinstalldirs $(infodir)
+	$(sdir_top)/mkinstalldirs $(DESTDIR)$(infodir)
 	for file in zsh.info zsh.info-[1-9]*; do \
 	  if test -f $$file; then \
-	    $(INSTALL_DATA) $$file $(infodir); \
+	    $(INSTALL_DATA) $$file $(DESTDIR)$(infodir); \
 	  elif test -f $(sdir)/$$file; then \
-	    $(INSTALL_DATA) $(sdir)/$$file $(infodir); \
+	    $(INSTALL_DATA) $(sdir)/$$file $(DESTDIR)$(infodir); \
 	  else :; \
 	   fi || exit 1; \
 	done
@@ -190,18 +190,18 @@
 	else true; fi
 
 install.html: zsh_toc.html
-	$(sdir_top)/mkinstalldirs $(htmldir)
-	$(INSTALL_DATA) *.html $(htmldir)
+	$(sdir_top)/mkinstalldirs $(DESTDIR)$(htmldir)
+	$(INSTALL_DATA) *.html $(DESTDIR)$(htmldir)
 
 # uninstall man pages
 uninstall.man:
 	for file in $(MAN); do \
-	  rm -f $(mandir)/man1/$$file; \
+	  rm -f $(DESTDIR)$(mandir)/man1/$$file; \
 	done
 
 # uninstall info pages
 uninstall.info:
-	rm -f $(infodir)/zsh.info $(infodir)/zsh.info-[1-9]*
+	rm -f $(DESTDIR)$(infodir)/zsh.info $(DESTDIR)$(infodir)/zsh.info-[1-9]*
 
 # ========== DEPENDENCIES FOR CLEANUP ==========
 
--- zsh-3.1.6.orig/Src/Makefile.in
+++ zsh-3.1.6/Src/Makefile.in
@@ -159,28 +159,28 @@
 
 # install binary, creating install directory if necessary
 install.bin-here: zsh install.bin-@L@
-	$(sdir_top)/mkinstalldirs $(bindir)
-	$(INSTALL_PROGRAM) $(STRIPFLAGS) zsh $(bindir)/zsh-$(VERSION)
-	if test -f $(bindir)/zsh; then \
-	    rm -f $(bindir)/zsh.old; \
-	    ln $(bindir)/zsh $(bindir)/zsh.old; \
+	$(sdir_top)/mkinstalldirs $(DESTDIR)$(bindir)
+	$(INSTALL_PROGRAM) $(STRIPFLAGS) zsh $(DESTDIR)$(bindir)/zsh-$(VERSION)
+	if test -f $(DESTDIR)$(bindir)/zsh; then \
+	    rm -f $(DESTDIR)$(bindir)/zsh.old; \
+	    ln $(DESTDIR)$(bindir)/zsh $(DESTDIR)$(bindir)/zsh.old; \
 	else :; fi
-	rm -f $(bindir)/zsh.new
-	ln $(bindir)/zsh-$(VERSION) $(bindir)/zsh.new
-	mv $(bindir)/zsh.new $(bindir)/zsh
+	rm -f $(DESTDIR)$(bindir)/zsh.new
+	ln $(DESTDIR)$(bindir)/zsh-$(VERSION) $(DESTDIR)$(bindir)/zsh.new
+	mv $(DESTDIR)$(bindir)/zsh.new $(DESTDIR)$(bindir)/zsh
 
 install.bin-N:
 install.bin-L: $(LIBZSH)
-	$(sdir_top)/mkinstalldirs $(libdir)/zsh
-	$(INSTALL_PROGRAM) $(LIBZSH) $(libdir)/zsh/$(LIBZSH)
+	$(sdir_top)/mkinstalldirs $(DESTDIR)$(libdir)/zsh
+	$(INSTALL_PROGRAM) $(LIBZSH) $(DESTDIR)$(libdir)/zsh/$(LIBZSH)
 
 # uninstall binary
 uninstall.bin-here: uninstall.bin-@L@
-	rm -f $(bindir)/zsh-$(VERSION) $(bindir)/zsh
+	rm -f $(DESTDIR)$(bindir)/zsh-$(VERSION) $(bindir)/zsh
 
 uninstall.bin-N:
 uninstall.bin-L:
-	rm -f $(libdir)/zsh/$(LIBZSH)
+	rm -f $(DESTDIR)$(libdir)/zsh/$(LIBZSH)
 
 # ========== DEPENDENCIES FOR CLEANUP ==========
 
--- zsh-3.1.6.orig/Src/Makemod.in.in
+++ zsh-3.1.6/Src/Makemod.in.in
@@ -127,15 +127,15 @@
 
 install.modules-here:
 	modules='$(MODULES)'; \
-	if test -n "$$modules"; then $(sdir_top)/mkinstalldirs $(MODDIR); fi; \
+	if test -n "$$modules"; then $(sdir_top)/mkinstalldirs $(DESTDIR)$(MODDIR); fi; \
 	for mod in $$modules; do \
-	    $(INSTALL_PROGRAM) $$mod $(MODDIR)/$$mod; \
+	    $(INSTALL_PROGRAM) $$mod $(DESTDIR)$(MODDIR)/$$mod; \
 	done
 
 uninstall.modules-here:
 	modules='$(MODULES)'; for mod in $$modules; do \
-	    if test -f $(MODDIR)/$$mod; then \
-		rm -f $(MODDIR)/$$mod; \
+	    if test -f $(DESTDIR)$(MODDIR)/$$mod; then \
+		rm -f $(DESTDIR)$(MODDIR)/$$mod; \
 	    else :; fi; \
 	done


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: add DESTDIR functionality to install
  1999-08-21  2:39 PATCH: add DESTDIR functionality to install Clint Adams
@ 1999-08-27 15:39 ` Bart Schaefer
  1999-08-30 12:28 ` Peter Stephenson
  1 sibling, 0 replies; 5+ messages in thread
From: Bart Schaefer @ 1999-08-27 15:39 UTC (permalink / raw)
  To: zsh-workers

On Aug 20, 10:39pm, Clint Adams wrote:
} Subject: PATCH: add DESTDIR functionality to install
}
} This enables use of the DESTDIR variable which greatly facilitates
} the installation of zsh in an alternate location without unwanted
} behavior that can result from changing $(prefix).

I had problems applying the Src/Makefile.in hunk of this patch because
my copy uses $(LN) rather than an explicit "ln" command.  Which turned
out to be fortunate, as I discovered a bug in "make uninsall.bin-here":

} --- zsh-3.1.6.orig/Src/Makefile.in
} +++ zsh-3.1.6/Src/Makefile.in
}  # uninstall binary
}  uninstall.bin-here: uninstall.bin-@L@
} -	rm -f $(bindir)/zsh-$(VERSION) $(bindir)/zsh
} +	rm -f $(DESTDIR)$(bindir)/zsh-$(VERSION) $(bindir)/zsh
                                                ^^^^^^^^^^^^^^

Here is a corrected patch, which should be applied to Src/Makefile.in *in
place of* 7459.

Index: Src/Makefile.in
===================================================================
@@ -160,28 +160,28 @@
 
 # install binary, creating install directory if necessary
 install.bin-here: zsh install.bin-@L@
-	$(sdir_top)/mkinstalldirs $(bindir)
-	$(INSTALL_PROGRAM) $(STRIPFLAGS) zsh $(bindir)/zsh-$(VERSION)
-	if test -f $(bindir)/zsh; then \
-	    rm -f $(bindir)/zsh.old; \
-	    $(LN) $(bindir)/zsh $(bindir)/zsh.old; \
+	$(sdir_top)/mkinstalldirs $(DESTDIR)$(bindir)
+	$(INSTALL_PROGRAM) $(STRIPFLAGS) zsh $(DESTDIR)$(bindir)/zsh-$(VERSION)
+	if test -f $(DESTDIR)$(bindir)/zsh; then \
+	    rm -f $(DESTDIR)$(bindir)/zsh.old; \
+	    $(LN) $(DESTDIR)$(bindir)/zsh $(DESTDIR)$(bindir)/zsh.old; \
 	else :; fi
-	rm -f $(bindir)/zsh.new
-	$(LN) $(bindir)/zsh-$(VERSION) $(bindir)/zsh.new
-	mv $(bindir)/zsh.new $(bindir)/zsh
+	rm -f $(DESTDIR)$(bindir)/zsh.new
+	$(LN) $(DESTDIR)$(bindir)/zsh-$(VERSION) $(DESTDIR)$(bindir)/zsh.new
+	mv $(DESTDIR)$(bindir)/zsh.new $(DESTDIR)$(bindir)/zsh
 
 install.bin-N:
 install.bin-L: $(LIBZSH)
-	$(sdir_top)/mkinstalldirs $(libdir)/zsh
-	$(INSTALL_PROGRAM) $(LIBZSH) $(libdir)/zsh/$(LIBZSH)
+	$(sdir_top)/mkinstalldirs $(DESTDIR)$(libdir)/zsh
+	$(INSTALL_PROGRAM) $(LIBZSH) $(DESTDIR)$(libdir)/zsh/$(LIBZSH)
 
 # uninstall binary
 uninstall.bin-here: uninstall.bin-@L@
-	rm -f $(bindir)/zsh-$(VERSION) $(bindir)/zsh
+	rm -f $(DESTDIR)$(bindir)/zsh-$(VERSION) $(DESTDIR)$(bindir)/zsh
 
 uninstall.bin-N:
 uninstall.bin-L:
-	rm -f $(libdir)/zsh/$(LIBZSH)
+	rm -f $(DESTDIR)$(libdir)/zsh/$(LIBZSH)
 
 # ========== DEPENDENCIES FOR CLEANUP ==========
 

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: add DESTDIR functionality to install
  1999-08-21  2:39 PATCH: add DESTDIR functionality to install Clint Adams
  1999-08-27 15:39 ` Bart Schaefer
@ 1999-08-30 12:28 ` Peter Stephenson
  1999-08-30 15:31   ` Bart Schaefer
  1999-08-31  7:21   ` Andrej Borsenkow
  1 sibling, 2 replies; 5+ messages in thread
From: Peter Stephenson @ 1999-08-30 12:28 UTC (permalink / raw)
  To: zsh-workers

Clint Adams wrote:
> This enables use of the DESTDIR variable which greatly facilitates
> the installation of zsh in an alternate location without unwanted
> behavior that can result from changing $(prefix).
> 
> e.g. make install DESTDIR=/tmp/test-chroot

I've applied this, but it doesn't look like it changes any of the internal
variables, particularly module_path, that need to know where to find things
(and install time is too late for that), so it's not clear to my how useful
it actually is.

Now I'm only 1/2 million patches behind.

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: add DESTDIR functionality to install
  1999-08-30 12:28 ` Peter Stephenson
@ 1999-08-30 15:31   ` Bart Schaefer
  1999-08-31  7:21   ` Andrej Borsenkow
  1 sibling, 0 replies; 5+ messages in thread
From: Bart Schaefer @ 1999-08-30 15:31 UTC (permalink / raw)
  To: zsh-workers

On Aug 30,  2:28pm, Peter Stephenson wrote:
} Subject: Re: PATCH: add DESTDIR functionality to install
}
} Clint Adams wrote:
} > e.g. make install DESTDIR=/tmp/test-chroot
} 
} I've applied this, but it doesn't look like it changes any of the internal
} variables, particularly module_path, that need to know where to find things
} (and install time is too late for that), so it's not clear to my how useful
} it actually is.

This is quite useful in a couple of cases:

(1) Installing for package manager utilities like "rpm" and "stow", which
want an image of the actual install tree in another location but need the
real path names in the internal values because they will later re-copy or
link the files into the true $(prefix) locations.

(2) Installing onto an NFS server where the path on the server is not the
same as where it will be mounted on the clients, and the internal values
need to reflect the client locations.

(3) Installing into a mirror filesystem to which a "chroot" will be done.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: PATCH: add DESTDIR functionality to install
  1999-08-30 12:28 ` Peter Stephenson
  1999-08-30 15:31   ` Bart Schaefer
@ 1999-08-31  7:21   ` Andrej Borsenkow
  1 sibling, 0 replies; 5+ messages in thread
From: Andrej Borsenkow @ 1999-08-31  7:21 UTC (permalink / raw)
  To: Peter Stephenson, zsh-workers

>
> I've applied this, but it doesn't look like it changes any of the internal
> variables, particularly module_path, that need to know where to find things
> (and install time is too late for that), so it's not clear to my how useful
> it actually is.
>

The main usage (IMHO) would be for package build. E.g. with SVR4 (a.k.a. Solaris
:-) package system you could build a package out of files in current directory.
In this case the ability to have image of actual installation tree is really
useful.

/andrej


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1999-08-31  9:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-08-21  2:39 PATCH: add DESTDIR functionality to install Clint Adams
1999-08-27 15:39 ` Bart Schaefer
1999-08-30 12:28 ` Peter Stephenson
1999-08-30 15:31   ` Bart Schaefer
1999-08-31  7:21   ` Andrej Borsenkow

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).