aboutsummaryrefslogtreecommitdiffstats
path: root/www/adzap2squirm
diff options
context:
space:
mode:
authoredwin <edwin@FreeBSD.org>2004-01-08 09:43:26 +0800
committeredwin <edwin@FreeBSD.org>2004-01-08 09:43:26 +0800
commit379c36a8a21bca8dd824e7825abc518886425b76 (patch)
tree8252493d19c0247910df9a76c5204d7377f84443 /www/adzap2squirm
parentd87145a73f5c5d25a6c2cb810d0509b075981c0e (diff)
downloadfreebsd-ports-gnome-379c36a8a21bca8dd824e7825abc518886425b76.tar.gz
freebsd-ports-gnome-379c36a8a21bca8dd824e7825abc518886425b76.tar.zst
freebsd-ports-gnome-379c36a8a21bca8dd824e7825abc518886425b76.zip
new port: www/adzap2squirm
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 PR: ports/56359 Submitted by: rmuir@radford.edu
Diffstat (limited to 'www/adzap2squirm')
-rw-r--r--www/adzap2squirm/Makefile49
-rw-r--r--www/adzap2squirm/distinfo3
-rw-r--r--www/adzap2squirm/files/patch-aa39
-rw-r--r--www/adzap2squirm/files/patch-ab23
-rw-r--r--www/adzap2squirm/files/pkg-message20
-rw-r--r--www/adzap2squirm/files/squirm.conf.zap7
-rw-r--r--www/adzap2squirm/pkg-descr6
-rw-r--r--www/adzap2squirm/pkg-plist5
8 files changed, 152 insertions, 0 deletions
diff --git a/www/adzap2squirm/Makefile b/www/adzap2squirm/Makefile
new file mode 100644
index 000000000000..31d3c781c4c9
--- /dev/null
+++ b/www/adzap2squirm/Makefile
@@ -0,0 +1,49 @@
+# New ports collection makefile for: adzap2squirm
+# Date created: 02 Sept 2003
+# Whom: Robert Muir <rmuir@radford.edu>
+#
+# $FreeBSD$
+#
+
+PORTNAME= adzap2squirm
+PORTVERSION= 1.0
+CATEGORIES= www
+MASTER_SITES= http://www.meredevice.com/files/ \
+ http://adzapper.sourceforge.net/scripts/
+DISTFILES= adzap2squirm a2swrap update-zapper
+EXTRACT_ONLY=
+
+MAINTAINER= ports@FreeBSD.org
+COMMENT= Use and update adzap patterns with squirm
+
+RUN_DEPENDS= squirm:${PORTSDIR}/www/squirm
+
+USE_REINPLACE= yes
+USE_PERL5_RUN= yes
+NO_BUILD= yes
+PKGMESSAGE= ${WRKDIR}/pkg-message
+
+do-extract:
+ ${MKDIR} ${WRKSRC}
+ ${CP} ${FILESDIR}/pkg-message ${PKGMESSAGE}
+.for DISTFILE in ${DISTFILES}
+ ${CP} ${DISTDIR}/${DISTFILE} ${WRKSRC}
+.endfor
+
+post-patch:
+ ${REINPLACE_CMD} -e "s,%%PREFIX%%,${PREFIX},g" ${WRKSRC}/a2swrap
+ ${REINPLACE_CMD} -e "s,%%PREFIX%%,${PREFIX},g" ${PKGMESSAGE}
+ ${REINPLACE_CMD} \
+ -e "s,%%PREFIX%%,${PREFIX},g" \
+ -e "s,%%FETCH_CMD%%,${FETCH_CMD},g" \
+ ${WRKSRC}/update-zapper
+
+do-install:
+.for DISTFILE in ${DISTFILES}
+ ${INSTALL_SCRIPT} ${WRKSRC}/${DISTFILE} ${PREFIX}/bin
+.endfor
+ ${INSTALL} ${FILESDIR}/squirm.conf.zap ${PREFIX}/etc/squirm/
+ ${TOUCH} ${PREFIX}/etc/squirm/zap.patterns
+ ${CAT} ${WRKDIR}/pkg-message
+
+.include <bsd.port.mk>
diff --git a/www/adzap2squirm/distinfo b/www/adzap2squirm/distinfo
new file mode 100644
index 000000000000..fc850bda2b0c
--- /dev/null
+++ b/www/adzap2squirm/distinfo
@@ -0,0 +1,3 @@
+MD5 (a2swrap) = 3ef099d66d5470d367f2ba11533b0cfa
+MD5 (adzap2squirm) = 67e2dc0812b523ae8c161c5af6d7f46b
+MD5 (update-zapper) = 60ddf676f5a6654481cb9b547151308e
diff --git a/www/adzap2squirm/files/patch-aa b/www/adzap2squirm/files/patch-aa
new file mode 100644
index 000000000000..27089b18f94b
--- /dev/null
+++ b/www/adzap2squirm/files/patch-aa
@@ -0,0 +1,39 @@
+--- a2swrap.orig Fri Jul 18 20:57:46 2003
++++ a2swrap Tue Sep 2 21:48:35 2003
+@@ -19,10 +19,10 @@
+ #
+ #ZAP_BASE: the base URL for the replacement files.
+ # DEFAULT: http://adzap.cs.zip.com.au
+-export ZAP_BASE=http://192.168.0.10/zaps
++# export ZAP_BASE=http://192.168.0.10/zaps
+ #ZAP_BASE_SSL: the base URL for replacement files via HTTPS
+ # DEFAULT: https://adzap.cs.zip.com.au
+-export ZAP_BASE_SSL=http://192.168.0.10/zaps
++# export ZAP_BASE_SSL=http://192.168.0.10/zaps
+ #STUBURL_*: replacement URLs for the various classes recognized
+ # by adzapper
+ # DEFAULT: same as the adzapper defaults
+@@ -30,7 +30,7 @@
+ # this would be the latest version of the adzapper script as downloaded
+ # from the homepage.
+ # default: squid_redirect
+-export A2S_PTNFILE=patterns
++# export A2S_PTNFILE=patterns
+ #A2S_PREFILE: a filename to read for patterns before the main pattern
+ # file. If the file is not present it will be silently skipped.
+ # DEFAULT: prezap
+@@ -42,7 +42,7 @@
+ #A2S_OUTFILE: the filename to which the Squirm configuration will be
+ # written.
+ # DEFAULT: squirm.patterns
+-export A2S_OUTFILE=/usr/local/squirm/etc/squirm.patterns
++export A2S_OUTFILE=%%PREFIX%%/etc/squirm/zap.patterns
+ #A2S_CREATEACCELS: set to "false" to disable the creation of accelerator
+ # strings for Squirm. Note that since v1.23, Squirm attempts to create
+ # accelerators for patterns which do not have them specified in the pattern
+@@ -60,4 +60,4 @@
+
+ export ZAP_MODE="CLEAR"
+
+-./adzap2squirm
++%%PREFIX%%/bin/adzap2squirm
diff --git a/www/adzap2squirm/files/patch-ab b/www/adzap2squirm/files/patch-ab
new file mode 100644
index 000000000000..8e2fd275f698
--- /dev/null
+++ b/www/adzap2squirm/files/patch-ab
@@ -0,0 +1,23 @@
+--- update-zapper.orig Sun Jan 5 05:28:38 2003
++++ update-zapper Tue Sep 2 23:01:53 2003
+@@ -8,15 +8,16 @@
+ #
+
+ masterurl=http://adzapper.sourceforge.net/scripts/squid_redirect
+-zapper=/usr/local/etc/squid_redirect ## hack to suit your site
+-pidfile=/var/run/squid-noads.pid ## hack to suit, again
++zapper=%%PREFIX%%/etc/squirm/squid_redirect ## hack to suit your site
++pidfile=%%PREFIX%%/squid/logs/squid.pid ## hack to suit, again
+
+ tmp=/tmp/newzapper$$
+-if wget -q --cache=off -O $tmp "$masterurl"
++if %%FETCH_CMD%% -q -o $tmp "$masterurl"
+ then
+ [ ! -s "$tmp" ] \
+ || cmp -s "$tmp" "$zapper" \
+- || ( cat "$tmp" >"$zapper" || exit 1
++ || ( cat "$tmp" | sed -e "s@\|)@\|\.\*)@g" -e "s@(\|@(\.\*\|@g" >"$zapper" || exit 1
++ (cd %%PREFIX%%/etc/squirm && %%PREFIX%%/bin/a2swrap)
+ [ -s "$pidfile" ] && kill -1 `cat "$pidfile"`
+ )
+ fi
diff --git a/www/adzap2squirm/files/pkg-message b/www/adzap2squirm/files/pkg-message
new file mode 100644
index 000000000000..e5dddc527a7d
--- /dev/null
+++ b/www/adzap2squirm/files/pkg-message
@@ -0,0 +1,20 @@
+********************************************************
+ In order to block ads, you must first setup squirm.conf
+ An example is in:
+
+ %%PREFIX%%/etc/squirm/squirm.conf.zap
+
+ You must also setup squid to use squirm if you have not
+ done so. Add this to %%PREFIX%%/etc/squid/squid.conf:
+
+ redirect_program: %%PREFIX%%/bin/squirm
+
+ Then run from the command line:
+
+ %%PREFIX%%/bin/update-zapper
+
+This port installs a script (%%PREFIX%%/update-zapper)
+which will update the ad definitions, and restart squid
+if there are new ones available. Add this to root's
+crontab to easily keep your ad definitions up to date.
+********************************************************
diff --git a/www/adzap2squirm/files/squirm.conf.zap b/www/adzap2squirm/files/squirm.conf.zap
new file mode 100644
index 000000000000..003f91aa3c1b
--- /dev/null
+++ b/www/adzap2squirm/files/squirm.conf.zap
@@ -0,0 +1,7 @@
+begin
+network 127.0.0.0/24
+# ADD YOUR NETWORKS HERE
+log squirm/logs/match.log
+abort-log squirm/logs/abort.log
+pattern zap.patterns get
+end
diff --git a/www/adzap2squirm/pkg-descr b/www/adzap2squirm/pkg-descr
new file mode 100644
index 000000000000..48a680f74406
--- /dev/null
+++ b/www/adzap2squirm/pkg-descr
@@ -0,0 +1,6 @@
+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.
+
+WWW: http://www.meredevice.com/adzap2squirm.html
diff --git a/www/adzap2squirm/pkg-plist b/www/adzap2squirm/pkg-plist
new file mode 100644
index 000000000000..d338b7c26c74
--- /dev/null
+++ b/www/adzap2squirm/pkg-plist
@@ -0,0 +1,5 @@
+bin/a2swrap
+bin/adzap2squirm
+bin/update-zapper
+etc/squirm/squirm.conf.zap
+etc/squirm/zap.patterns