From mad@madpilot.net  Thu May 26 10:50:28 2011
Return-Path: <mad@madpilot.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DB374106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 26 May 2011 10:50:28 +0000 (UTC)
	(envelope-from mad@madpilot.net)
Received: from megatron.madpilot.net (megatron.madpilot.net [88.149.173.206])
	by mx1.freebsd.org (Postfix) with ESMTP id 066DB8FC0C
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 26 May 2011 10:50:27 +0000 (UTC)
Received: from megatron.madpilot.net (localhost [127.0.0.1])
	by megatron.madpilot.net (Postfix) with ESMTP id 159441A90;
	Thu, 26 May 2011 12:50:27 +0200 (CEST)
Received: from megatron.madpilot.net ([127.0.0.1])
	by megatron.madpilot.net (megatron.madpilot.net [127.0.0.1]) (amavisd-new, port 10026)
	with ESMTP id HNCu5ENflzHY; Thu, 26 May 2011 12:50:23 +0200 (CEST)
Received: by megatron.madpilot.net (Postfix, from userid 1000)
	id CBE371A85; Thu, 26 May 2011 12:50:23 +0200 (CEST)
Message-Id: <20110526105023.GA67841@megatron.madpilot.net>
Date: Thu, 26 May 2011 12:50:23 +0200
From: Guido Falsi <mad@madpilot.net>
To: Matthias Andree <mandree@FreeBSD.org>
Cc: FreeBSD-gnats-submit@freebsd.org
In-Reply-To: <E1QPX5z-0005P8-Vc@apollo.emma.line.org>
Subject: Re: www/squidguard: lacks patches and needs BDB updates
References: <E1QPX5z-0005P8-Vc@apollo.emma.line.org>

