From 960171aa995ba9a28a5c49a383750d43281cbc4f Mon Sep 17 00:00:00 2001
From: jlam <jlam@pkgsrc.org>
Date: Mon, 3 Mar 2008 01:50:26 +0000
Subject: Mechanical changes to add full DESTDIR support to packages that
 install their files via a custom do-install target.

---
 chat/bitchbot/Makefile      | 12 ++++----
 chat/bitlbee/Makefile       | 26 ++++++++++--------
 chat/bnc/Makefile           | 20 ++++++++------
 chat/cgiirc/Makefile        | 67 ++++++++++++++++++++++++---------------------
 chat/eggdrop/Makefile       | 48 +++++++++++++++++---------------
 chat/epic4-doc/Makefile     | 14 ++++++----
 chat/gaim-icb/Makefile      | 12 ++++----
 chat/goofey/Makefile        |  8 ++++--
 chat/i2cb/Makefile          | 15 ++++++----
 chat/icbirc/Makefile        |  8 ++++--
 chat/iip/Makefile           | 16 +++++++----
 chat/ircu/Makefile          | 28 ++++++++++---------
 chat/iroffer/Makefile       | 20 ++++++++------
 chat/jabberd/Makefile       | 28 ++++++++++---------
 chat/mu-conference/Makefile |  8 ++++--
 chat/pircbot/Makefile       | 12 ++++----
 chat/roxirc/Makefile        | 21 +++++++-------
 chat/tik/Makefile           | 28 ++++++++++---------
 chat/tkicb/Makefile         | 21 ++++++++------
 chat/tkirc/Makefile         | 16 ++++++-----
 chat/tkirc2/Makefile        | 21 +++++++-------
 chat/unrealircd/Makefile    | 48 ++++++++++++++++++--------------
 chat/zenicb/Makefile        |  8 ++++--
 chat/zephyr-mode/Makefile   |  8 ++++--
 24 files changed, 287 insertions(+), 226 deletions(-)

(limited to 'chat')

diff --git a/chat/bitchbot/Makefile b/chat/bitchbot/Makefile
index f6e992be4e6..12171553cbc 100644
--- a/chat/bitchbot/Makefile
+++ b/chat/bitchbot/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2007/02/22 19:26:10 wiz Exp $
+# $NetBSD: Makefile,v 1.6 2008/03/03 02:19:51 jlam Exp $
 
 DISTNAME=	bitchbot-1.0.2
 CATEGORIES=	chat
@@ -9,6 +9,7 @@ HOMEPAGE=	http://www.r1ch.net/projects/bitchbot/
 COMMENT=	Bitchbot is a perl-based IRC bot
 
 PKG_INSTALLATION_TYPES=	overwrite pkgviews
+PKG_DESTDIR_SUPPORT=	user-destdir
 
 USE_TOOLS+=	perl:run
 
@@ -24,11 +25,10 @@ do-build:
 		< ${WRKSRC}/bitch.pl > ${WRKSRC}/bitch;
 
 do-install:
-	${INSTALL_DATA_DIR} ${PREFIX}/share/examples/bitch
-
-	${INSTALL_SCRIPT} ${WRKSRC}/bitch ${PREFIX}/bin
-	${INSTALL_SCRIPT} ${WRKSRC}/genstats.pl ${PREFIX}/bin/genstats
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/examples/bitch
+	${INSTALL_SCRIPT} ${WRKSRC}/bitch ${DESTDIR}${PREFIX}/bin
+	${INSTALL_SCRIPT} ${WRKSRC}/genstats.pl ${DESTDIR}${PREFIX}/bin/genstats
 	${INSTALL_DATA}	${WRKSRC}/bitch.conf.template \
-		${PREFIX}/share/examples/bitch
+		${DESTDIR}${PREFIX}/share/examples/bitch
 
 .include "../../mk/bsd.pkg.mk"
diff --git a/chat/bitlbee/Makefile b/chat/bitlbee/Makefile
index 44268d08cae..41b46ace540 100644
--- a/chat/bitlbee/Makefile
+++ b/chat/bitlbee/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.38 2008/01/18 05:06:22 tnn Exp $
+# $NetBSD: Makefile,v 1.39 2008/03/03 02:19:51 jlam Exp $
 #
 
 DISTNAME=		bitlbee-1.0.4
@@ -10,6 +10,8 @@ MAINTAINER=		tonio@NetBSD.org
 HOMEPAGE=		http://www.bitlbee.org/
 COMMENT=		IRC to other chat networks gateway
 
+PKG_DESTDIR_SUPPORT=	user-destdir
+
 HAS_CONFIGURE=		yes
 USE_TOOLS+=		gmake pkg-config
 
@@ -38,17 +40,19 @@ PKG_HOME.bitlbee=	${VARBASE}/db/bitlbee
 INSTALLATION_DIRS=	${PKGMANDIR}/man5 ${PKGMANDIR}/man8 sbin
 
 do-install:
-	${INSTALL_DATA_DIR} ${DATADIR}
-	${INSTALL_DATA_DIR} ${DOCDIR}
-	${INSTALL_DATA_DIR} ${EGDIR}
-	${INSTALL_DATA} ${WRKSRC}/bitlbee.conf ${EGDIR}
-	${INSTALL_PROGRAM} ${WRKSRC}/bitlbee ${PREFIX}/sbin
-	${INSTALL_DATA} ${WRKSRC}/doc/user-guide/help.txt ${DATADIR}
-	${INSTALL_DATA} ${WRKSRC}/motd.txt ${DATADIR}
-	${INSTALL_MAN} ${WRKSRC}/doc/bitlbee.8 ${PREFIX}/${PKGMANDIR}/man8
-	${INSTALL_MAN} ${WRKSRC}/doc/bitlbee.conf.5 ${PREFIX}/${PKGMANDIR}/man5
+	${INSTALL_DATA_DIR} ${DESTDIR}${DATADIR}
+	${INSTALL_DATA_DIR} ${DESTDIR}${DOCDIR}
+	${INSTALL_DATA_DIR} ${DESTDIR}${EGDIR}
+	${INSTALL_DATA} ${WRKSRC}/bitlbee.conf ${DESTDIR}${EGDIR}
+	${INSTALL_PROGRAM} ${WRKSRC}/bitlbee ${DESTDIR}${PREFIX}/sbin
+	${INSTALL_DATA} ${WRKSRC}/doc/user-guide/help.txt ${DESTDIR}${DATADIR}
+	${INSTALL_DATA} ${WRKSRC}/motd.txt ${DESTDIR}${DATADIR}
+	${INSTALL_MAN} ${WRKSRC}/doc/bitlbee.8 \
+		${DESTDIR}${PREFIX}/${PKGMANDIR}/man8
+	${INSTALL_MAN} ${WRKSRC}/doc/bitlbee.conf.5 \
+		${DESTDIR}${PREFIX}/${PKGMANDIR}/man5
 .for f in AUTHORS FAQ README CREDITS user-guide/user-guide.txt user-guide/user-guide.html
-	${INSTALL_DATA} ${WRKSRC}/doc/${f} ${DOCDIR}
+	${INSTALL_DATA} ${WRKSRC}/doc/${f} ${DESTDIR}${DOCDIR}
 .endfor
 
 PKG_OPTIONS_VAR=	PKG_OPTIONS.bitlbee
diff --git a/chat/bnc/Makefile b/chat/bnc/Makefile
index a790c808ad5..26db6d38ab1 100644
--- a/chat/bnc/Makefile
+++ b/chat/bnc/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2008/01/18 05:06:22 tnn Exp $
+# $NetBSD: Makefile,v 1.16 2008/03/03 02:19:51 jlam Exp $
 
 DISTNAME=	bnc2.9.4
 PKGNAME=	${DISTNAME:S/bnc/&-/}
@@ -13,6 +13,8 @@ COMMENT=	Simple IRC relay proxy with support for virtual hosting
 
 DEPENDS+=	dialog-[0-9]*:../../misc/dialog
 
+PKG_DESTDIR_SUPPORT=	user-destdir
+
 GNU_CONFIGURE=		yes
 CONFIGURE_ARGS+=	--with-ssl
 
@@ -25,15 +27,15 @@ post-patch:
 		${WRKSRC}/bncsetup.orig > ${WRKSRC}/bncsetup
 
 do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/bnc ${PREFIX}/bin
