Update to adsuck-2.2.

Remove USE_GROFF.
("anything originated by me uses mandoc" marco@)

rc.d(8) bits by myself.
From new maintainer Gonzalo L. R. with some tweaks by me.
This commit is contained in:
ajacoutot 2011-03-18 13:13:59 +00:00
parent 162c4d100f
commit a23df3628c
7 changed files with 74 additions and 42 deletions

View File

@ -1,40 +1,40 @@
# $OpenBSD: Makefile,v 1.15 2010/11/19 22:31:32 espie Exp $
# $OpenBSD: Makefile,v 1.16 2011/03/18 13:13:59 ajacoutot Exp $
COMMENT= DNS relay for ad blocking
DISTNAME= adsuck-1.9
REVISION= 1
DISTNAME= adsuck-2.2
CATEGORIES= net
HOMEPAGE= http://opensource.conformal.com/wiki/Adsuck
MAINTAINER= Marco Peereboom <marco@openbsd.org>
MAINTAINER= Gonzalo L. R. <gonzalo@x61.com.ar>
EXTRACT_SUFX= .tgz
# BSD
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
MASTER_SITES= http://opensource.conformal.com/snapshots/adsuck/
MASTER_SITES= http://opensource.conformal.com/snapshots/adsuck/
WANTLIB= c ldns>=4.4
WANTLIB += c event ldns
LIB_DEPENDS= net/ldns/libldns>=1.6.5
MAKE_FLAGS= BINDIR="${TRUEPREFIX}/sbin" \
MANDIR="${TRUEPREFIX}/man/cat"
USE_GROFF = Yes
_files= Hosts.blc Hosts.rsk regex \
Hosts.pub Hosts.trc hosts.small resolv.conf
pre-configure:
${SUBST_CMD} ${WRKSRC}/dhclient-adsuck
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/adsuck
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/adsuck
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/adsuck
${INSTALL_DATA} ${WRKSRC}/files/README ${PREFIX}/share/doc/adsuck
${INSTALL_DATA} ${FILESDIR}/dhclient-script.diff ${PREFIX}/share/adsuck
${INSTALL_DATA} ${WRKSRC}/dhclient-adsuck ${PREFIX}/sbin
.for _f in ${_files}
${INSTALL_DATA} ${WRKSRC}/files/${_f} ${PREFIX}/share/examples/adsuck
.endfor

View File

