diff -Nup -r atheme-0.2.2/backend/Makefile.in atheme-0.2.2.patched/backend/Makefile.in
--- atheme-0.2.2/backend/Makefile.in	2005-09-03 21:17:28.000000000 +0000
+++ atheme-0.2.2.patched/backend/Makefile.in	2005-09-04 04:15:55.000000000 +0000
@@ -6,6 +6,8 @@
 # $Id: makefile-DESTDIR-support.patch,v 1.1 2005/09/04 06:08:56 beu Exp $
 #
 
+DESTDIR := 
+
 CC		= @CC@
 RM		= @RM@
 MV		= @MV@
@@ -36,8 +38,8 @@ all: protocols
 build: all
 
 install: build
-	${INSTALL} -d ${PREFIX}/backend
-	${INSTALL} -m 755 *.so ${PREFIX}/backend
+	${INSTALL} -d $(DESTDIR)${PREFIX}/backend
+	${INSTALL} -m 755 *.so $(DESTDIR)${PREFIX}/backend
 
 protocols: $(OBJS)
 
diff -Nup -r atheme-0.2.2/contrib/Makefile.in atheme-0.2.2.patched/contrib/Makefile.in
--- atheme-0.2.2/contrib/Makefile.in	2005-09-03 21:17:29.000000000 +0000
+++ atheme-0.2.2.patched/contrib/Makefile.in	2005-09-04 04:15:55.000000000 +0000
@@ -6,6 +6,8 @@
 # $Id: makefile-DESTDIR-support.patch,v 1.1 2005/09/04 06:08:56 beu Exp $
 #
 
+DESTDIR := 
+
 CC		= @CC@
 RM		= @RM@
 MV		= @MV@
@@ -38,8 +40,8 @@ all: protocols
 build: all
 
 install: build
-	${INSTALL} -d ${PREFIX}/contrib
-	${INSTALL} -m 755 *.so ${PREFIX}/contrib
+	${INSTALL} -d $(DESTDIR)${PREFIX}/contrib
+	${INSTALL} -m 755 *.so $(DESTDIR)${PREFIX}/contrib
 
 protocols: $(OBJS)
 
diff -Nup -r atheme-0.2.2/modules/Makefile.in atheme-0.2.2.patched/modules/Makefile.in
--- atheme-0.2.2/modules/Makefile.in	2005-09-03 21:17:30.000000000 +0000
+++ atheme-0.2.2.patched/modules/Makefile.in	2005-09-04 04:15:55.000000000 +0000
@@ -6,6 +6,8 @@
 # $Id: makefile-DESTDIR-support.patch,v 1.1 2005/09/04 06:08:56 beu Exp $
 #
 
+DESTDIR := 
+
 CC		= @CC@
 RM		= @RM@
 MV		= @MV@
@@ -36,8 +38,8 @@ all: modules
 build: all
 
 install: build
-	${INSTALL} -d ${PREFIX}/modules
-	${INSTALL} -m 755 *.so ${PREFIX}/modules
+	${INSTALL} -d $(DESTDIR)${PREFIX}/modules
+	${INSTALL} -m 755 *.so $(DESTDIR)${PREFIX}/modules
 
 modules: $(OBJS)
 
diff -Nup -r atheme-0.2.2/protocol/Makefile.in atheme-0.2.2.patched/protocol/Makefile.in
--- atheme-0.2.2/protocol/Makefile.in	2005-09-03 21:17:29.000000000 +0000
+++ atheme-0.2.2.patched/protocol/Makefile.in	2005-09-04 04:15:55.000000000 +0000
@@ -6,6 +6,8 @@
 # $Id: makefile-DESTDIR-support.patch,v 1.1 2005/09/04 06:08:56 beu Exp $
 #
 
+DESTDIR := 
+
 CC		= @CC@
 RM		= @RM@
 MV		= @MV@
@@ -49,8 +51,8 @@ all: protocols
 build: all
 
 install: build