-	${INSTALL_PROGRAM} ${WRKSRC}/mkpasswd ${PREFIX}/bin/bncmkpasswd
-	${INSTALL_SCRIPT} ${WRKSRC}/bncchk ${PREFIX}/bin
-	${INSTALL_SCRIPT} ${WRKSRC}/bncsetup ${PREFIX}/bin
-	${INSTALL_DATA_DIR} ${PREFIX}/share/examples/bnc
-	${INSTALL_DATA_DIR} ${PREFIX}/share/doc/bnc
-	${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/bnc
+	${INSTALL_PROGRAM} ${WRKSRC}/bnc ${DESTDIR}${PREFIX}/bin
+	${INSTALL_PROGRAM} ${WRKSRC}/mkpasswd ${DESTDIR}${PREFIX}/bin/bncmkpasswd
+	${INSTALL_SCRIPT} ${WRKSRC}/bncchk ${DESTDIR}${PREFIX}/bin
+	${INSTALL_SCRIPT} ${WRKSRC}/bncsetup ${DESTDIR}${PREFIX}/bin
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/examples/bnc
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/doc/bnc
+	${INSTALL_DATA} ${WRKSRC}/README ${DESTDIR}${PREFIX}/share/doc/bnc
 	${INSTALL_DATA} ${WRKSRC}/example.conf				\
-		${PREFIX}/share/examples/bnc/bnc.conf
+		${DESTDIR}${PREFIX}/share/examples/bnc/bnc.conf
 
 .include "../../security/openssl/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/chat/cgiirc/Makefile b/chat/cgiirc/Makefile
index f87f4186cbe..1f4d67e1039 100644
--- a/chat/cgiirc/Makefile
+++ b/chat/cgiirc/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.13 2007/09/07 22:12:10 jlam Exp $
+# $NetBSD: Makefile,v 1.14 2008/03/03 02:19:51 jlam Exp $
 
 DISTNAME=	cgiirc-0.5.9
 PKGREVISION=	1
@@ -9,6 +9,8 @@ MAINTAINER=	adrianp@NetBSD.org
 HOMEPAGE=	http://cgiirc.sourceforge.net/
 COMMENT=	Access IRC from a web browser
 
+PKG_DESTDIR_SUPPORT=	user-destdir
+
 USE_TOOLS+=	perl:run
 NO_BUILD=	YES
 
@@ -39,45 +41,48 @@ do-configure:
 		> ${WRKDIR}/cgiirc.conf
 
 do-install:
-	${INSTALL_DATA_DIR} ${PREFIX}/share/doc/cgiirc
-	${INSTALL_DATA_DIR} ${CGIIRC}
-	${INSTALL_DATA_DIR} ${CGIIRC}/formats
-	${INSTALL_DATA_DIR} ${CGIIRC}/images
-	${INSTALL_DATA_DIR} ${CGIIRC}/images/taras
-	${INSTALL_DATA_DIR} ${CGIIRC}/interfaces
-	${INSTALL_DATA_DIR} ${CGIIRC}/interfaces/interface-make
-	${INSTALL_DATA_DIR} ${CGIIRC}/modules
-	${INSTALL_DATA_DIR} ${CGIIRC}/modules/IRC
-	${INSTALL_DATA_DIR} ${CGIIRC}/modules/IRC/Channel
-	${INSTALL_DATA_DIR} ${PREFIX}/share/examples/cgiirc
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/doc/cgiirc
+	${INSTALL_DATA_DIR} ${DESTDIR}${CGIIRC}
+	${INSTALL_DATA_DIR} ${DESTDIR}${CGIIRC}/formats
+	${INSTALL_DATA_DIR} ${DESTDIR}${CGIIRC}/images
+	${INSTALL_DATA_DIR} ${DESTDIR}${CGIIRC}/images/taras
+	${INSTALL_DATA_DIR} ${DESTDIR}${CGIIRC}/interfaces
+	${INSTALL_DATA_DIR} ${DESTDIR}${CGIIRC}/interfaces/interface-make
+	${INSTALL_DATA_DIR} ${DESTDIR}${CGIIRC}/modules
+	${INSTALL_DATA_DIR} ${DESTDIR}${CGIIRC}/modules/IRC
+	${INSTALL_DATA_DIR} ${DESTDIR}${CGIIRC}/modules/IRC/Channel
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/examples/cgiirc
 
-	${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/cgiirc
+	${INSTALL_DATA} ${WRKSRC}/README ${DESTDIR}${PREFIX}/share/doc/cgiirc
 .	for f in ${DOCFILES}
 		${INSTALL_DATA} ${WRKSRC}/docs/${f} \
-			${PREFIX}/share/examples/cgiirc/${f}
+			${DESTDIR}${PREFIX}/share/examples/cgiirc/${f}
 .	endfor
-	${INSTALL_DATA} ${WRKSRC}/cgiirc.config ${PREFIX}/share/examples/cgiirc
-	${INSTALL_DATA} ${WRKDIR}/cgiirc.conf ${PREFIX}/share/examples/cgiirc
+	${INSTALL_DATA} ${WRKSRC}/cgiirc.config \
+		${DESTDIR}${PREFIX}/share/examples/cgiirc
+	${INSTALL_DATA} ${WRKDIR}/cgiirc.conf \
+		${DESTDIR}${PREFIX}/share/examples/cgiirc
 .	for f in ${EGFILES}
 		${INSTALL_DATA} ${WRKSRC}/${f} \
-			${PREFIX}/share/examples/cgiirc/${f}
+			${DESTDIR}${PREFIX}/share/examples/cgiirc/${f}
 .	endfor
-	${INSTALL_SCRIPT} ${WRKSRC}/*.cgi ${CGIIRC}
-	${INSTALL_DATA} ${WRKSRC}/formats/* ${CGIIRC}/formats/
-	${INSTALL_DATA} ${WRKSRC}/images/*.gif ${CGIIRC}/images/
-	${INSTALL_DATA} ${WRKSRC}/images/*.wav ${CGIIRC}/images/
-	${INSTALL_DATA} ${WRKSRC}/images/*.ico ${CGIIRC}/images/
-	${INSTALL_DATA} ${WRKSRC}/images/taras/*.gif ${CGIIRC}/images/taras
-	${INSTALL_DATA} ${WRKSRC}/interfaces/*.pm ${CGIIRC}/interfaces/
-	${INSTALL_DATA} ${WRKSRC}/interfaces/*.css ${CGIIRC}/interfaces/
+	${INSTALL_SCRIPT} ${WRKSRC}/*.cgi ${DESTDIR}${CGIIRC}
+	${INSTALL_DATA} ${WRKSRC}/formats/* ${DESTDIR}${CGIIRC}/formats/
+	${INSTALL_DATA} ${WRKSRC}/images/*.gif ${DESTDIR}${CGIIRC}/images/
+	${INSTALL_DATA} ${WRKSRC}/images/*.wav ${DESTDIR}${CGIIRC}/images/
+	${INSTALL_DATA} ${WRKSRC}/images/*.ico ${DESTDIR}${CGIIRC}/images/
+	${INSTALL_DATA} ${WRKSRC}/images/taras/*.gif \
+		${DESTDIR}${CGIIRC}/images/taras
+	${INSTALL_DATA} ${WRKSRC}/interfaces/*.pm ${DESTDIR}${CGIIRC}/interfaces/
+	${INSTALL_DATA} ${WRKSRC}/interfaces/*.css ${DESTDIR}${CGIIRC}/interfaces/
 	${INSTALL_DATA} ${WRKSRC}/interfaces/interface-make/*.pm \
-		${CGIIRC}/interfaces/interface-make/
+		${DESTDIR}${CGIIRC}/interfaces/interface-make/
 	${INSTALL_SCRIPT} ${WRKSRC}/interfaces/interface-make/*.pl \
-		${CGIIRC}/interfaces/interface-make/
-	${INSTALL_DATA} ${WRKSRC}/modules/*.pm ${CGIIRC}/modules/
-	${INSTALL_SCRIPT} ${WRKSRC}/modules/*.pl ${CGIIRC}/modules/
-	${INSTALL_DATA} ${WRKSRC}/modules/IRC/*.pm ${CGIIRC}/modules/IRC/
+		${DESTDIR}${CGIIRC}/interfaces/interface-make/
+	${INSTALL_DATA} ${WRKSRC}/modules/*.pm ${DESTDIR}${CGIIRC}/modules/
+	${INSTALL_SCRIPT} ${WRKSRC}/modules/*.pl ${DESTDIR}${CGIIRC}/modules/
+	${INSTALL_DATA} ${WRKSRC}/modules/IRC/*.pm ${DESTDIR}${CGIIRC}/modules/IRC/
 	${INSTALL_DATA} ${WRKSRC}/modules/IRC/Channel/*.pm \
-		${CGIIRC}/modules/IRC/Channel/
+		${DESTDIR}${CGIIRC}/modules/IRC/Channel/
 
 .include "../../mk/bsd.pkg.mk"
diff --git a/chat/eggdrop/Makefile b/chat/eggdrop/Makefile
index acedb0774c8..2267ed6109e 100644
--- a/chat/eggdrop/Makefile
+++ b/chat/eggdrop/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.28 2007/10/18 09:15:33 obache Exp $
+# $NetBSD: Makefile,v 1.29 2008/03/03 02:19:51 jlam Exp $
 
 DISTNAME=	eggdrop1.6.18
 PKGNAME=	eggdrop-1.6.18
@@ -10,6 +10,8 @@ MAINTAINER=	pkgsrc-users@NetBSD.org
 HOMEPAGE=	http://www.eggheads.org/
 COMMENT=	IRC robot with TCL scripting and multi-channel ability
 
+PKG_DESTDIR_SUPPORT=	user-destdir
+
 GNU_CONFIGURE=		yes
 CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR:Q}
 CONFIGURE_ENV+=		TCLLIB="${PREFIX}/lib" TCLINC="${PREFIX}/include"
@@ -28,31 +30,33 @@ post-configure:
 
 do-install: do-install-program
 do-install-program:
-	${INSTALL_PROGRAM} ${WRKSRC}/eggdrop ${PREFIX}/bin/
-	${INSTALL_MAN} ${WRKSRC}/doc/man1/eggdrop.1 ${PREFIX}/${PKGMANDIR}/man1/
-	${INSTALL_DATA_DIR} ${EGDIR}
-	${INSTALL_DATA} ${WRKSRC}/eggdrop.conf.dist.new ${EGDIR}/eggdrop.conf
-	${INSTALL_DATA_DIR} ${PREFIX}/share/doc/eggdrop/html
+	${INSTALL_PROGRAM} ${WRKSRC}/eggdrop ${DESTDIR}${PREFIX}/bin/
+	${INSTALL_MAN} ${WRKSRC}/doc/man1/eggdrop.1 \
+		${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/
+	${INSTALL_DATA_DIR} ${DESTDIR}${EGDIR}
+	${INSTALL_DATA} ${WRKSRC}/eggdrop.conf.dist.new \
+		${DESTDIR}${EGDIR}/eggdrop.conf
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/doc/eggdrop/html
 	cd ${WRKSRC}/doc/html && ${INSTALL_DATA} *.html \
-		${PREFIX}/share/doc/eggdrop/html
-	${INSTALL_DATA_DIR} ${PREFIX}/share/doc/eggdrop
+		${DESTDIR}${PREFIX}/share/doc/eggdrop/html
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/doc/eggdrop
 	cd ${WRKSRC}/doc && ${INSTALL_DATA} BANS BOTNET FIRST-SCRIPT MODULES \
 		PARTYLINE USERS TRICKS TEXT-SUBSTITUTIONS tcl-commands.doc \
-		${PREFIX}/share/doc/eggdrop
-	${INSTALL_DATA_DIR} ${PREFIX}/share/eggdrop
-	${INSTALL_DATA_DIR} ${PREFIX}/share/eggdrop/help
-	${INSTALL_DATA_DIR} ${PREFIX}/share/eggdrop/language
-	${INSTALL_DATA_DIR} ${PREFIX}/share/eggdrop/scripts
-	${INSTALL_DATA_DIR} ${PREFIX}/share/eggdrop/help/msg
-	${INSTALL_DATA_DIR} ${PREFIX}/share/eggdrop/help/set
+		${DESTDIR}${PREFIX}/share/doc/eggdrop
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/eggdrop
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/eggdrop/help
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/eggdrop/language
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/eggdrop/scripts
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/eggdrop/help/msg
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/eggdrop/help/set
 	${INSTALL_DATA} ${WRKSRC}/language/core.*.lang \
-		${PREFIX}/share/eggdrop/language/
+		${DESTDIR}${PREFIX}/share/eggdrop/language/
 	cd ${WRKSRC}/help && ${INSTALL_DATA} cmds1.help cmds2.help core.help \
-		${PREFIX}/share/eggdrop/help/
+		${DESTDIR}${PREFIX}/share/eggdrop/help/
 	cd ${WRKSRC}/help/set && ${INSTALL_DATA} cmds1.help \
-		${PREFIX}/share/eggdrop/help/set/
+		${DESTDIR}${PREFIX}/share/eggdrop/help/set/
 	cd ${WRKSRC}/scripts && ${INSTALL_DATA} CONTENTS *.tcl autobotchk \
-		 botchk weed ${PREFIX}/share/eggdrop/scripts/
+		 botchk weed ${DESTDIR}${PREFIX}/share/eggdrop/scripts/
 
 .include "../../lang/tcl/buildlink3.mk"
 .include "../../devel/zlib/buildlink3.mk"
@@ -66,11 +70,11 @@ BUILD_TARGET=	eggdrop
 PLIST_SUBST+=	NOPIC=
 do-install: do-install-modules
 do-install-modules:
-	${INSTALL_DATA_DIR} ${PREFIX}/lib/eggdrop
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/lib/eggdrop
 	cd ${WRKSRC} && ${INSTALL_DATA} assoc.so blowfish.so channels.so \
 		compress.so console.so ctcp.so dns.so filesys.so irc.so notes.so \
 		seen.so server.so share.so transfer.so uptime.so wire.so \
-		${PREFIX}/lib/eggdrop
+		${DESTDIR}${PREFIX}/lib/eggdrop
 	cd ${WRKSRC}/src/mod && ${FIND} . -name "*.lang" -exec ${INSTALL_DATA} "{}" \
-		${PREFIX}/share/eggdrop/language ";"
+		${DESTDIR}${PREFIX}/share/eggdrop/language ";"
 .endif
diff --git a/chat/epic4-doc/Makefile b/chat/epic4-doc/Makefile
index cc0c7386ae7..a0962da166e 100644
--- a/chat/epic4-doc/Makefile
+++ b/chat/epic4-doc/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2007/12/01 23:46:04 wiz Exp $
+# $NetBSD: Makefile,v 1.8 2008/03/03 02:19:51 jlam Exp $
 #
 
 DISTNAME=	epic4-help-20050315
@@ -20,15 +20,17 @@ COMMENT=	Additional documentation for epic4 package
 
 DEPENDS+=	epic4>=2.0:../../chat/epic4
 
+PKG_DESTDIR_SUPPORT=	user-destdir
+
 NO_BUILD=	YES
 
 INSTALLATION_DIRS=	share/epic/help
 
 do-install:
-	${CP} -R ${WRKDIR}/help/* ${PREFIX}/share/epic/help
-	${RM} -r ${PREFIX}/share/epic/help/Makefile
-	${RM} -r ${PREFIX}/share/epic/help/CVS
-	${RM} -r ${PREFIX}/share/epic/help/*/CVS
-	${RM} -r ${PREFIX}/share/epic/help/*/*/CVS
+	${CP} -R ${WRKDIR}/help/* ${DESTDIR}${PREFIX}/share/epic/help
+	${RM} -r ${DESTDIR}${PREFIX}/share/epic/help/Makefile
+	${RM} -r ${DESTDIR}${PREFIX}/share/epic/help/CVS
+	${RM} -r ${DESTDIR}${PREFIX}/share/epic/help/*/CVS
+	${RM} -r ${DESTDIR}${PREFIX}/share/epic/help/*/*/CVS
 
 .include "../../mk/bsd.pkg.mk"
diff --git a/chat/gaim-icb/Makefile b/chat/gaim-icb/Makefile
index 1ce98192e0a..1b83ef1ad1f 100644
--- a/chat/gaim-icb/Makefile
+++ b/chat/gaim-icb/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2006/02/05 23:08:24 joerg Exp $
+# $NetBSD: Makefile,v 1.4 2008/03/03 02:19:51 jlam Exp $
 
 DISTNAME=	gaim-icb-20050918
 PKGREVISION=	2
@@ -9,6 +9,8 @@ MAINTAINER=	nathanw@NetBSD.org
 HOMEPAGE=	http://nic.com.pl/~alek/gaim-icb/
 COMMENT=	ICB plugin for GAIM
 
+PKG_DESTDIR_SUPPORT=	user-destdir
+
 USE_TOOLS+=	pkg-config
 
 USE_LIBTOOL=	yes
@@ -29,11 +31,11 @@ do-build:
 	cd ${WRKSRC} && ${LTLINK} ${LDFLAGS} -o libicb.la icb.lo
 
 do-install:
-	${INSTALL_LIB_DIR} ${GAIM_PLUGIN_DIR}
-	cd ${WRKSRC} && ${LTINSTALL} libicb.la ${GAIM_PLUGIN_DIR}
-	${INSTALL_DATA_DIR} ${GAIM_PIXMAPS_DIR}/status/default
+	${INSTALL_LIB_DIR} ${DESTDIR}${GAIM_PLUGIN_DIR}
+	cd ${WRKSRC} && ${LTINSTALL} libicb.la ${DESTDIR}${GAIM_PLUGIN_DIR}
+	${INSTALL_DATA_DIR} ${DESTDIR}${GAIM_PIXMAPS_DIR}/status/default
 	cd ${WRKSRC} && ${INSTALL_DATA} icb.png				\
-		${GAIM_PIXMAPS_DIR}/status/default
+		${DESTDIR}${GAIM_PIXMAPS_DIR}/status/default
 
 .include "../../chat/gaim/buildlink3.mk"
 .include "../../devel/glib2/buildlink3.mk"
diff --git a/chat/goofey/Makefile b/chat/goofey/Makefile
index a280a883cea..925821afefe 100644
--- a/chat/goofey/Makefile
+++ b/chat/goofey/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2007/01/07 09:13:49 rillig Exp $
+# $NetBSD: Makefile,v 1.10 2008/03/03 02:19:51 jlam Exp $
 #
 
 DISTNAME=	goofey-3.15
@@ -10,6 +10,8 @@ MAINTAINER=	grant@NetBSD.org
 HOMEPAGE=	http://www.csse.monash.edu.au/~tym/goofey.html
 COMMENT=	Text-based client for goofey, a flexible short message system
 
+PKG_DESTDIR_SUPPORT=	user-destdir
+
 NO_CONFIGURE=	yes
 LDFLAGS.SunOS+=	-lnsl -lsocket
 
@@ -19,7 +21,7 @@ do-build:
 	cd ${WRKSRC}; ${CC} ${CFLAGS} ${LDFLAGS} -o goofey goofey.c
 
 do-install:
-	${INSTALL} ${WRKSRC}/goofey ${PREFIX}/bin
-	${INSTALL_DATA} ${WRKSRC}/goofey.1 ${PREFIX}/${PKGMANDIR}/man1
+	${INSTALL} ${WRKSRC}/goofey ${DESTDIR}${PREFIX}/bin
+	${INSTALL_DATA} ${WRKSRC}/goofey.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
 
 .include "../../mk/bsd.pkg.mk"
diff --git a/chat/i2cb/Makefile b/chat/i2cb/Makefile
index 752503b9ceb..ff6d58ac71e 100644
--- a/chat/i2cb/Makefile
+++ b/chat/i2cb/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.17 2007/05/21 09:56:15 joerg Exp $
+# $NetBSD: Makefile,v 1.18 2008/03/03 02:19:51 jlam Exp $
 #
 
 DISTNAME=	i2cb-6.0_ALPHA
@@ -10,6 +10,8 @@ MAINTAINER=	jwise@NetBSD.org
 HOMEPAGE=	http://www.draga.com/~jwise/i2cb/
 COMMENT=	Next generation Internet Citicen's Band chat client
 
+PKG_DESTDIR_SUPPORT=	user-destdir
+
 WRKSRC=		${WRKDIR}/icb
 USE_GNU_READLINE=	yes
 
@@ -19,16 +21,17 @@ post-extract:
 		${RM} -f ${WRKSRC}/src/.depend
 
 do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/src/icb ${PREFIX}/bin/i2cb
-	${INSTALL_SCRIPT} ${WRKSRC}/icbserverdb ${PREFIX}/libdata/i2cbserverdb
-	${INSTALL_DATA_DIR} ${PREFIX}/libdata/i2cb
+	${INSTALL_PROGRAM} ${WRKSRC}/src/icb ${DESTDIR}${PREFIX}/bin/i2cb
+	${INSTALL_SCRIPT} ${WRKSRC}/icbserverdb \
+		${DESTDIR}${PREFIX}/libdata/i2cbserverdb
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/libdata/i2cb
 	${INSTALL_SCRIPT} ${WRKSRC}/sample.icbrc \
-		${PREFIX}/libdata/i2cb/sample.i2cbrc
+		${DESTDIR}${PREFIX}/libdata/i2cb/sample.i2cbrc
 	${INSTALL_SCRIPT} \
 		${WRKSRC}/contrib/bartender \
 		${WRKSRC}/contrib/confuse \
 		${WRKSRC}/contrib/echofile \
-		${PREFIX}/libdata/i2cb
+		${DESTDIR}${PREFIX}/libdata/i2cb
 
 .include "../../lang/tcl83/buildlink3.mk"
 .include "../../devel/readline/buildlink3.mk"
diff --git a/chat/icbirc/Makefile b/chat/icbirc/Makefile
index 740a706fe5e..66ae135498b 100644
--- a/chat/icbirc/Makefile
+++ b/chat/icbirc/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.14 2007/11/29 13:04:04 sketch Exp $
+# $NetBSD: Makefile,v 1.15 2008/03/03 02:19:51 jlam Exp $
 
 DISTNAME=	icbirc-1.8
 CATEGORIES=	chat
@@ -11,6 +11,8 @@ COMMENT=	Proxy IRC client and ICB server
 # uses strlcpy
 NOT_FOR_PLATFORM=	Linux-*-*
 
+PKG_DESTDIR_SUPPORT=	user-destdir
+
 WRKSRC=		${WRKDIR}/${PKGBASE}
 MAKE_ENV+=	BINDIR="${PREFIX}/bin" MANDIR="${PREFIX}/man"
 
@@ -28,7 +30,7 @@ do-build:
 	cd ${WRKSRC} && ${LINK.c} -o icbirc ${SRCS:.c=.o}
 
 do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/icbirc ${PREFIX}/bin/
-	${INSTALL_MAN} ${WRKSRC}/icbirc.8 ${PREFIX}/${PKGMANDIR}/man8/
+	${INSTALL_PROGRAM} ${WRKSRC}/icbirc ${DESTDIR}${PREFIX}/bin/
+	${INSTALL_MAN} ${WRKSRC}/icbirc.8 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8/
 
 .include "../../mk/bsd.pkg.mk"
diff --git a/chat/iip/Makefile b/chat/iip/Makefile
index ed89eca9f62..3501fa4c6a1 100644
--- a/chat/iip/Makefile
+++ b/chat/iip/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2007/03/19 16:40:26 tv Exp $
+# $NetBSD: Makefile,v 1.7 2008/03/03 02:19:51 jlam Exp $
 #
 
 DISTNAME=		iip-1.1.0
@@ -10,16 +10,22 @@ MAINTAINER=		pkgsrc-users@NetBSD.org
 HOMEPAGE=		http://www.invisiblenet.net/iip/
 COMMENT=		The Invisible IRC Project
 
+PKG_DESTDIR_SUPPORT=	user-destdir
+
 BUILD_DIRS=		src
 MAKE_FLAGS+=		CC=${CC:Q}
 MAKE_FLAGS+=		LD=${CC:Q}
 MAKE_FLAGS+=		LDFLAGS=${LDFLAGS:M*:Q}
 MAKE_FLAGS+=		CFLAGS=${CFLAGS:M*:Q}\ ${CPPFLAGS:M*:Q}\ -I.
 
+INSTALLATION_DIRS=	bin
+
 do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/src/isproxy ${PREFIX}/bin/
-	${INSTALL_DATA_DIR} ${PREFIX}/share/examples/iip
-	${INSTALL_DATA} ${WRKSRC}/src/node.ref ${PREFIX}/share/examples/iip/
-	${INSTALL_DATA} ${WRKSRC}/doc/isproxy.1 ${PREFIX}/${PKGMANDIR}/man1/
+	${INSTALL_PROGRAM} ${WRKSRC}/src/isproxy ${DESTDIR}${PREFIX}/bin/
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/examples/iip
+	${INSTALL_DATA} ${WRKSRC}/src/node.ref \
+		${DESTDIR}${PREFIX}/share/examples/iip/
+	${INSTALL_DATA} ${WRKSRC}/doc/isproxy.1 \
+		${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/
 
 .include "../../mk/bsd.pkg.mk"
diff --git a/chat/ircu/Makefile b/chat/ircu/Makefile
index 8e548047398..9f6d3300c93 100644
--- a/chat/ircu/Makefile
+++ b/chat/ircu/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.30 2008/02/04 20:10:34 tnn Exp $
+# $NetBSD: Makefile,v 1.31 2008/03/03 02:19:51 jlam Exp $
 #
 
 DISTNAME=	ircu2.10.12.12
@@ -12,6 +12,8 @@ COMMENT=	Internet Relay Chat server customized for Undernet
 
 CONFLICTS+=	ircd-hybrid-[0-9]*
 
+PKG_DESTDIR_SUPPORT=	user-destdir
+
 GNU_CONFIGURE=	YES
 USE_TOOLS+=	lex
 
@@ -59,18 +61,18 @@ PKG_SHELL.${IRCD_USER}=	${SH}
 INSTALLATION_DIRS=	${PKGMANDIR}/man8 sbin
 
 do-install:
-	${INSTALL_DATA_DIR} ${DOCDIR}
-	${INSTALL_DATA_DIR} ${EGDIR}
-	${INSTALL_PROGRAM} ${WRKSRC}/ircd/ircd ${PREFIX}/sbin
-	${INSTALL_PROGRAM} ${WRKSRC}/ircd/umkpasswd ${PREFIX}/bin
+	${INSTALL_DATA_DIR} ${DESTDIR}${DOCDIR}
+	${INSTALL_DATA_DIR} ${DESTDIR}${EGDIR}
+	${INSTALL_PROGRAM} ${WRKSRC}/ircd/ircd ${DESTDIR}${PREFIX}/sbin
+	${INSTALL_PROGRAM} ${WRKSRC}/ircd/umkpasswd ${DESTDIR}${PREFIX}/bin
 	${INSTALL_PROGRAM} ${WRKSRC}/ircd/convert-conf \
-		${PREFIX}/bin/uconvert-conf
-	${INSTALL_MAN} ${WRKSRC}/doc/ircd.8 ${PREFIX}/${PKGMANDIR}/man8
-	${INSTALL_DATA} ${WRKSRC}/doc/example.conf ${EGDIR}
-	${INSTALL_DATA} ${WRKSRC}/README ${DOCDIR}
-	${INSTALL_DATA} ${WRKSRC}/INSTALL ${DOCDIR}
-	${INSTALL_DATA} ${WRKSRC}/RELEASE.NOTES ${DOCDIR}
-	${INSTALL_DATA} ${WRKSRC}/doc/readme.* ${DOCDIR}
-	${INSTALL_DATA} ${WRKSRC}/doc/*.html ${DOCDIR}
+		${DESTDIR}${PREFIX}/bin/uconvert-conf
+	${INSTALL_MAN} ${WRKSRC}/doc/ircd.8 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8
+	${INSTALL_DATA} ${WRKSRC}/doc/example.conf ${DESTDIR}${EGDIR}
+	${INSTALL_DATA} ${WRKSRC}/README ${DESTDIR}${DOCDIR}
+	${INSTALL_DATA} ${WRKSRC}/INSTALL ${DESTDIR}${DOCDIR}
+	${INSTALL_DATA} ${WRKSRC}/RELEASE.NOTES ${DESTDIR}${DOCDIR}
+	${INSTALL_DATA} ${WRKSRC}/doc/readme.* ${DESTDIR}${DOCDIR}
+	${INSTALL_DATA} ${WRKSRC}/doc/*.html ${DESTDIR}${DOCDIR}
 
 .include "../../mk/bsd.pkg.mk"
diff --git a/chat/iroffer/Makefile b/chat/iroffer/Makefile
index 78cbbc2d680..f23b618852d 100644
--- a/chat/iroffer/Makefile
+++ b/chat/iroffer/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2007/02/22 19:26:11 wiz Exp $
+# $NetBSD: Makefile,v 1.7 2008/03/03 02:19:51 jlam Exp $
 #
 
 DISTNAME=	iroffer1.3.b11
@@ -11,24 +11,26 @@ MAINTAINER=	pkgsrc-users@NetBSD.org
 HOMEPAGE=	http://iroffer.org/
 COMMENT=	IRC (Internet Relay Chat) DCC OfferBot
 
+PKG_DESTDIR_SUPPORT=	user-destdir
+
 INSTALLATION_DIRS=	bin
 
 HAS_CONFIGURE=		yes
 CONFIGURE_SCRIPT=	./Configure
 
 do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/iroffer ${PREFIX}/bin
-	${INSTALL_DATA_DIR} ${PREFIX}/share/doc/iroffer
+	${INSTALL_PROGRAM} ${WRKSRC}/iroffer ${DESTDIR}${PREFIX}/bin
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/doc/iroffer
 	${INSTALL_DATA} ${WRKSRC}/COPYING \
-		${PREFIX}/share/doc/iroffer/COPYING
+		${DESTDIR}${PREFIX}/share/doc/iroffer/COPYING
 	${INSTALL_DATA} ${WRKSRC}/README \
-		${PREFIX}/share/doc/iroffer/README
+		${DESTDIR}${PREFIX}/share/doc/iroffer/README
 	${INSTALL_DATA} ${WRKSRC}/WHATSNEW \
-		${PREFIX}/share/doc/iroffer/WHATSNEW
-	${INSTALL_DATA_DIR} ${PREFIX}/share/examples/iroffer
+		${DESTDIR}${PREFIX}/share/doc/iroffer/WHATSNEW
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/examples/iroffer
 	${INSTALL_DATA} ${WRKSRC}/sample.config \
-		${PREFIX}/share/examples/iroffer/sample.config
+		${DESTDIR}${PREFIX}/share/examples/iroffer/sample.config
 	${INSTALL_DATA} ${WRKSRC}/iroffer.cron \
-		${PREFIX}/share/examples/iroffer/iroffer.cron
+		${DESTDIR}${PREFIX}/share/examples/iroffer/iroffer.cron
 
 .include "../../mk/bsd.pkg.mk"
diff --git a/chat/jabberd/Makefile b/chat/jabberd/Makefile
index 8f44781d95d..de7ae914b9a 100644
--- a/chat/jabberd/Makefile
+++ b/chat/jabberd/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.29 2008/01/18 05:06:24 tnn Exp $
+# $NetBSD: Makefile,v 1.30 2008/03/03 02:19:52 jlam Exp $
 #
 
 DISTNAME=		jabber-1.4.2
@@ -14,6 +14,7 @@ COMMENT=		Instant messaging server
 CONFLICTS=		jabberd2-[0-9]*
 
 PKG_INSTALLATION_TYPES=	overwrite pkgviews
+PKG_DESTDIR_SUPPORT=	user-destdir
 
 # A self-made configure script, and GNU ones in subdirectories.
 HAS_CONFIGURE=			yes
@@ -73,18 +74,19 @@ pre-configure:
 	@${CP} ${PKGSRCDIR}/mk/gnu-config/config.sub ${WRKSRC}/jabberd/pth-1.4.0
 
 do-install:
-	${INSTALL_DATA_DIR} ${EGDIR} ${LIBDIR} ${INCDIR} ${INCDIR}/lib
-	${INSTALL_DATA} ${WRKSRC}/jabber.xml ${EGDIR}
-	${INSTALL_DATA} ${WRKSRC}/platform-settings ${EGDIR}
-	${INSTALL_PROGRAM} ${WRKSRC}/jabberd/jabberd ${PREFIX}/sbin
-	${INSTALL_DATA} ${WRKSRC}/jsm/jsm.so ${LIBDIR}
-	${INSTALL_DATA} ${WRKSRC}/xdb_file/xdb_file.so ${LIBDIR}
-	${INSTALL_DATA} ${WRKSRC}/pthsock/pthsock_client.so ${LIBDIR}
-	${INSTALL_DATA} ${WRKSRC}/dnsrv/dnsrv.so ${LIBDIR}
-	${INSTALL_DATA} ${WRKSRC}/dialback/dialback.so ${LIBDIR}
-	${INSTALL_DATA} ${WRKSRC}/jabberd/jabberd.h ${INCDIR}
-	${INSTALL_DATA} ${WRKSRC}/jabberd/lib/lib.h ${INCDIR}/lib
-	${INSTALL_DATA} ${WRKSRC}/jabberd/lib/xmlparse.h ${INCDIR}/lib
+	${INSTALL_DATA_DIR} ${DESTDIR}${EGDIR} ${DESTDIR}${LIBDIR} \
+		${DESTDIR}${INCDIR} ${DESTDIR}${INCDIR}/lib
+	${INSTALL_DATA} ${WRKSRC}/jabber.xml ${DESTDIR}${EGDIR}
+	${INSTALL_DATA} ${WRKSRC}/platform-settings ${DESTDIR}${EGDIR}
+	${INSTALL_PROGRAM} ${WRKSRC}/jabberd/jabberd ${DESTDIR}${PREFIX}/sbin
+	${INSTALL_DATA} ${WRKSRC}/jsm/jsm.so ${DESTDIR}${LIBDIR}
+	${INSTALL_DATA} ${WRKSRC}/xdb_file/xdb_file.so ${DESTDIR}${LIBDIR}
+	${INSTALL_DATA} ${WRKSRC}/pthsock/pthsock_client.so ${DESTDIR}${LIBDIR}
+	${INSTALL_DATA} ${WRKSRC}/dnsrv/dnsrv.so ${DESTDIR}${LIBDIR}
+	${INSTALL_DATA} ${WRKSRC}/dialback/dialback.so ${DESTDIR}${LIBDIR}
+	${INSTALL_DATA} ${WRKSRC}/jabberd/jabberd.h ${DESTDIR}${INCDIR}
+	${INSTALL_DATA} ${WRKSRC}/jabberd/lib/lib.h ${DESTDIR}${INCDIR}/lib
+	${INSTALL_DATA} ${WRKSRC}/jabberd/lib/xmlparse.h ${DESTDIR}${INCDIR}/lib
 
 #.include "../../devel/pth/buildlink3.mk"
 .include "../../security/openssl/buildlink3.mk"
diff --git a/chat/mu-conference/Makefile b/chat/mu-conference/Makefile
index 6760d4d11b3..5a9e7f6db4d 100644
--- a/chat/mu-conference/Makefile
+++ b/chat/mu-conference/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.17 2007/08/21 15:30:31 abs Exp $
+# $NetBSD: Makefile,v 1.18 2008/03/03 02:19:52 jlam Exp $
 #
 
 DISTNAME=		mu-conference-0.6.0
@@ -13,6 +13,8 @@ COMMENT=		Implementation of the JEP-0045 Multi-User Chat protocol
 
 DEPENDS+=		jabberd-[0-9]*:../../chat/jabberd2
 
+PKG_DESTDIR_SUPPORT=	user-destdir
+
 WRKSRC=			${WRKDIR}/jcr-0.1.2
 SUBWRKSRC=		${WRKSRC}/${DISTNAME}/src
 XMLCONFIG=		${WRKDIR}/${DISTNAME}/muc-jcr.xml
@@ -53,8 +55,8 @@ post-build:
 	cd ${SUBWRKSRC:Q} && ${SETENV} ${MAKE_ENV} ${GMAKE} -f jcomp.mk
 
 do-install:
-	${INSTALL_PROGRAM} ${SUBWRKSRC:Q}/mu-conference ${PREFIX:Q}/bin
-	${INSTALL_DATA} ${WRKSRC:Q}/${DISTNAME:Q}/muc-jcr.xml ${EGDIR:Q}
+	${INSTALL_PROGRAM} ${SUBWRKSRC:Q}/mu-conference ${DESTDIR}${PREFIX:Q}/bin
+	${INSTALL_DATA} ${WRKSRC:Q}/${DISTNAME:Q}/muc-jcr.xml ${DESTDIR}${EGDIR:Q}
 
 .include "../../devel/glib2/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/chat/pircbot/Makefile b/chat/pircbot/Makefile
index e29882e5abb..755ea875d30 100644
--- a/chat/pircbot/Makefile
+++ b/chat/pircbot/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2006/11/10 16:50:54 tv Exp $
+# $NetBSD: Makefile,v 1.16 2008/03/03 02:19:52 jlam Exp $
 #
 
 DISTNAME=	pircbot-0.9.11
@@ -11,6 +11,8 @@ MAINTAINER=	pkgsrc-users@NetBSD.org
 HOMEPAGE=	http://www.jibble.org/pircbot.php
 COMMENT=	Java IRC Bot Framework
 
+PKG_DESTDIR_SUPPORT=	user-destdir
+
 USE_JAVA=	run
 NO_CONFIGURE=	YES
 NO_BUILD=	YES
@@ -20,11 +22,11 @@ post-extract:
 	${FIND} ${WRKSRC} -type f -print | ${XARGS} ${CHMOD} 644
 
 do-install:
-	${INSTALL_DATA_DIR} ${PREFIX}/lib/java
-	${INSTALL_DATA} ${WRKSRC}/pircbot.jar ${PREFIX}/lib/java
-	${INSTALL_DATA_DIR} ${PREFIX}/share/doc/java/pircbot
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/lib/java
+	${INSTALL_DATA} ${WRKSRC}/pircbot.jar ${DESTDIR}${PREFIX}/lib/java
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/doc/java/pircbot
 	cd ${WRKSRC}/javadocs && \
-	    ${PAX} -rw -pp -pm . ${PREFIX}/share/doc/java/pircbot
+	    ${PAX} -rw -pp -pm . ${DESTDIR}${PREFIX}/share/doc/java/pircbot
 
 .include "../../mk/java-vm.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/chat/roxirc/Makefile b/chat/roxirc/Makefile
index cef73cb7438..ac4f8f69029 100644
--- a/chat/roxirc/Makefile
+++ b/chat/roxirc/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2006/04/22 09:22:07 rillig Exp $
+# $NetBSD: Makefile,v 1.11 2008/03/03 02:19:52 jlam Exp $
 #
 
 DISTNAME=	roxirc-1.8
@@ -13,6 +13,7 @@ COMMENT=	Graphical IRC client written in tcl/tk
 DEPENDS+=	tk-[0-9]*:../../x11/tk
 
 PKG_INSTALLATION_TYPES=	overwrite pkgviews
+PKG_DESTDIR_SUPPORT=	user-destdir
 
 NO_BUILD=	YES
 NO_CONFIGURE=	YES
@@ -28,14 +29,14 @@ SUBST_SED.paths=	-e 's,wish8.3,wish,g'
 INSTALLATION_DIRS=	bin
 
 do-install:
-	${INSTALL_SCRIPT} ${WRKSRC}/roxirc ${PREFIX}/bin
-	${INSTALL_DATA_DIR} ${PREFIX}/share/doc/roxirc
-	${INSTALL_DATA_DIR} ${EXAMPLESDIR}
-	${INSTALL_DATA} ${WRKSRC}/config ${EXAMPLESDIR}/config
-	${INSTALL_DATA} ${WRKSRC}/menus ${EXAMPLESDIR}/menus
-	${INSTALL_DATA} ${WRKSRC}/bindings ${EXAMPLESDIR}/bindings
-	${INSTALL_DATA} ${WRKSRC}/prefs ${EXAMPLESDIR}/prefs-initial
-	${INSTALL_DATA} ${WRKSRC}/startup ${EXAMPLESDIR}/startup
-	${INSTALL_DATA} ${WRKSRC}/help ${PREFIX}/share/doc/roxirc/help
+	${INSTALL_SCRIPT} ${WRKSRC}/roxirc ${DESTDIR}${PREFIX}/bin
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/doc/roxirc
+	${INSTALL_DATA_DIR} ${DESTDIR}${EXAMPLESDIR}
+	${INSTALL_DATA} ${WRKSRC}/config ${DESTDIR}${EXAMPLESDIR}/config
+	${INSTALL_DATA} ${WRKSRC}/menus ${DESTDIR}${EXAMPLESDIR}/menus
+	${INSTALL_DATA} ${WRKSRC}/bindings ${DESTDIR}${EXAMPLESDIR}/bindings
+	${INSTALL_DATA} ${WRKSRC}/prefs ${DESTDIR}${EXAMPLESDIR}/prefs-initial
+	${INSTALL_DATA} ${WRKSRC}/startup ${DESTDIR}${EXAMPLESDIR}/startup
+	${INSTALL_DATA} ${WRKSRC}/help ${DESTDIR}${PREFIX}/share/doc/roxirc/help
 
 .include "../../mk/bsd.pkg.mk"
diff --git a/chat/tik/Makefile b/chat/tik/Makefile
index 11d3b119d27..d72774bca49 100644
--- a/chat/tik/Makefile
+++ b/chat/tik/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.13 2006/08/26 13:58:17 minskim Exp $
+# $NetBSD: Makefile,v 1.14 2008/03/03 02:19:52 jlam Exp $
 #
 
 DISTNAME=		tik-0.90
@@ -10,6 +10,8 @@ MAINTAINER=		grant@NetBSD.org
 HOMEPAGE=		http://tik.sourceforge.net/
 COMMENT=		Tcl/Tk AOL Instant Messenger client
 
+PKG_DESTDIR_SUPPORT=	user-destdir
+
 WRKSRC=			${WRKDIR}/tik
 NO_BUILD=		yes
 USE_TOOLS+=		wish:run
@@ -23,9 +25,9 @@ TIKDIR=			${PREFIX}/libexec/tik
 INSTALLATION_DIRS=	bin
 
 do-install:
-	${INSTALL_DATA_DIR} ${TIKDIR}
-	${INSTALL_SCRIPT} ${WRKSRC}/tik.tcl ${TIKDIR}
-	${LN} -s ${TIKDIR}/tik.tcl ${PREFIX}/bin/tik
+	${INSTALL_DATA_DIR} ${DESTDIR}${TIKDIR}
+	${INSTALL_SCRIPT} ${WRKSRC}/tik.tcl ${DESTDIR}${TIKDIR}
+	${LN} -s ${TIKDIR}/tik.tcl ${DESTDIR}${PREFIX}/bin/tik
 	${INSTALL_DATA} \
 		${WRKSRC}/balloonhelp.tcl \
 		${WRKSRC}/buddylist.tcl \
@@ -49,21 +51,21 @@ do-install:
 		${WRKSRC}/version.tcl \
 		${WRKSRC}/example.awayrc \
 		${WRKSRC}/example.pkgrc \
-		${TIKDIR}
+		${DESTDIR}${TIKDIR}
 	cd ${WRKSRC} && \
-		${PAX} -rw components ${TIKDIR} && \
-		${PAX} -rw media ${TIKDIR} && \
-		${PAX} -rw packages ${TIKDIR} && \
-		${PAX} -rw strs ${TIKDIR}
-	${INSTALL_DATA_DIR} ${PREFIX}/share/doc/tik
-	cd ${WRKSRC}/doc && ${PAX} -rw . ${PREFIX}/share/doc/tik
-	${INSTALL_DATA_DIR} ${PREFIX}/share/examples/tik
+		${PAX} -rw components ${DESTDIR}${TIKDIR} && \
+		${PAX} -rw media ${DESTDIR}${TIKDIR} && \
+		${PAX} -rw packages ${DESTDIR}${TIKDIR} && \
+		${PAX} -rw strs ${DESTDIR}${TIKDIR}
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/doc/tik
+	cd ${WRKSRC}/doc && ${PAX} -rw . ${DESTDIR}${PREFIX}/share/doc/tik
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/examples/tik
 	${INSTALL_DATA} \
 		${WRKSRC}/example.awayrc \
 		${WRKSRC}/example.pkgrc \
 		${WRKSRC}/example.tikpre \
 		${WRKSRC}/example.tikrc \
 		${WRKSRC}/example.tikstrs \
-		${PREFIX}/share/examples/tik
+		${DESTDIR}${PREFIX}/share/examples/tik
 
 .include "../../mk/bsd.pkg.mk"
diff --git a/chat/tkicb/Makefile b/chat/tkicb/Makefile
index fb194d5957f..4529ce9afa3 100644
--- a/chat/tkicb/Makefile
+++ b/chat/tkicb/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.18 2007/03/21 19:44:10 jwise Exp $
+# $NetBSD: Makefile,v 1.19 2008/03/03 02:19:52 jlam Exp $
 #
 
 DISTNAME=	icb.2.1.4
@@ -20,6 +20,7 @@ NO_BIN_ON_CDROM=	${RESTRICTED}
 NO_SRC_ON_CDROM=	${RESTRICTED}
 
 PKG_INSTALLATION_TYPES=	overwrite pkgviews
+PKG_DESTDIR_SUPPORT=	user-destdir
 
 WRKSRC=		${WRKDIR}
 NO_CONFIGURE=	YES
@@ -34,14 +35,16 @@ do-build:
 		> ${WRKSRC}/bin/tkicb
 
 do-install:
-	${INSTALL_SCRIPT} ${WRKSRC}/bin/tkicb ${PREFIX}/bin/tkicb
-	${INSTALL_DATA_DIR} ${PREFIX}/libdata/tkicb
-	${INSTALL_DATA_DIR} ${PREFIX}/libdata/tkicb/tcl
-	${INSTALL_DATA_DIR} ${PREFIX}/libdata/tkicb/lib
-	${INSTALL_SCRIPT} ${WRKSRC}/icb.tcl ${PREFIX}/libdata/tkicb/icb.tcl
-	${INSTALL_SCRIPT} ${WRKSRC}/tcl/*.tcl ${PREFIX}/libdata/tkicb/tcl
+	${INSTALL_SCRIPT} ${WRKSRC}/bin/tkicb ${DESTDIR}${PREFIX}/bin/tkicb
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/libdata/tkicb
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/libdata/tkicb/tcl
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/libdata/tkicb/lib
+	${INSTALL_SCRIPT} ${WRKSRC}/icb.tcl \
+		${DESTDIR}${PREFIX}/libdata/tkicb/icb.tcl
+	${INSTALL_SCRIPT} ${WRKSRC}/tcl/*.tcl \
+		${DESTDIR}${PREFIX}/libdata/tkicb/tcl
 	${INSTALL_SCRIPT} ${WRKSRC}/lib/confuse ${WRKSRC}/lib/flirt \
-		${WRKSRC}/lib/servers ${PREFIX}/libdata/tkicb/lib
-	${INSTALL_SCRIPT} ${WRKSRC}/lib/* ${PREFIX}/libdata/tkicb/lib
+		${WRKSRC}/lib/servers ${DESTDIR}${PREFIX}/libdata/tkicb/lib
+	${INSTALL_SCRIPT} ${WRKSRC}/lib/* ${DESTDIR}${PREFIX}/libdata/tkicb/lib
 
 .include "../../mk/bsd.pkg.mk"
diff --git a/chat/tkirc/Makefile b/chat/tkirc/Makefile
index 3b05b16ccf6..ff19e90e94a 100644
--- a/chat/tkirc/Makefile
+++ b/chat/tkirc/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.16 2007/03/04 11:29:58 wiz Exp $
+# $NetBSD: Makefile,v 1.17 2008/03/03 02:19:52 jlam Exp $
 
 DISTNAME=	tkirc1.202
 PKGNAME=	tkirc-1.202
@@ -14,6 +14,7 @@ DEPENDS+=	ircII-[0-9]*:../../chat/ircII
 DEPENDS+=	tk>=8.3.2:../../x11/tk
 
 PKG_INSTALLATION_TYPES=	overwrite pkgviews
+PKG_DESTDIR_SUPPORT=	user-destdir
 
 WRKSRC=		${WRKDIR}/tkirc
 NO_CONFIGURE=	yes
@@ -22,11 +23,12 @@ NO_BUILD=	yes
 INSTALLATION_DIRS=	bin
 
 do-install:
-	${INSTALL_SCRIPT} ${WRKSRC}/tkirc	  ${PREFIX}/bin
-	${INSTALL_DATA_DIR} ${PREFIX}/share/doc/tkirc
-	${INSTALL_DATA} ${WRKSRC}/tkircrc-example ${PREFIX}/share/doc/tkirc
-	${INSTALL_DATA} ${WRKSRC}/README	  ${PREFIX}/share/doc/tkirc
-	${INSTALL_DATA} ${WRKSRC}/CHANGES	  ${PREFIX}/share/doc/tkirc
-	${INSTALL_DATA} ${WRKSRC}/COPYING	  ${PREFIX}/share/doc/tkirc
+	${INSTALL_SCRIPT} ${WRKSRC}/tkirc ${DESTDIR}${PREFIX}/bin
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/doc/tkirc
+	${INSTALL_DATA} ${WRKSRC}/tkircrc-example \
+		${DESTDIR}${PREFIX}/share/doc/tkirc
+	${INSTALL_DATA} ${WRKSRC}/README ${DESTDIR}${PREFIX}/share/doc/tkirc
+	${INSTALL_DATA} ${WRKSRC}/CHANGES ${DESTDIR}${PREFIX}/share/doc/tkirc
+	${INSTALL_DATA} ${WRKSRC}/COPYING ${DESTDIR}${PREFIX}/share/doc/tkirc
 
 .include "../../mk/bsd.pkg.mk"
diff --git a/chat/tkirc2/Makefile b/chat/tkirc2/Makefile
index e7fa10c766d..06ab5bc08f8 100644
--- a/chat/tkirc2/Makefile
+++ b/chat/tkirc2/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2007/09/19 06:46:51 tron Exp $
+# $NetBSD: Makefile,v 1.12 2008/03/03 02:19:52 jlam Exp $
 
 DISTNAME=	tkirc2.46
 PKGNAME=	tkirc2-2.46
@@ -14,6 +14,7 @@ DEPENDS+=	ircII-[0-9]*:../../chat/ircII
 DEPENDS+=	tk>=8.3.2:../../x11/tk
 
 PKG_INSTALLATION_TYPES=	overwrite pkgviews
+PKG_DESTDIR_SUPPORT=	user-destdir
 
 WRKSRC=		${WRKDIR}/tkirc2
 NO_CONFIGURE=	yes
@@ -28,17 +29,17 @@ SUBST_SED.paths=	-e 's,wish8.3,wish,g'
 INSTALLATION_DIRS=	bin
 
 do-install:
-	${INSTALL_SCRIPT} ${WRKSRC}/tkirc2 ${PREFIX}/bin
-	${INSTALL_DATA_DIR} ${PREFIX}/share/doc/tkirc2
-	${INSTALL_DATA_DIR} ${PREFIX}/share/examples/tkirc2/scripts
-	${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/tkirc2
-	${INSTALL_DATA} ${WRKSRC}/CHANGES ${PREFIX}/share/doc/tkirc2
-	${INSTALL_DATA} ${WRKSRC}/COPYING ${PREFIX}/share/doc/tkirc2
+	${INSTALL_SCRIPT} ${WRKSRC}/tkirc2 ${DESTDIR}${PREFIX}/bin
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/doc/tkirc2
+	${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/examples/tkirc2/scripts
+	${INSTALL_DATA} ${WRKSRC}/README ${DESTDIR}${PREFIX}/share/doc/tkirc2
+	${INSTALL_DATA} ${WRKSRC}/CHANGES ${DESTDIR}${PREFIX}/share/doc/tkirc2
+	${INSTALL_DATA} ${WRKSRC}/COPYING ${DESTDIR}${PREFIX}/share/doc/tkirc2
 	${INSTALL_SCRIPT} ${WRKSRC}/.tkirc2/scripts/* \
-	  ${PREFIX}/share/examples/tkirc2/scripts
+	  ${DESTDIR}${PREFIX}/share/examples/tkirc2/scripts
 	${INSTALL_DATA} ${WRKSRC}/.tkirc2/netscape.sh \
-	  ${PREFIX}/share/examples/tkirc2
+	  ${DESTDIR}${PREFIX}/share/examples/tkirc2
 	${INSTALL_DATA} ${WRKSRC}/.tkirc2/tkircrc-example \
-	   ${PREFIX}/share/examples/tkirc2
+	  ${DESTDIR}${PREFIX}/share/examples/tkirc2
 
 .include "../../mk/bsd.pkg.mk"
diff --git a/chat/unrealircd/Makefile b/chat/unrealircd/Makefile
index fe7cab1a7ba..9b1c198b4a9 100644
--- a/chat/unrealircd/Makefile
+++ b/chat/unrealircd/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.21 2007/09/13 19:24:13 adrianp Exp $
+# $NetBSD: Makefile,v 1.22 2008/03/03 02:19:52 jlam Exp $
 
 DISTNAME=	Unreal3.2.7
 PKGNAME=	unrealircd-3.2.7
@@ -14,6 +14,8 @@ COMMENT=	Advanced IRC server with IPv6 and SSL support
 
 CONFLICTS+=	ircu-[0-9]*
 
+PKG_DESTDIR_SUPPORT=	user-destdir
+
 GNU_CONFIGURE=	YES
 USE_TOOLS+=	pkg-config gmake
 TRE_NEEDED=	0.7.5
@@ -119,29 +121,33 @@ post-build:
 .endif
 
 do-install:
-	${INSTALL_DATA_DIR} ${IRCD_SHARE}
-	${INSTALL_DATA_DIR} ${IRCD_SHARE:Q}/networks
-	${INSTALL_DATA_DIR} ${IRCD_SHARE:Q}/aliases
-	${INSTALL_DATA_DIR} ${IRCD_SHARE:Q}/modules
-	${INSTALL_DATA_DIR} ${IRCD_DOCS:Q}
-	${INSTALL_DATA_DIR} ${IRCD_EG:Q}
-
-	${INSTALL_PROGRAM} ${WRKSRC:Q}/src/ircd ${PREFIX:Q}/sbin
-	${INSTALL_DATA} ${WRKSRC:Q}/networks/*.network ${IRCD_SHARE:Q}/networks
+	${INSTALL_DATA_DIR} ${DESTDIR}${IRCD_SHARE}
+	${INSTALL_DATA_DIR} ${DESTDIR}${IRCD_SHARE:Q}/networks
+	${INSTALL_DATA_DIR} ${DESTDIR}${IRCD_SHARE:Q}/aliases
+	${INSTALL_DATA_DIR} ${DESTDIR}${IRCD_SHARE:Q}/modules
+	${INSTALL_DATA_DIR} ${DESTDIR}${IRCD_DOCS:Q}
+	${INSTALL_DATA_DIR} ${DESTDIR}${IRCD_EG:Q}
+
+	${INSTALL_PROGRAM} ${WRKSRC:Q}/src/ircd ${DESTDIR}${PREFIX:Q}/sbin
+	${INSTALL_DATA} ${WRKSRC:Q}/networks/*.network \
+		${DESTDIR}${IRCD_SHARE:Q}/networks
 	${INSTALL_DATA} ${WRKSRC:Q}/networks/networks.ndx \
-		${IRCD_SHARE:Q}/networks
-	${INSTALL_SCRIPT} ${WRKSRC:Q}/networks/makenet ${IRCD_SHARE:Q}/networks
-	${INSTALL_DATA} ${WRKSRC:Q}/aliases/*.conf ${IRCD_SHARE:Q}/aliases
-	${INSTALL_DATA} ${WRKSRC:Q}/badwords*.conf ${IRCD_SHARE:Q}
-	${INSTALL_DATA} ${WRKSRC:Q}/help.* ${IRCD_SHARE:Q}
-	${INSTALL_DATA} ${WRKSRC:Q}/doc/help.* ${IRCD_SHARE:Q}
-	${INSTALL_DATA} ${WRKSRC:Q}/spamfilter.conf ${IRCD_SHARE:Q}
-	${INSTALL_DATA} ${WRKSRC:Q}/src/modules/*.so ${IRCD_SHARE:Q}/modules
-	${INSTALL_DATA} ${WRKSRC:Q}/doc/unreal32docs.* ${IRCD_DOCS:Q}
-	${INSTALL_DATA} ${WRKSRC:Q}/doc/example.* ${IRCD_EG:Q}
+		${DESTDIR}${IRCD_SHARE:Q}/networks
+	${INSTALL_SCRIPT} ${WRKSRC:Q}/networks/makenet \
+		${DESTDIR}${IRCD_SHARE:Q}/networks
+	${INSTALL_DATA} ${WRKSRC:Q}/aliases/*.conf \
+		${DESTDIR}${IRCD_SHARE:Q}/aliases
+	${INSTALL_DATA} ${WRKSRC:Q}/badwords*.conf ${DESTDIR}${IRCD_SHARE:Q}
+	${INSTALL_DATA} ${WRKSRC:Q}/help.* ${DESTDIR}${IRCD_SHARE:Q}
+	${INSTALL_DATA} ${WRKSRC:Q}/doc/help.* ${DESTDIR}${IRCD_SHARE:Q}
+	${INSTALL_DATA} ${WRKSRC:Q}/spamfilter.conf ${DESTDIR}${IRCD_SHARE:Q}
+	${INSTALL_DATA} ${WRKSRC:Q}/src/modules/*.so \
+		${DESTDIR}${IRCD_SHARE:Q}/modules
+	${INSTALL_DATA} ${WRKSRC:Q}/doc/unreal32docs.* ${DESTDIR}${IRCD_DOCS:Q}
+	${INSTALL_DATA} ${WRKSRC:Q}/doc/example.* ${DESTDIR}${IRCD_EG:Q}
 
 .	for f in ${DOC_FILES}
-		${INSTALL_DATA} ${WRKSRC:Q}/${f:Q} ${IRCD_DOCS:Q}
+		${INSTALL_DATA} ${WRKSRC:Q}/${f:Q} ${DESTDIR}${IRCD_DOCS:Q}
 .	endfor
 
 .include "../../mk/bsd.pkg.mk"
diff --git a/chat/zenicb/Makefile b/chat/zenicb/Makefile
index d755c91ec46..219bcb349df 100644
--- a/chat/zenicb/Makefile
+++ b/chat/zenicb/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.19 2006/03/04 21:29:04 jlam Exp $
+# $NetBSD: Makefile,v 1.20 2008/03/03 02:19:52 jlam Exp $
 
 DISTNAME=		zenicb-19981202
 PKGNAME=		${EMACS_PKGNAME_PREFIX}${DISTNAME}
@@ -9,6 +9,8 @@ MASTER_SITES=		${MASTER_SITE_LOCAL}
 MAINTAINER=		pkgsrc-users@NetBSD.org
 COMMENT=		ICB client for Emacs
 
+PKG_DESTDIR_SUPPORT=	user-destdir
+
 NO_SRC_ON_FTP=		Already in MASTER_SITE_LOCAL
 
 .include "../../mk/emacs.mk"
@@ -20,9 +22,9 @@ EMACS_VERSIONS_ACCEPTED=	emacs21 emacs21nox emacs20 xemacs214 xemacs215
 do-build:
 
 do-install:
-	@${INSTALL_DATA_DIR} ${EMACS_LISPPREFIX}/zenicb
+	@${INSTALL_DATA_DIR} ${DESTDIR}${EMACS_LISPPREFIX}/zenicb
 	@for file in ${WRKSRC}/src/*.el; do \
-		j="${INSTALL_DATA} $$file ${EMACS_LISPPREFIX}/zenicb"; \
+		j="${INSTALL_DATA} $$file ${DESTDIR}${EMACS_LISPPREFIX}/zenicb"; \
 		${ECHO} $$j; $$j; \
 	done
 
diff --git a/chat/zephyr-mode/Makefile b/chat/zephyr-mode/Makefile
index 0c0159fae9b..7385db11f87 100644
--- a/chat/zephyr-mode/Makefile
+++ b/chat/zephyr-mode/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.13 2007/02/20 19:04:10 wiz Exp $
+# $NetBSD: Makefile,v 1.14 2008/03/03 02:19:52 jlam Exp $
 #
 
 DISTNAME=	zephyr-mode-2.5.20
@@ -13,14 +13,16 @@ COMMENT=	CMU Emacs-based Zephyr client
 
 DEPENDS+=	tzc>=2.6.15:../../chat/tzc
 
+PKG_DESTDIR_SUPPORT=	user-destdir
+
 NO_BUILD=	yes
 
 .include "../../mk/emacs.mk"
 
 do-install:
-	@${INSTALL_DATA_DIR} ${EMACS_LISPPREFIX}/zephyr-mode
+	@${INSTALL_DATA_DIR} ${DESTDIR}${EMACS_LISPPREFIX}/zephyr-mode
 	@for f in ${WRKSRC}/elisp/*.el; do \
-		j="${INSTALL_DATA} $$f ${EMACS_LISPPREFIX}/zephyr-mode"; \
+		j="${INSTALL_DATA} $$f ${DESTDIR}${EMACS_LISPPREFIX}/zephyr-mode"; \
 		${ECHO} $$j; $$j; \
 	done
 
-- 
cgit v1.2.3