Subject: adzap patches (use PKG_SYSCONFDIR)
To: adzap pkgsrc maintainer <tech-pkg@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 10/08/2003 11:29:49
I supplied patches for adzap in June in reply to another user who used it.

This is so it uses PKG_SYSCONFDIR.

I don't use adzap. So these are not fully tested.

Anyone use adzap?

Can anyone review and use the following?

   Jeremy C. Reed
   http://bsd.reedmedia.net/

Index: www/adzap/MESSAGE
===================================================================
RCS file: /cvsroot/pkgsrc/www/adzap/MESSAGE,v
retrieving revision 1.2
diff -b -u -r1.2 MESSAGE
--- www/adzap/MESSAGE	2002/09/24 12:30:41	1.2
+++ www/adzap/MESSAGE	2003/10/08 18:25:25
@@ -1,13 +1,13 @@
 ===========================================================================
 $NetBSD: MESSAGE,v 1.2 2002/09/24 12:30:41 wiz Exp $

-  Adzap has now been installed.  To get it up and running, copy
-  ${PREFIX}/share/examples/adzap/adzap.conf to /etc and modify
-  it to match your setup.  Then edit your squid configuration and
-  add ${PREFIX}/libexec/adzap as your http-redirector.
+  Adzap has now been installed.  To get it up and running, modify
+  ${PKG_SYSCONFDIR}/adzap.conf to match your setup.  Then edit your
+  squid configuration and add ${PREFIX}/libexec/adzap as your
+  http-redirector.

   If you run a web server, you can copy the *.{html,js,gif,swf,mp3}
   files from ${PREFIX}/share/examples/adzap to your htdocs tree and
-  modify the web locations in /etc/adzap.conf accordingly.
+  modify the web locations in ${PKG_SYSCONFDIR}/adzap.conf accordingly.

 ===========================================================================
Index: www/adzap/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/www/adzap/Makefile,v
retrieving revision 1.39
diff -b -u -r1.39 Makefile
--- www/adzap/Makefile	2003/08/13 03:05:48	1.39
+++ www/adzap/Makefile	2003/10/08 18:25:25
@@ -14,31 +14,38 @@

 NO_BUILD=	# defined
 USE_PERL5=	# defined
+USE_PKGINSTALL=	YES

+EGDIR=		${PREFIX}/share/examples/adzap
+CONF_FILES=	${EGDIR}/adzap.conf ${PKG_SYSCONFDIR}/adzap.conf
+
+MESSAGE_SUBST+=	EGDIR=${EGDIR}
+#MESSAGE_SUBST+=	PKG_SYSCONFDIR=${PKG_SYSCONFDIR}
+
 do-configure:
 .for FILE in scripts/squid_redirect scripts/wrapzap
 	${CP} ${WRKSRC}/${FILE} ${WRKSRC}/${FILE}.ORIG
 	${SED} -e "s:/usr/bin/perl:${PERL5}:g" \
 	       -e "s:@@PREFIX@@:${PREFIX}:g" \
+	       -e "s:@@PKG_SYSCONFDIR@@:${PKG_SYSCONFDIR}:g" \
 		<${WRKSRC}/${FILE}.ORIG >${WRKSRC}/${FILE}
 .endfor

 do-install:
 	${INSTALL_SCRIPT} ${WRKSRC}/scripts/squid_redirect ${PREFIX}/libexec
 	${INSTALL_SCRIPT} ${WRKSRC}/scripts/wrapzap ${PREFIX}/libexec/adzap
-	${INSTALL_DATA_DIR} ${PREFIX}/share/examples/adzap
+	${INSTALL_DATA_DIR} ${EGDIR}
 .for FILE in ad-clear.gif ad-clear.mp3 ad-clear.swf ad-grey.gif ad-old.gif \
     ad.gif ad.mp3 ad.swf adbg-clear.gif adbg.gif \
     closepopup-clear.html closepopup.html counter-clear.gif counter.gif \
     no-op-clear.html no-op-clear.js no-op-counter-clear.html \
     no-op-counter-clear.js no-op-counter.html no-op-counter.js \
     no-op.html no-op.js webbug-clear.gif webbug-clear.js webbug.gif webbug.js
-	${INSTALL_DATA} ${WRKSRC}/zaps/${FILE} ${PREFIX}/share/examples/adzap
+	${INSTALL_DATA} ${WRKSRC}/zaps/${FILE} ${EGDIR}
 .endfor
 .for FILE in proxy-cisra.pac proxy-home.pac proxy-zip.pac
-	${INSTALL_DATA} ${WRKSRC}/rc/${FILE} ${PREFIX}/share/examples/adzap
+	${INSTALL_DATA} ${WRKSRC}/rc/${FILE} ${EGDIR}
 .endfor
-	${INSTALL_DATA} ${WRKSRC}/scripts/adzap.conf \
-	    ${PREFIX}/share/examples/adzap
+	${INSTALL_DATA} ${WRKSRC}/scripts/adzap.conf ${EGDIR}

 .include "../../mk/bsd.pkg.mk"
Index: www/adzap/patches/patch-aa
===================================================================
RCS file: /cvsroot/pkgsrc/www/adzap/patches/patch-aa,v
retrieving revision 1.12
diff -b -u -r1.12 patch-aa
--- www/adzap/patches/patch-aa	2003/08/13 03:05:49	1.12
+++ www/adzap/patches/patch-aa	2003/10/08 18:25:26
@@ -41,7 +41,7 @@
 -STUBURL_PRINT=				# off by default, set to 1
 +zapper=@@PREFIX@@/libexec/squid_redirect
 +
-+. /etc/adzap.conf
++. @@PKG_SYSCONFDIR@@/adzap.conf

  export ZAP_MODE ZAP_BASE ZAP_BASE_SSL ZAP_PREMATCH ZAP_POSTMATCH ZAP_MATCH
  export STUBURL_AD STUBURL_ADSSL STUBURL_ADJS STUBURL_ADHTML STUBURL_ADMP3 \