--- Makefile.orig	2009-01-15 12:31:45.000000000 -0800
+++ Makefile	2009-01-15 12:32:16.000000000 -0800
@@ -1,6 +1,6 @@
 # Makefile for autobench scripts
 VERSION = 2.1.2
-PREFIX = /usr/local
+PREFIX = __PREFIX__
 
 # Automatically set correct paths for building Debian packages
 ifdef DEB_BUILD_ARCH
@@ -10,7 +10,7 @@
 endif
 
 BINDIR = $(PREFIX)$(ROOTBIN_PREFIX)/bin
-MANDIR = $(PREFIX)$(ROOTMAN_PREFIX)/man/man1
+MANDIR = $(PREFIX)$(ROOTMAN_PREFIX)/share/man/man1
 ETCDIR = $(PREFIX)/etc
 
 ifdef DEB_BUILD_ARCH
@@ -51,11 +51,11 @@
 	$(CC) $(DEBUG_FLAGS) -o crfile crfile.c
 
 install: crfile sesslog
-	mkdir -p $(BINDIR) $(ETCDIR) $(MANDIR)
+	mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(ETCDIR) $(DESTDIR)$(MANDIR)
 	perl -pi -e 's/my \$$MASTER_CONFIG =.*$$/my \$$MASTER_CONFIG = "$$ENV{AB_CFG}";/' autobench
-	cp crfile autobench autobenchd autobench_admin sesslog bench2graph $(BINDIR)
-	cp autobenchd.1 autobench_admin.1 crfile.1 autobench.1 sesslog.1 bench2graph.1 $(MANDIR)
-	cp autobench.conf $(ETCDIR)
+	cp crfile autobench autobenchd autobench_admin sesslog bench2graph $(DESTDIR)$(BINDIR)
+	cp autobenchd.1 autobench_admin.1 crfile.1 autobench.1 sesslog.1 bench2graph.1 $(DESTDIR)$(MANDIR)
+	cp autobench.conf $(DESTDIR)$(ETCDIR)
 
 clean: 
 	rm -f crfile sesslog
