diff options
author | bapt <bapt@FreeBSD.org> | 2011-05-07 23:13:53 +0800 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2011-05-07 23:13:53 +0800 |
commit | c1cfa5d5c94fe3093c76816644d2176831979bf2 (patch) | |
tree | 0b67b329b93c5c3c6709bc8f95a44c9645256f95 | |
parent | 75cb2abe95caaea3c245deb83615812d3c82b736 (diff) | |
download | freebsd-ports-gnome-c1cfa5d5c94fe3093c76816644d2176831979bf2.tar.gz freebsd-ports-gnome-c1cfa5d5c94fe3093c76816644d2176831979bf2.tar.zst freebsd-ports-gnome-c1cfa5d5c94fe3093c76816644d2176831979bf2.zip |
adsuck is a DNS relay that returns NXdomain for hosts that match names in a
blacklist for quick and non browser plugin based ad blocking.
WWW: http://opensource.conformal.com/wiki/Adsuck
PR: ports/156644
Submitted by: Philippe Pepiot <phil@philpep.org>
-rw-r--r-- | GIDs | 1 | ||||
-rw-r--r-- | UIDs | 1 | ||||
-rw-r--r-- | dns/Makefile | 1 | ||||
-rw-r--r-- | dns/adsuck/Makefile | 41 | ||||
-rw-r--r-- | dns/adsuck/distinfo | 2 | ||||
-rw-r--r-- | dns/adsuck/files/adsuck.in | 27 | ||||
-rw-r--r-- | dns/adsuck/files/patch-adsuck.c | 13 | ||||
-rw-r--r-- | dns/adsuck/files/patch-log.c | 5 | ||||
-rw-r--r-- | dns/adsuck/files/pkg-message.in | 21 | ||||
-rw-r--r-- | dns/adsuck/pkg-deinstall | 15 | ||||
-rw-r--r-- | dns/adsuck/pkg-descr | 4 | ||||
-rw-r--r-- | dns/adsuck/pkg-plist | 11 |
12 files changed, 142 insertions, 0 deletions
@@ -100,6 +100,7 @@ aprsd:*:240: tnc:*:241: prosody:*:242: fcron:*:247: +_adsuck:*:253 _tor:*:256: meta1s:*:260: meta1q:*:261: @@ -109,6 +109,7 @@ aprsd:*:240:240::0:0:aprsd:/nonexistent:/bin/sh tnc:*:241:241::0:0:aprsd:/nonexistent:/bin/sh prosody:*:242:242::0:0:Prosody Jabber Server:/nonexistent:/usr/sbin/nologin fcron:*:247:247::0:0:fcron pseudo-user:/nonexistent:/usr/sbin/nologin +_adsuck:*:253:253::0:0:Adsuck ad blocking user:/nonexistent:/usr/sbin/nologin _tor:*:256:256::0:0:Tor anonymising router:/var/db/tor:/bin/sh meta1s:*:260:260::0:0:MeTA1 SMTPS:/nonexistent:/usr/sbin/nologin meta1q:*:261:261::0:0:MeTA1 QMGR:/nonexistent:/usr/sbin/nologin diff --git a/dns/Makefile b/dns/Makefile index a11ef9764202..2095eaaeea49 100644 --- a/dns/Makefile +++ b/dns/Makefile @@ -4,6 +4,7 @@ COMMENT = Domain Name Service tools SUBDIR += adns + SUBDIR += adsuck SUBDIR += ares SUBDIR += autotrust SUBDIR += bind-tools diff --git a/dns/adsuck/Makefile b/dns/adsuck/Makefile new file mode 100644 index 000000000000..468798a30d55 --- /dev/null +++ b/dns/adsuck/Makefile @@ -0,0 +1,41 @@ +# New ports collection makefile for: adsuck +# Date created: 25 April 2011 +# Whom: Philippe Pepiot <phil@philpep.org> +# +# $FreeBSD$ + +PORTNAME= adsuck +PORTVERSION= 2.3 +CATEGORIES= dns +MASTER_SITES= http://opensource.conformal.com/snapshots/adsuck/ \ + http://philpep.org/pub/ +EXTRACT_SUFX= .tgz + +MAINTAINER= phil@philpep.org +COMMENT= DNS relay for ad blocking + +LICENSE= BSD + +LIB_DEPENDS+= event-1.4:${PORTSDIR}/devel/libevent \ + ldns:${PORTSDIR}/dns/ldns + +USE_RC_SUBR= adsuck + +USERS= _adsuck +GROUPS= _adsuck + +SUB_FILES+= pkg-message + +MAN8= adsuck.8 +MANCOMPRESSED= yes + +do-install: + @${INSTALL_PROGRAM} ${WRKSRC}/adsuck ${PREFIX}/sbin/ + @${INSTALL_MAN} ${WRKSRC}/${MAN8}.gz ${MANPREFIX}/man/man8/ + +post-install: + @${MKDIR} ${EXAMPLESDIR} + @${INSTALL_DATA} ${WRKSRC}/files/* ${EXAMPLESDIR} + @${CAT} ${PKGMESSAGE} + +.include <bsd.port.mk> diff --git a/dns/adsuck/distinfo b/dns/adsuck/distinfo new file mode 100644 index 000000000000..e71946ade2dd --- /dev/null +++ b/dns/adsuck/distinfo @@ -0,0 +1,2 @@ +SHA256 (adsuck-2.3.tgz) = 668367ef17eb4a5745b7af8e8ee359ced213d5dedc82c273be711440bd96a9ed +SIZE (adsuck-2.3.tgz) = 2320307 diff --git a/dns/adsuck/files/adsuck.in b/dns/adsuck/files/adsuck.in new file mode 100644 index 000000000000..966af0637698 --- /dev/null +++ b/dns/adsuck/files/adsuck.in @@ -0,0 +1,27 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: adsuck +# REQUIRE: DAEMON +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable adsuck: +# +# adsuck_enable (bool): Set to NO by default. + +. /etc/rc.subr + +name="adsuck" +rcvar=${name}_enable + +command=%%PREFIX%%/sbin/${name} +extra_commands="reload" + +load_rc_config $name + +: ${adsuck_enable="NO"} +: ${adsuck_flags="-c /var/adsuck -f resolv.conf -r regex Hosts.blc Hosts.pub Hosts.rsk Hosts.trc hosts.small hosts.yoyo"} + +run_rc_command "$1" diff --git a/dns/adsuck/files/patch-adsuck.c b/dns/adsuck/files/patch-adsuck.c new file mode 100644 index 000000000000..9e0aa60666d5 --- /dev/null +++ b/dns/adsuck/files/patch-adsuck.c @@ -0,0 +1,13 @@ +--- adsuck.c.orig 2011-04-14 20:36:30.000000000 +0200 ++++ adsuck.c 2011-04-22 13:54:41.350251199 +0200 +@@ -33 +33,2 @@ +-#ifndef __linux__ ++#include <signal.h> ++#include <limits.h> +@@ -35,4 +35,0 @@ +-#include <sys/queue.h> +-#else +-#include <linux/limits.h> +-#include "linux/tree.h" +@@ -40 +36,0 @@ +-#endif diff --git a/dns/adsuck/files/patch-log.c b/dns/adsuck/files/patch-log.c new file mode 100644 index 000000000000..d99f3608c6e6 --- /dev/null +++ b/dns/adsuck/files/patch-log.c @@ -0,0 +1,5 @@ +--- log.c.orig 2009-03-05 00:05:59.000000000 +0100 ++++ log.c 2011-04-22 13:41:48.193968412 +0200 +@@ -160 +160 @@ +- if (getnameinfo(sa, SA_LEN(sa), buf, sizeof(buf), NULL, 0, ++ if (getnameinfo(sa, 0, buf, sizeof(buf), NULL, 0, diff --git a/dns/adsuck/files/pkg-message.in b/dns/adsuck/files/pkg-message.in new file mode 100644 index 000000000000..cc377f4315c1 --- /dev/null +++ b/dns/adsuck/files/pkg-message.in @@ -0,0 +1,21 @@ + + +Quick way to use adsuck chrooted in /var/adsuck + +mkdir /var/adsuck +cp %%EXAMPLESDIR%%/* /var/adsuck + +# Adsuck forward to your old dns server +cp /etc/resolv.conf /var/adsuck + +# Enable and start adsuck +echo adsuck_enable=\"YES\" >> /etc/rc.conf +/usr/local/etc/rc.d/adsuck start + +# Use adsuck as dns server +echo "nameserver 127.0.0.1" > /etc/resolv.conf + +If you're using DHCP consider configuring your dhclient.conf(5) to prevent +resolv.conf updates. + + diff --git a/dns/adsuck/pkg-deinstall b/dns/adsuck/pkg-deinstall new file mode 100644 index 000000000000..b9e79cff364c --- /dev/null +++ b/dns/adsuck/pkg-deinstall @@ -0,0 +1,15 @@ +#!/bin/sh + +if [ "$2" != "POST-DEINSTALL" ]; then + exit 0 +fi + +if pw groupshow _adsuck 2>/dev/null 1>&2; then + echo "To delete the '_adsuck' group permanently, use 'pw groupdel _adsuck'" +fi + +if pw usershow _adsuck 2>/dev/null 1>&2; then + echo "To delete the '_adsuck' user permanently, use 'pw userdel _adsuck'" +fi + +exit 0 diff --git a/dns/adsuck/pkg-descr b/dns/adsuck/pkg-descr new file mode 100644 index 000000000000..97c22e4477ef --- /dev/null +++ b/dns/adsuck/pkg-descr @@ -0,0 +1,4 @@ +adsuck is a DNS relay that returns NXdomain for hosts that match names in a +blacklist for quick and non browser plugin based ad blocking. + +WWW: http://opensource.conformal.com/wiki/Adsuck diff --git a/dns/adsuck/pkg-plist b/dns/adsuck/pkg-plist new file mode 100644 index 000000000000..92dda15e716f --- /dev/null +++ b/dns/adsuck/pkg-plist @@ -0,0 +1,11 @@ +sbin/adsuck +%%EXAMPLESDIR%%/Hosts.blc +%%EXAMPLESDIR%%/Hosts.pub +%%EXAMPLESDIR%%/Hosts.rsk +%%EXAMPLESDIR%%/Hosts.trc +%%EXAMPLESDIR%%/README +%%EXAMPLESDIR%%/hosts.small +%%EXAMPLESDIR%%/hosts.yoyo +%%EXAMPLESDIR%%/regex +%%EXAMPLESDIR%%/resolv.conf +@dirrm %%EXAMPLESDIR%% |