--- elvis-2.2_0/Makefile.orig	2004-03-17 16:01:54.000000000 -0500
+++ elvis-2.2_0/Makefile	2004-03-17 16:31:57.000000000 -0500
@@ -79,14 +79,14 @@
 
 ################################################################################
 # This is the directory where "make install" will place the executable programs
-BINDIR=/usr/bin
+BINDIR=$(DESTDIR)/usr/bin
 
 ################################################################################
 # This is the directory where "make install" will place elvis' support files,
 # such as the help text and the default initialization scripts.  If you change
 # the value here, then you also need to change it in "config.h"
-DATADIR=/usr/share/elvis-2.2_0
-DOCDIR=$(PREFIX)/share/elvis/doc/
+DATADIR=$(DESTDIR)/usr/share/elvis-2.2_0
+DOCDIR=$(DESTDIR)$(PREFIX)/share/elvis/doc/
 
 ################################################################################
 # This is the shell command for copying one file to another
@@ -368,7 +368,7 @@
 	for i in doc/*.man; do sed 's/Elvis 2\.[0-9x][0-9a-z-]*/Elvis $(VERSION)/' $$i >bin-win32/$$i; done
 	sed 's/$$//' <doc/printdoc.bat >bin-win32/doc/printdoc.bat
 	sed 's/$$//' <doc/license.html >bin-win32/doc/license.html
-	sed 's/$$//' </usr/share/dict/words >bin-win32/data/words
+	sed 's/$$//' <$(DESTIDR)/usr/share/dict/words >bin-win32/data/words
 	(cd bin-win32/data/icons; xpm2ico *.xpm)
 	(cd bin-win32; tar czf ../$(DISTRIB)-win32.tar.gz *)
 
@@ -420,7 +420,7 @@
 
 install.unix: $(ALL) doc/elvtags.man
 	rm -f doc/*.bak
-	[ -d $(BINDIR) ] || mkdir $(BINDIR)
+	[ -d $(BINDIR) ] || mkdir -p $(BINDIR)
 	cp $(ALL) $(BINDIR)
 	(cd $(BINDIR); chmod 0755 $(ALL))
 	rm -rf $(DATADIR)
@@ -440,23 +440,23 @@
 	(cd doc; for i in *.man; do sed 's/Elvis 2\.[0-9x][0-9a-z-]*/Elvis $(VERSION)/' $$i >$(DOCDIR)/$$i; done)
 	-(cd $(DATADIR); $(BINDIR)/elvtags -gitv stubs/*.c || ctags stubs/*.c)
 	chmod 0755 $(DATADIR)/*/. $(DATADIR) $(DOCDIR)
-	sh instman.sh -p$(PREFIX) $(ALL)
-	-[ -d /etc/elvis ] || mkdir /etc/elvis
-	-chmod 0755 /etc/elvis/
-	-@ : >/etc/elvis/README && ( \
+	export MANPATH=$(DESTDIR)/usr/man:$(MANPATH) && sh instman.sh -p$(DESTDIR)$(PREFIX) $(ALL)
+	-[ -d $(DESTDIR)/etc/elvis ] || mkdir -p $(DESTDIR)/etc/elvis
+	-chmod 0755 $(DESTDIR)/etc/elvis/
+	-@ : >$(DESTDIR)/etc/elvis/README && ( \
 	  echo "This directory contains system-dependent versions of elvis' configuration" \
 	  echo "files.  The standard versions are available in $(DATADIR)"  \
 	  echo "To customize any of these configuration files for this system,"  \
-	  echo "first copy the standard version of the file into /etc/elvis and" \
+	  echo "first copy the standard version of the file into $(DESTIDR)/etc/elvis and" \
 	  echo "then edit the copy.  Leave the standard version unchanged." \
-	) >>/etc/elvis/README
-	-chmod 0644 /etc/elvis/README
+	) >>$(DESTIDR)/etc/elvis/README
+	-chmod 0644 $(DESTDIR)/etc/elvis/README
 	@echo "This directory contains the standard versions of elvis' configuration" >$(DATADIR)/README
 	@echo "files.  DO NOT MODIFY THESE FILES!  To perform host-specific customization," >>$(DATADIR)/README
-	@echo "copy files from this directory into /etc/elvis/, and then modify the copies." >>$(DATADIR)/README
+	@echo "copy files from this directory into $(DESTIDR)/etc/elvis/, and then modify the copies." >>$(DATADIR)/README
 	@echo "To make user-specific changes, create a ~/.elvis/ directory (if it doesn't" >>$(DATADIR)/README
 	@echo "exist already) and copy files from this directory into ~/.elvis/ and then" >>$(DATADIR)/README
-	@echo "modify the copies.  Any file that elvis finds in ~/.elvis/ or /etc/elvis/" >>$(DATADIR)/README
+	@echo "modify the copies.  Any file that elvis finds in ~/.elvis/ or $(DESTIDR)/etc/elvis/" >>$(DATADIR)/README
 	@echo "overrides the similarly named file in this directory." >>$(DATADIR)/README
 	chmod 0644 $(DATADIR)/README
 
@@ -469,7 +469,7 @@
 	(cd $(BINDIR); $(RM) $(ALL))
 	rm -rf $(DATADIR)
 	rm -rf $(DOCDIR)
-	sh instman.sh -r -p$(PREFIX) $(ALL)
+	sh instman.sh -r -p$(DESTDIR)$(PREFIX) $(ALL)
 
 ###############################################################################
 
