Date: Wed, 3 Sep 2003 00:16:51 -0400 (EDT) From: rmuir@radford.edu To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/56359: new port: www/adzap2squirm Message-ID: <200309030416.h834GpUw091411@moe.internal.servebeer.com> Resent-Message-ID: <200309030420.h834KBpU091212@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 56359 >Category: ports >Synopsis: new port: www/adzap2squirm >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Sep 02 21:20:11 PDT 2003 >Closed-Date: >Last-Modified: >Originator: >Release: FreeBSD 5.1-RELEASE-p2 i386 >Organization: >Environment: >Description: adzap2Squirm is a Perl script to take an Ad Zapper pattern file (or the original Ad Zapper script itself, which includes the patterns) and write out a corresponding file of patterns which Squirm can use for ad zapping. This port also includes a modified update-zapper (from the Ad Zapper) so that updates of the ad definitions can be run through cron >How-To-Repeat: >Fix: --- adzap2squirm.sh begins here --- # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # adzap2squirm # adzap2squirm/files # adzap2squirm/files/patch-aa # adzap2squirm/files/patch-ab # adzap2squirm/files/squirm.conf.zap # adzap2squirm/Makefile # adzap2squirm/distinfo # adzap2squirm/pkg-descr # adzap2squirm/pkg-plist # echo c - adzap2squirm mkdir -p adzap2squirm > /dev/null 2>&1 echo c - adzap2squirm/files mkdir -p adzap2squirm/files > /dev/null 2>&1 echo x - adzap2squirm/files/patch-aa sed 's/^X//' >adzap2squirm/files/patch-aa << 'END-of-adzap2squirm/files/patch-aa' X--- a2swrap.orig Fri Jul 18 20:57:46 2003 X+++ a2swrap Tue Sep 2 21:48:35 2003 X@@ -19,10 +19,10 @@ X # X #ZAP_BASE: the base URL for the replacement files. X # DEFAULT: http://adzap.cs.zip.com.au X-export ZAP_BASE=http://192.168.0.10/zaps X+# export ZAP_BASE=http://192.168.0.10/zaps X #ZAP_BASE_SSL: the base URL for replacement files via HTTPS X # DEFAULT: https://adzap.cs.zip.com.au X-export ZAP_BASE_SSL=http://192.168.0.10/zaps X+# export ZAP_BASE_SSL=http://192.168.0.10/zaps X #STUBURL_*: replacement URLs for the various classes recognized X # by adzapper X # DEFAULT: same as the adzapper defaults X@@ -30,7 +30,7 @@ X # this would be the latest version of the adzapper script as downloaded X # from the homepage. X # default: squid_redirect X-export A2S_PTNFILE=patterns X+# export A2S_PTNFILE=patterns X #A2S_PREFILE: a filename to read for patterns before the main pattern X # file. If the file is not present it will be silently skipped. X # DEFAULT: prezap X@@ -42,7 +42,7 @@ X #A2S_OUTFILE: the filename to which the Squirm configuration will be X # written. X # DEFAULT: squirm.patterns X-export A2S_OUTFILE=/usr/local/squirm/etc/squirm.patterns X+export A2S_OUTFILE=%%PREFIX%%/etc/squirm/zap.patterns X #A2S_CREATEACCELS: set to "false" to disable the creation of accelerator X # strings for Squirm. Note that since v1.23, Squirm attempts to create X # accelerators for patterns which do not have them specified in the pattern X@@ -60,4 +60,4 @@ X X export ZAP_MODE="CLEAR" X X-./adzap2squirm X+%%PREFIX%%/bin/adzap2squirm END-of-adzap2squirm/files/patch-aa echo x - adzap2squirm/files/patch-ab sed 's/^X//' >adzap2squirm/files/patch-ab << 'END-of-adzap2squirm/files/patch-ab' X--- update-zapper.orig Sun Jan 5 05:28:38 2003 X+++ update-zapper Tue Sep 2 23:01:53 2003 X@@ -8,15 +8,16 @@ X # X X masterurl=http://adzapper.sourceforge.net/scripts/squid_redirect X-zapper=/usr/local/etc/squid_redirect ## hack to suit your site X-pidfile=/var/run/squid-noads.pid ## hack to suit, again X+zapper=%%PREFIX%%/etc/squirm/squid_redirect ## hack to suit your site X+pidfile=%%PREFIX%%/squid/logs/squid.pid ## hack to suit, again X X tmp=/tmp/newzapper$$ X-if wget -q --cache=off -O $tmp "$masterurl" X+if %%FETCH_CMD%% -q -o $tmp "$masterurl" X then X [ ! -s "$tmp" ] \ X || cmp -s "$tmp" "$zapper" \ X- || ( cat "$tmp" >"$zapper" || exit 1 X+ || ( cat "$tmp" | sed -e "s@\|)@\|\.\*)@g" -e "s@(\|@(\.\*\|@g" >"$zapper" || exit 1 X+ (cd %%PREFIX%%/etc/squirm && %%PREFIX%%/bin/a2swrap) X [ -s "$pidfile" ] && kill -1 `cat "$pidfile"` X ) X fi END-of-adzap2squirm/files/patch-ab echo x - adzap2squirm/files/squirm.conf.zap sed 's/^X//' >adzap2squirm/files/squirm.conf.zap << 'END-of-adzap2squirm/files/squirm.conf.zap' Xbegin Xnetwork 127.0.0.0/24 X# ADD YOUR NETWORKS HERE Xlog squirm/logs/match.log Xabort-log squirm/logs/abort.log Xpattern zap.patterns get Xend END-of-adzap2squirm/files/squirm.conf.zap echo x - adzap2squirm/Makefile sed 's/^X//' >adzap2squirm/Makefile << 'END-of-adzap2squirm/Makefile' X# New ports collection makefile for: adzap2squirm X# Date created: 02 Sept 2003 X# Whom: Robert Muir <rmuir@radford.edu> X# X# $FreeBSD$ X# X XPORTNAME= adzap2squirm XPORTVERSION= 1.0 XCATEGORIES= www XMASTER_SITES= http://www.meredevice.com/files/ \ X http://adzapper.sourceforge.net/scripts/ XDISTFILES= adzap2squirm a2swrap update-zapper XEXTRACT_ONLY= X XMAINTAINER= ports@FreeBSD.org XCOMMENT= Use and update adzap patterns with squirm X XRUN_DEPENDS= squirm:${PORTSDIR}/www/squirm X XUSE_PERL5= # defined XNO_BUILD= # defined X Xdo-extract: X ${MKDIR} ${WRKSRC} X.for DISTFILE in ${DISTFILES} X ${CP} ${DISTDIR}/${DISTFILE} ${WRKSRC} X.endfor X Xpost-patch: X @${PERL} -pi -e "s,%%PREFIX%%,${PREFIX},g" ${WRKSRC}/a2swrap X @${PERL} -pi -e "s,%%PREFIX%%,${PREFIX},g" ${WRKSRC}/update-zapper X @${PERL} -pi -e "s,%%FETCH_CMD%%,${FETCH_CMD},g" ${WRKSRC}/update-zapper X Xdo-install: X.for DISTFILE in ${DISTFILES} X ${INSTALL_SCRIPT} ${WRKSRC}/${DISTFILE} ${PREFIX}/bin X.endfor X ${INSTALL} ${FILESDIR}/squirm.conf.zap ${PREFIX}/etc/squirm/ X ${TOUCH} ${PREFIX}/etc/squirm/zap.patterns X X @${ECHO_MSG} "********************************************************" X @${ECHO_MSG} " In order to block ads, you must first setup squirm.conf" X @${ECHO_MSG} " An example is in: " X @${ECHO_MSG} " " X @${ECHO_MSG} " ${PREFIX}/etc/squirm/squirm.conf.zap " X @${ECHO_MSG} " " X @${ECHO_MSG} " You must also setup squid to use squirm if you have not" X @${ECHO_MSG} " done so. Add this to ${PREFIX}/etc/squid/squid.conf: " X @${ECHO_MSG} " " X @${ECHO_MSG} " redirect_program: ${PREFIX}/bin/squirm " X @${ECHO_MSG} " " X @${ECHO_MSG} " Then run from the command line: " X @${ECHO_MSG} " " X @${ECHO_MSG} " ${PREFIX}/bin/update-zapper " X @${ECHO_MSG} " " X @${ECHO_MSG} "This port installs a script (${PREFIX}/update-zapper) " X @${ECHO_MSG} "which will update the ad definitions, and restart squid " X @${ECHO_MSG} "if there are new ones available. Add this to root's " X @${ECHO_MSG} "crontab to easily keep your ad definitions up to date. " X @${ECHO_MSG} "********************************************************" X X.include <bsd.port.mk> END-of-adzap2squirm/Makefile echo x - adzap2squirm/distinfo sed 's/^X//' >adzap2squirm/distinfo << 'END-of-adzap2squirm/distinfo' XMD5 (a2swrap) = 3ef099d66d5470d367f2ba11533b0cfa XMD5 (adzap2squirm) = 67e2dc0812b523ae8c161c5af6d7f46b XMD5 (update-zapper) = 60ddf676f5a6654481cb9b547151308e END-of-adzap2squirm/distinfo echo x - adzap2squirm/pkg-descr sed 's/^X//' >adzap2squirm/pkg-descr << 'END-of-adzap2squirm/pkg-descr' XAdzap2Squirm is a Perl script to take an Ad Zapper pattern file X(or the original Ad Zapper script itself, which includes the patterns) Xand write out a corresponding file of patterns which Squirm can use for Xad zapping. X XWWW: http://www.meredevice.com/adzap2squirm.html END-of-adzap2squirm/pkg-descr echo x - adzap2squirm/pkg-plist sed 's/^X//' >adzap2squirm/pkg-plist << 'END-of-adzap2squirm/pkg-plist' Xbin/a2swrap Xbin/adzap2squirm Xbin/update-zapper Xetc/squirm/squirm.conf.zap END-of-adzap2squirm/pkg-plist exit --- adzap2squirm.sh ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200309030416.h834GpUw091411>