>Number:         157343
>Category:       ports
>Synopsis:       Re: www/squidguard: lacks patches and needs BDB updates
>Confidential:   yes
>Severity:       serious
>Priority:       medium
>Responsible:    mandree
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 26 11:00:17 UTC 2011
>Closed-Date:    Thu May 26 12:23:07 UTC 2011
>Last-Modified:  Thu May 26 12:30:18 UTC 2011
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 --0OAP2g/MAC+5xKAE
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 On Thu, May 26, 2011 at 11:43:11AM +0200, Matthias Andree wrote:
 > >Description:
 > Dear maintainer,
 > 
 > I've recently relied on the fact that your port set USE_BDB=3+.
 > Apparently this was bogus, the port build fails with BDB 4.0 or newer.
 
 Unluckily it failed with just 4.0, as you noticed too, because of a
 patch which should have taken care of that (files/patch-src_sgDB.c) that
 was plainly wrong, my fault. I filed PR ports/157340 shortly before
 getting this one from you to solve this.
 
 > 
 > Also, the port lacks the 2009 patches from
 > http://www.squidguard.org/Downloads/Patches/1.4/
 
 No, those are included in normal patches in files. I had to do that
 because the "patches" on that url are archieves containing the whole
 file, not real patches, and I would have had to add some quirk in the
 port's Makefile to directly use those.
 
 You can check this by looking at the files:
 files/patch-src__sgLog.c
 files/patch-src__sg.h.in
 files/patch-src__sgDiv.c.in
 
 And looking at the diff of the relevant files from the patches after
 make patch.
 
 Also, here is the relevant commit:
 
 http://www.freshports.org/commit.php?category=www&port=squidguard&files=yes&message_id=200910222301.n9MN1s6c091848@repoman.freebsd.org
 
 > and triggers quite a
 > few warnings with portlint -C -- please review and update the port.
 
 I've checked. I also added a few more fatal ones with a
 recent(uncommitted) PR.
 
 I've fixed some, but I don't really know how to fix some others. Here
 are the resons I can't fix each of them:
 
 WARN: Makefile: possible use of absolute pathname "/var/db/${PORTNAME}".
 WARN: Makefile: possible use of absolute pathname "/var/log".
 
 I really don't know how to reference those directories using make
 variables, could not find any. If I'm wrong please correct me and I'll
 modify the port accrdingly.
 
 WARN: Makefile: possible use of absolute pathname "/DEST_CLASSES/r".
 
 This is part of a sed command line and so is a bogus warning.
 
 Also, I did file another PR (ports/157326) which adds another optional
 vendor patch.
 
 The patch in that PR performs some manipualtions on the DISTFILES
 variable depending on OPTIONS. I now see this was incorrect and have
 just modified the port to unconditionally download the patches and just
 apply them depending on options.
 
 > 
 > Berkeley DB upgrade instructions are at
 > http://download.oracle.com/docs/cd/E17076_02/html/upgrading/index.html
 > 
 > Please check with the upstream maintainer of a db4- or db5-capable
 > version or patches of/for squidGuard already exist, or contribute them
 > back.
 > 
 > If you cannot work with particular newer versions, use INVALID*
 > variables as in /usr/ports/Mk/bsd.database.mk.
 > 
 > Thank you.
 
 As said before I just noticed this and fixed that special case with BDB
 4.0.x.
 
 I'm attaching here a patch which combines the ones in ports/157326,
 ports/157340 and the additional fixes I talked about above.
 
 Thanks!
 
 -- 
 Guido Falsi <mad@madpilot.net>
 
 --0OAP2g/MAC+5xKAE
 Content-Type: text/x-diff; charset=us-ascii
 Content-Disposition: attachment; filename="sg.diff"
 
 diff -ruN squidguard.old/Makefile squidguard/Makefile
 --- squidguard.old/Makefile	2011-05-26 12:32:07.844713066 +0200
 +++ squidguard/Makefile	2011-05-26 12:41:01.843234919 +0200
 @@ -9,16 +9,21 @@
  PORTVERSION=	1.4
  PORTREVISION=	3
  CATEGORIES=	www
 -MASTER_SITES=	http://www.squidguard.org/Downloads/
 +MASTER_SITES=	http://www.squidguard.org/Downloads/ \
 +		http://www.squidguard.org/Downloads/Contrib/
 +DISTFILES=	${DISTNAME}${EXTRACT_SUFX} \
 +		squidGuard-1.4-quoted_string_support.diff \
 +		squidGuard-1.4-dnsbl.patch
 +EXTRACT_ONLY=	${DISTNAME}${EXTRACT_SUFX}
  
  MAINTAINER=	mad@madpilot.net
  COMMENT=	A fast redirector for squid
  
 +RUN_DEPENDS=	${LOCALBASE}/sbin/squid:${PORTSDIR}/www/squid
 +
  LICENSE=	GPLv2
  LICENSE_FILE=	${WRKSRC}/COPYING
  
 -RUN_DEPENDS=	${LOCALBASE}/sbin/squid:${PORTSDIR}/www/squid
 -
  USE_BDB=	40+
  HAS_CONFIGURE=	yes
  CONFIGURE_ARGS=	--with-db-inc=${BDB_INCLUDE_DIR} \
 @@ -28,9 +33,12 @@
  		--with-sg-logdir=${LOGDIR} \
  		--exec-prefix=${PREFIX}
  
 -CONFIGURE_ENV=	CFLAGS="${CFLAGS} -I${PREFIX}/include" LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib"
 +CFLAGS+=	"-I${PREFIX}/include"
 +LDFLAGS+=	"-L${LOCALBASE}/lib"
 +
 +CONFIGURE_ENV=	LDFLAGS="${LDFLAGS}"
  
 -CFGINPUT=	${.CURDIR}/files/sgcfg.in
 +CFGINPUT=	${FILESDIR}/sgcfg.in
  
  SQUID_UID?=	squid
  SQUID_GID?=	squid
 @@ -48,16 +56,11 @@
  
  OPTIONS=	SAMPLE_BL	"Install sample blacklists" On \
  		LDAP		"Enable LDAP support" Off \
 +		DNS_BL		"Enable DNS based blacklists" Off \
  		QUOTE_STRING	"Add quoted string patch" Off
  
  .include <bsd.port.pre.mk>
  
 -.if defined(WITH_QUOTE_STRING)
 -PATCH_SITES=	http://www.squidguard.org/Downloads/
 -PATCHFILES=	Contrib/squidGuard-1.4-quoted_string_support.diff
 -PATCH_DIST_STRIP=-p2
 -.endif
 -
  .if defined(WITH_LDAP)
  CONFIGURE_ARGS+=	--with-ldap
  USE_OPENLDAP=		yes
 @@ -91,6 +94,12 @@
  		${REINPLACE_CMD} -E -e 's,(db_version),\1_4002,g' \
  			${WRKSRC}/configure ; \
  	fi
 +.if defined(WITH_QUOTE_STRING)
 +	${PATCH} -d ${WRKSRC} --forward --quiet -p2 <${DISTDIR}/squidGuard-1.4-quoted_string_support.diff
 +.endif
 +.if defined(WITH_DNS_BL)
 +	${PATCH} -d ${WRKSRC} --forward --quiet -p1 <${DISTDIR}/squidGuard-1.4-dnsbl.patch
 +.endif
  
  post-build:
  .if !defined(WITHOUT_SAMPLE_BL)
 diff -ruN squidguard.old/distinfo squidguard/distinfo
 --- squidguard.old/distinfo	2011-05-26 12:32:07.844713066 +0200
 +++ squidguard/distinfo	2011-05-26 12:41:01.843234919 +0200
 @@ -1,4 +1,6 @@
  SHA256 (squidGuard-1.4.tar.gz) = 0711ce60b8e2bbba107b980fed446a88df35e1584b39f079c0cae54a172c5141
  SIZE (squidGuard-1.4.tar.gz) = 1968492
 -SHA256 (Contrib/squidGuard-1.4-quoted_string_support.diff) = 510c2ac13e7211d019c4ab7233bedf6db3d715ebd9e35e7e3f66267cc37b5ec5
 -SIZE (Contrib/squidGuard-1.4-quoted_string_support.diff) = 13593
 +SHA256 (squidGuard-1.4-quoted_string_support.diff) = 510c2ac13e7211d019c4ab7233bedf6db3d715ebd9e35e7e3f66267cc37b5ec5
 +SIZE (squidGuard-1.4-quoted_string_support.diff) = 13593
 +SHA256 (squidGuard-1.4-dnsbl.patch) = e1e656573cf3525e69d38db67945c34fbe8b13aa46c3bff0cd946b41be8aec44
 +SIZE (squidGuard-1.4-dnsbl.patch) = 9481
 diff -ruN squidguard.old/files/patch-src_sgDB.c squidguard/files/patch-src_sgDB.c
 --- squidguard.old/files/patch-src_sgDB.c	2011-05-26 12:32:07.843713222 +0200
 +++ squidguard/files/patch-src_sgDB.c	2011-05-26 12:41:01.843234919 +0200
 @@ -1,27 +1,27 @@
 ---- src/sgDb.c.orig	Mon May 14 08:40:12 2001
 -+++ src/sgDb.c	Thu Dec 29 23:31:32 2005
 -@@ -97,14 +97,20 @@
 +--- src/sgDb.c.orig	2008-07-14 20:29:41.000000000 +0200
 ++++ src/sgDb.c	2011-05-26 11:04:22.106201692 +0200
 +@@ -119,14 +119,20 @@
       flag = DB_CREATE;
       if(createdb)
         flag = flag | DB_TRUNCATE;
 --    if ((ret = 
 --	 Db->dbp->open(Db->dbp, dbfile, NULL, DB_BTREE, flag, 0664)) != 0) {
 +-    if ((ret =
 +-         Db->dbp->open(Db->dbp, NULL, dbfile, NULL, DB_BTREE, flag, 0664)) != 0) {
  +    if ((ret = Db->dbp->open(Db->dbp,
 -+#if DB_VERSION_MAJOR * 10 + DB_VERSION_MINOR >= 41
 -+	 NULL,
 ++#if DB_VERSION_MINOR >= 1
 ++	NULL,
  +#endif
 -+	 dbfile, NULL, DB_BTREE, flag, 0664)) != 0) {
 ++	dbfile, NULL, DB_BTREE, flag, 0664)) != 0) {
         (void) Db->dbp->close(Db->dbp, 0);
         sgLogFatalError("Error db_open: %s", strerror(ret));
       }
     } else {
 --    if ((ret = 
 --	 Db->dbp->open(Db->dbp, dbfile, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) {
 +-    if ((ret =
 +-         Db->dbp->open(Db->dbp, NULL, dbfile, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) {
  +    if ((ret = Db->dbp->open(Db->dbp,
 -+#if DB_VERSION_MAJOR * 10 + DB_VERSION_MINOR >= 41
 -+	 NULL,
 ++#if DB_VERSION_MINOR >= 1
 ++	NULL,
  +#endif
 -+	 dbfile, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) {
 ++	dbfile, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) {
         sgLogFatalError("Error db_open: %s", strerror(ret));
       }
     }
 
 --0OAP2g/MAC+5xKAE--
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->mandree 
Responsible-Changed-By: mandree 
Responsible-Changed-When: Thu May 26 11:32:35 UTC 2011 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157343 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/157343: commit references a PR
Date: Thu, 26 May 2011 12:00:30 +0000 (UTC)

 mandree     2011-05-26 11:59:53 UTC
 
   FreeBSD ports repository
 
   Modified files:
     www/squidguard/files patch-src_sgDB.c 
   Log:
   Fix to build with db4.0. Needs revision before db60.
   
   Submitted by: Guido Falsi (maintainer)
   PR:           ports/157340
   PR:           ports/157343 (partially)
   Reported by:  pointyhat
   
   Revision  Changes    Path
   1.2       +13 -13    ports/www/squidguard/files/patch-src_sgDB.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: mandree 
State-Changed-When: Thu May 26 12:23:05 UTC 2011 
State-Changed-Why:  
Committed, with minor changes. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157343 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/157343: commit references a PR
Date: Thu, 26 May 2011 12:23:07 +0000 (UTC)

 mandree     2011-05-26 12:22:56 UTC
 
   FreeBSD ports repository
 
   Modified files:
     www/squidguard       Makefile distinfo 
   Log:
   - Add optional vendor patch which adds support for dnsbl. [1]
   - Pick assorted portlints [2], [3]
   - Add -I${LOCALBASE}/include to fix WITH_LDAP build [3]
   - MKDIR configuration directory to fix install from scratch [3]
   - DISTFILE/MASTER_SITE matching [3]
   - Bump PORTREVISION [3]
   
   Suggested by: Davide D'Amico <davide.damico@gmail.com> (with patch) [1]
   Submitted by: Guido Falsi (maintainer) [2]
   Suggested by: mandree [3]
   PR:           ports/157326 [1], [2]
   PR:           ports/157338 [3]
   PR:           ports/157343 [2]
   
   Revision  Changes    Path
   1.32      +23 -14    ports/www/squidguard/Makefile
   1.8       +4 -2      ports/www/squidguard/distinfo
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