-	${INSTALL} -d ${PREFIX}/protocol
-	${INSTALL} -m 755 *.so ${PREFIX}/protocol
+	${INSTALL} -d $(DESTDIR)${PREFIX}/protocol
+	${INSTALL} -m 755 *.so $(DESTDIR)${PREFIX}/protocol
 
 protocols: $(OBJS)
 
diff -Nup -r atheme-0.2.2/src/Makefile.in atheme-0.2.2.patched/src/Makefile.in
--- atheme-0.2.2/src/Makefile.in	2005-09-03 21:17:29.000000000 +0000
+++ atheme-0.2.2.patched/src/Makefile.in	2005-09-04 04:15:55.000000000 +0000
@@ -6,6 +6,8 @@
 # $Id: makefile-DESTDIR-support.patch,v 1.1 2005/09/04 06:08:56 beu Exp $
 #
 
+DESTDIR := 
+
 CC		= @CC@
 RM		= @RM@
 MV		= @MV@
@@ -70,27 +72,27 @@ atheme: $(OBJS)
 	$(MV) version.c version.c.last
 
 install: build
-	$(INSTALL) -m 755 -d $(PREFIX)
-	$(INSTALL) -m 755 -d $(PREFIX)/bin
-	$(INSTALL) -m 755 -d $(PREFIX)/etc
-	$(INSTALL) -m 755 -d $(PREFIX)/var
-	$(INSTALL) -m 755 -c $(BIN) $(PREFIX)/bin
-	$(INSTALL) -m 640 -c ../dist/example.conf $(PREFIX)/etc
-	$(INSTALL) -m 640 -c ../dist/example-traditional.conf $(PREFIX)/etc
+	$(INSTALL) -m 755 -d $(DESTDIR)$(PREFIX)
+	$(INSTALL) -m 755 -d $(DESTDIR)$(PREFIX)/bin
+	$(INSTALL) -m 755 -d $(DESTDIR)$(PREFIX)/etc
+	$(INSTALL) -m 755 -d $(DESTDIR)$(PREFIX)/var
+	$(INSTALL) -m 755 -c $(BIN) $(DESTDIR)$(PREFIX)/bin
+	$(INSTALL) -m 640 -c ../dist/example.conf $(DESTDIR)$(PREFIX)/etc
+	$(INSTALL) -m 640 -c ../dist/example-traditional.conf $(DESTDIR)$(PREFIX)/etc
 	if [ ! -r $(PREFIX)/etc/atheme.db ]; then \
-		$(INSTALL) -m 640 -c ../dist/atheme.db $(PREFIX)/etc ; \
+		$(INSTALL) -m 640 -c ../dist/atheme.db $(DESTDIR)$(PREFIX)/etc ; \
 	fi
 	if [ ! -r $(PREFIX)/etc/atheme.chk ]; then \
-		$(INSTALL) -m 640 -c ../dist/atheme.chk $(PREFIX)/etc ; \
+		$(INSTALL) -m 640 -c ../dist/atheme.chk $(DESTDIR)$(PREFIX)/etc ; \
 	fi
 	if [ -e $(PREFIX)/doc ]; then \
-		$(RM) -rf $(PREFIX)/doc ; \
+		$(RM) -rf $(DESTDIR)$(PREFIX)/doc ; \
 	fi
 	if [ -e $(PREFIX)/help ]; then \
-		$(RM) -rf $(PREFIX)/help ; \
+		$(RM) -rf $(DESTDIR)$(PREFIX)/help ; \
 	fi
-	$(CP) -R ../doc $(PREFIX)
-	$(CP) -R ../help $(PREFIX)
+	$(CP) -R ../doc $(DESTDIR)$(PREFIX)
+	$(CP) -R ../help $(DESTDIR)$(PREFIX)
 
 	@echo "----------------------------------------------------------------"
 	@echo ">>> Remember to cd to ${PREFIX} and edit your config file.";