- update to DansGuardian 2.12.0.3, modified from a diff from abieber
- add an rc script - fix incompatibility with pcre 8.3+, patch from Debian - distfiles are now on sourceforge - drop maintainer; no response to emails ok abieber@
This commit is contained in:
parent
160d47c6c1
commit
380b37f4a7
@ -1,39 +1,37 @@
|
||||
# $OpenBSD: Makefile,v 1.13 2012/04/28 10:52:09 ajacoutot Exp $
|
||||
# $OpenBSD: Makefile,v 1.14 2013/01/18 15:04:09 sthen Exp $
|
||||
|
||||
COMMENT = content scanning web filter
|
||||
DISTNAME = dansguardian-2.10.1.1
|
||||
DISTNAME = dansguardian-2.12.0.3
|
||||
EXTRACT_SUFX = .tar.bz2
|
||||
CATEGORIES = www net
|
||||
|
||||
HOMEPAGE = http://www.dansguardian.org/
|
||||
|
||||
MAINTAINER = Bartosz Kuzma <bartosz.kuzma@gmail.com>
|
||||
|
||||
# GPLv2+
|
||||
PERMIT_PACKAGE_CDROM = Yes
|
||||
PERMIT_PACKAGE_FTP = Yes
|
||||
PERMIT_DISTFILES_CDROM =Yes
|
||||
PERMIT_DISTFILES_FTP = Yes
|
||||
|
||||
WANTLIB = c execinfo m pcre pcreposix stdc++ z
|
||||
WANTLIB = c m pcre pcreposix stdc++ z
|
||||
|
||||
# This is deliberately not downloaded directly from the author's
|
||||
# master site, since although it is GPL code, the author only
|
||||
# grants commercial users permission to download it *once* from
|
||||
# official sources. http://dansguardian.org/?page=copyright2
|
||||
MASTER_SITES = http://spacehopper.org/mirrors/
|
||||
#MASTER_SITES = http://dansguardian.org/downloads/2/Stable/
|
||||
MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=dansguardian/}
|
||||
|
||||
LIB_DEPENDS = devel/pcre \
|
||||
devel/libexecinfo
|
||||
LIB_DEPENDS = devel/pcre
|
||||
|
||||
CONFIGURE_STYLE = gnu
|
||||
CONFIGURE_ENV = CPPFLAGS="-I${LOCALBASE}/include" \
|
||||
LDFLAGS="-L${LOCALBASE}/lib"
|
||||
CONFIGURE_ARGS = --with-proxygroup=_dansguardian \
|
||||
--with-proxyuser=_dansguardian \
|
||||
--enable-segv-backtrace \
|
||||
--enable-segv-backtrace=no \
|
||||
--enable-clamd
|
||||
USE_GROFF = Yes
|
||||
|
||||
FLAVORS = debug
|
||||
FLAVOR ?=
|
||||
.if ${FLAVOR:Mdebug}
|
||||
CONFIGURE_ARGS += --with-dgdebug
|
||||
.endif
|
||||
|
||||
FAKE_FLAGS += DGCONFDIR=${PREFIX}/share/examples/dansguardian \
|
||||
rel_group=_dansguardian rel_user=_dansguardian
|
||||
|
@ -1,5 +1,2 @@
|
||||
MD5 (dansguardian-2.10.1.1.tar.gz) = CYehyb+985gRg4bxAnlhGg==
|
||||
RMD160 (dansguardian-2.10.1.1.tar.gz) = 3BXKl3mlCExeQkhUXHMPJf/yQaM=
|
||||
SHA1 (dansguardian-2.10.1.1.tar.gz) = /zAS4BEwsiaVgsIcPutOoBPclnk=
|
||||
SHA256 (dansguardian-2.10.1.1.tar.gz) = wkXVjPN/efio5QtoTWK3l6n2zhu3deFAlpAC3/fhH5I=
|
||||
SIZE (dansguardian-2.10.1.1.tar.gz) = 516800
|
||||
SHA256 (dansguardian-2.12.0.3.tar.bz2) = x06aMrl/mpoFb87T2iP+SPyivGqpr2cK/ppT3IGUFPU=
|
||||
SIZE (dansguardian-2.12.0.3.tar.bz2) = 577701
|
||||
|
@ -1,11 +0,0 @@
|
||||
$OpenBSD: patch-data_Makefile_in,v 1.3 2010/06/11 12:41:13 sthen Exp $
|
||||
--- data/Makefile.in.orig Fri Jun 5 10:45:54 2009
|
||||
+++ data/Makefile.in Sun Apr 18 17:48:48 2010
|
||||
@@ -491,7 +491,6 @@ uninstall-am: uninstall-local
|
||||
|
||||
install-data-local:
|
||||
$(mkinstalldirs) $(DESTDIR)$(DATATOPDIR) && \
|
||||
- $(mkinstalldirs) $(DESTDIR)$(DGLOGLOCATION) && \
|
||||
$(mkinstalldirs) $(DESTDIR)$(DGPIDDIR) && \
|
||||
for l in $(FLISTS) ; do \
|
||||
echo "$(INSTALL_DATA) $$l $(DESTDIR)$(DATATOPDIR)/$$l"; \
|
44
www/dansguardian/patches/patch-src_RegExp_cpp
Normal file
44
www/dansguardian/patches/patch-src_RegExp_cpp
Normal file
@ -0,0 +1,44 @@
|
||||
$OpenBSD: patch-src_RegExp_cpp,v 1.1 2013/01/18 15:04:09 sthen Exp $
|
||||
|
||||
pcre 8.30 fix, from Debian
|
||||
|
||||
--- src/RegExp.cpp.orig Wed Jan 16 21:13:58 2013
|
||||
+++ src/RegExp.cpp Wed Jan 16 21:15:43 2013
|
||||
@@ -146,14 +146,17 @@ bool RegExp::match(const char *text)
|
||||
offsets.clear();
|
||||
lengths.clear();
|
||||
imatched = false;
|
||||
- regmatch_t *pmatch = new regmatch_t[reg.re_nsub + 1]; // to hold result
|
||||
+ int num_sub_expressions = MAX_SUB_EXPRESSIONS;
|
||||
+ if(reg.re_nsub < num_sub_expressions)
|
||||
+ num_sub_expressions = reg.re_nsub;
|
||||
+ regmatch_t *pmatch = new regmatch_t[num_sub_expressions + 1]; // to hold result
|
||||
if (!pmatch) { // if it failed
|
||||
delete[]pmatch;
|
||||
imatched = false;
|
||||
return false;
|
||||
// exception?
|
||||
}
|
||||
- if (regexec(®, pos, reg.re_nsub + 1, pmatch, 0)) { // run regex
|
||||
+ if (regexec(®, pos, num_sub_expressions + 1, pmatch, 0)) { // run regex
|
||||
delete[]pmatch;
|
||||
imatched = false;
|
||||
// #ifdef DGDEBUG
|
||||
@@ -167,7 +170,7 @@ bool RegExp::match(const char *text)
|
||||
int error = 0;
|
||||
while (error == 0) {
|
||||
largestoffset = 0;
|
||||
- for (i = 0; i <= (signed) reg.re_nsub; i++) {
|
||||
+ for (i = 0; i <= (signed) num_sub_expressions; i++) {
|
||||
if (pmatch[i].rm_so != -1) {
|
||||
matchlen = pmatch[i].rm_eo - pmatch[i].rm_so;
|
||||
submatch = new char[matchlen + 1];
|
||||
@@ -184,7 +187,7 @@ bool RegExp::match(const char *text)
|
||||
}
|
||||
if (largestoffset > 0) {
|
||||
pos += largestoffset;
|
||||
- error = regexec(®, pos, reg.re_nsub + 1, pmatch, REG_NOTBOL);
|
||||
+ error = regexec(®, pos, num_sub_expressions + 1, pmatch, REG_NOTBOL);
|
||||
} else {
|
||||
error = -1;
|
||||
}
|
14
www/dansguardian/patches/patch-src_RegExp_hpp
Normal file
14
www/dansguardian/patches/patch-src_RegExp_hpp
Normal file
@ -0,0 +1,14 @@
|
||||
$OpenBSD: patch-src_RegExp_hpp,v 1.1 2013/01/18 15:04:09 sthen Exp $
|
||||
|
||||
pcre 8.30 fix, from Debian
|
||||
|
||||
--- src/RegExp.hpp.orig Wed Jan 16 21:13:39 2013
|
||||
+++ src/RegExp.hpp Wed Jan 16 21:13:52 2013
|
||||
@@ -7,6 +7,7 @@
|
||||
#ifndef __HPP_REGEXP
|
||||
#define __HPP_REGEXP
|
||||
|
||||
+#define MAX_SUB_EXPRESSIONS 1024
|
||||
|
||||
// INCLUDES
|
||||
|
@ -1,4 +1,4 @@
|
||||
@comment $OpenBSD: PLIST,v 1.3 2010/06/11 12:41:13 sthen Exp $
|
||||
@comment $OpenBSD: PLIST,v 1.4 2013/01/18 15:04:09 sthen Exp $
|
||||
@conflict dansguardian-*-clamav
|
||||
@pkgpath www/dansguardian,clamav
|
||||
@newgroup _dansguardian:588
|
||||
@ -6,6 +6,7 @@
|
||||
@man man/man8/dansguardian.8
|
||||
@bin sbin/dansguardian
|
||||
share/dansguardian/
|
||||
share/dansguardian/blockedflash.swf
|
||||
share/dansguardian/dansguardian.pl
|
||||
share/dansguardian/languages/
|
||||
share/dansguardian/languages/arspanish/
|
||||
@ -174,6 +175,10 @@ share/examples/dansguardian/lists/bannedregexpheaderlist
|
||||
@sample ${SYSCONFDIR}/dansguardian/lists/bannedregexpheaderlist
|
||||
share/examples/dansguardian/lists/bannedregexpurllist
|
||||
@sample ${SYSCONFDIR}/dansguardian/lists/bannedregexpurllist
|
||||
share/examples/dansguardian/lists/bannedrooms/
|
||||
@sample ${SYSCONFDIR}/dansguardian/lists/bannedrooms/
|
||||
share/examples/dansguardian/lists/bannedrooms/default
|
||||
@sample ${SYSCONFDIR}/dansguardian/lists/bannedrooms/default
|
||||
share/examples/dansguardian/lists/bannedsitelist
|
||||
@sample ${SYSCONFDIR}/dansguardian/lists/bannedsitelist
|
||||
share/examples/dansguardian/lists/bannedurllist
|
||||
@ -400,6 +405,8 @@ share/examples/dansguardian/lists/phraselists/pornography/weighted_portuguese
|
||||
@sample ${SYSCONFDIR}/dansguardian/lists/phraselists/pornography/weighted_portuguese
|
||||
share/examples/dansguardian/lists/phraselists/pornography/weighted_russian
|
||||
@sample ${SYSCONFDIR}/dansguardian/lists/phraselists/pornography/weighted_russian
|
||||
share/examples/dansguardian/lists/phraselists/pornography/weighted_russian_utf8
|
||||
@sample ${SYSCONFDIR}/dansguardian/lists/phraselists/pornography/weighted_russian_utf8
|
||||
share/examples/dansguardian/lists/phraselists/pornography/weighted_spanish
|
||||
@sample ${SYSCONFDIR}/dansguardian/lists/phraselists/pornography/weighted_spanish
|
||||
share/examples/dansguardian/lists/phraselists/pornography/weighted_swedish
|
||||
@ -466,3 +473,6 @@ share/examples/dansguardian/lists/weightedphraselist
|
||||
@owner _dansguardian
|
||||
@group _dansguardian
|
||||
@sample /var/log/dansguardian/
|
||||
@owner
|
||||
@group
|
||||
@rcscript ${RCDIR}/dansguardian
|
||||
|
9
www/dansguardian/pkg/dansguardian.rc
Normal file
9
www/dansguardian/pkg/dansguardian.rc
Normal file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $OpenBSD: dansguardian.rc,v 1.1 2013/01/18 15:04:09 sthen Exp $
|
||||
|
||||
daemon="${TRUEPREFIX}/sbin/dansguardian"
|
||||
|
||||
. /etc/rc.d/rc.subr
|
||||
|
||||
rc_cmd $1
|
Loading…
Reference in New Issue
Block a user