Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: add DESTDIR functionality to install



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



Messages sorted by: Reverse Date, Date, Thread, Author