@ -1,5 +1,5 @@
MD5 (adsuck-1.9.tgz) = eS6dCCVqyBTqcm4yAj2DrQ==
RMD160 (adsuck-1.9.tgz) = JyvQ/H7HMZVtJ7tFy5PK8KESRcg=
SHA1 (adsuck-1.9.tgz) = KVbwqrd9NAhWuqFXRGMhODZ4vc4=
SHA256 (adsuck-1.9.tgz) = vqsgWhuOTxmfVZ9dOELhM1c2M6tJea+uxGF7Sn7YeKs=
SIZE (adsuck-1.9.tgz) = 2176154
MD5 (adsuck-2.2.tgz) = sjUrhkZ5UI9K2j+Co7+R7Q==
RMD160 (adsuck-2.2.tgz) = Y45fUSjFIKdyPOv8o0R5VabMfmg=
SHA1 (adsuck-2.2.tgz) = gZ0KuXWr0b9GpZOElh58S+hAM68=
SHA256 (adsuck-2.2.tgz) = tBTm7xiSlHn9hcisRwu8ymSgaZAWlP5EnOTsw4iYhjs=
SIZE (adsuck-2.2.tgz) = 2740496

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-dhclient-adsuck,v 1.1 2011/03/18 13:13:59 ajacoutot Exp $
--- dhclient-adsuck.orig Mon Mar 14 17:05:17 2011
+++ dhclient-adsuck Fri Mar 18 13:44:22 2011
@@ -18,7 +18,7 @@
. /etc/rc.conf
-if [ "$adsuck_flags" != "NO" -a -x /usr/local/sbin/adsuck ]; then
+if [ "$adsuck_flags" != "NO" -a -x ${TRUEPREFIX}/sbin/adsuck ]; then
adsuck_resconf="/var/adsuck/files/resolv.conf"
{
@@ -31,7 +31,7 @@ if [ "$adsuck_flags" != "NO" -a -x /usr/local/sbin/ads
if pgrep adsuck > /dev/null; then
pkill -HUP adsuck
else
- /usr/local/sbin/adsuck $adsuck_flags
+ ${TRUEPREFIX}/sbin/adsuck $adsuck_flags
fi
unset new_domain_name_servers
unset new_domain_name

View File

@ -1,15 +0,0 @@
To have adsuck start at boot time, put something
like this in /etc/rc.conf.local:
adsuck_flags="-c /var/adsuck -f /files/resolv.conf /files/hosts.small"
and like this in /etc/rc.local:
if [ "$adsuck_flags" != "NO" -a -x ${TRUEPREFIX}/sbin/adsuck ]; then
echo -n ' adsuck'; ${TRUEPREFIX}/sbin/adsuck $adsuck_flags
fi
Also, be sure to set /etc/resolv.conf to contain only one
nameserver line:
nameserver 127.0.0.1

View File

@ -1,10 +1,10 @@
@comment $OpenBSD: PLIST,v 1.3 2010/11/15 18:13:45 jasper Exp $
@comment $OpenBSD: PLIST,v 1.4 2011/03/18 13:13:59 ajacoutot Exp $
@newgroup _adsuck:620
@newuser _adsuck:620:_adsuck:daemon:adsuck Daemon:/var/empty:/sbin/nologin
@man man/cat8/adsuck.0
@bin sbin/adsuck
sbin/dhclient-adsuck
share/adsuck/
share/adsuck/dhclient-script.diff
share/doc/adsuck/
share/doc/adsuck/README
share/doc/pkg-readmes/${FULLPKGNAME}
@ -25,3 +25,4 @@ share/examples/adsuck/regex
@sample /var/adsuck/files/regex
share/examples/adsuck/resolv.conf
@sample /var/adsuck/files/resolv.conf
@rcscript ${RCDIR}/adsuck

View File

@ -1,10 +1,21 @@
$OpenBSD: README,v 1.1 2010/11/15 18:13:45 jasper Exp $
$OpenBSD: README,v 1.2 2011/03/18 13:13:59 ajacoutot Exp $
To make dhclient play nice with adsuck, patching dhclient-script is necessary:
Running adsuck on OpenBSD
=========================
cd /sbin
patch -p0 < ${TRUEPREFIX}/share/adsuck/dhclient-script.diff
Running adsuck(1) locally with dhclient(8)
------------------------------------------
dhclient-script will then, providing adsuck exists and adsuck_flags != "NO"
will avoid /etc/resolv.conf and write instead /var/adsuck/files/resolv.conf,
and give adsuck a HUP to reload that file.
To make dhclient(8) play nice with adsuck(1), the following script has
been installed:
${TRUEPREFIX}/sbin/dhclient-adsuck
Provided that adsuck(1) is installed and adsuck_flags is not set to "NO"
in rc.conf.local(5), this script will prevent from using
/etc/resolv.conf to resolve non-blacklisted entries but use
/var/adsuck/files/resolv.conf instead.
Make sure that /etc/resolv.conf only contains:
nameserver 127.0.0.1

14
net/adsuck/pkg/adsuck.rc Normal file
View File

@ -0,0 +1,14 @@
#!/bin/sh
#
# $OpenBSD: adsuck.rc,v 1.1 2011/03/18 13:13:59 ajacoutot Exp $
daemon="${TRUEPREFIX}/sbin/adsuck"
daemon_flags="-c /var/adsuck -f /files/resolv.conf /files/hosts.small"
. /etc/rc.d/rc.subr
rc_reload() {
pkill -HUP -f "^${pexp}" && pkill -USR1 -f "^${pexp}"
}
rc_cmd $1