Skip site navigation (1)Skip section navigation (2)
Date:      Thu,  9 Jul 2009 22:03:53 +0200 (CEST)
From:      Guido Falsi <mad@madpilot.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/136628: [maintainer-update] www/squidguard: add options, fix sample BLs, enable ldap support
Message-ID:  <20090709200353.B0AC6130C40@megatron.madpilot.net>
Resent-Message-ID: <200907092010.n69KA2oQ066949@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         136628
>Category:       ports
>Synopsis:       [maintainer-update] www/squidguard: add options, fix sample BLs, enable ldap support
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 09 20:10:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Guido Falsi
>Release:        FreeBSD 7.2-STABLE i386
>Organization:
none
>Environment:
System: FreeBSD megatron.madpilot.net 7.2-STABLE FreeBSD 7.2-STABLE #16: Thu May 7 19:33:41 CEST 2009 root@megatron.madpilot.net:/usr/obj/usr/src/sys/MEGATRON i386

>Description:

Multiple changes:

Added options to choose if sample blacklists should be installed
or not and for LDAP support.

Sample blacklists are now installed in a *.sample hierarchy and
copied other to the working one only if not present. This fixes
a problem with user blacklists being removed/overwritten on port
deinstall and update.

Patched the configure to correctly detect ldap library. This was
requested by many.

Many thanks to Gianni Doe <gdoe6545@yahoo.it> who tested the patch
and reported back ldap support is working properly.

Added file:

files/pkg-deinstall.in

>How-To-Repeat:

>Fix:

diff -ruN squidguard.old/Makefile squidguard/Makefile
--- squidguard.old/Makefile	2009-05-14 21:53:32.000000000 +0200
+++ squidguard/Makefile	2009-05-15 17:13:08.000000000 +0200
@@ -7,6 +7,7 @@
 
 PORTNAME=	squidGuard
 PORTVERSION=	1.4
+PORTREVISION=	1
 CATEGORIES=	www
 MASTER_SITES=	http://www.squidguard.org/Downloads/
 
@@ -24,28 +25,47 @@
 		--with-sg-logdir=${LOGDIR} \
 		--exec-prefix=${PREFIX}
 
+CONFIGURE_ENV=	CFLAGS="${CFLAGS} -I${PREFIX}/include"
+
 CFGINPUT=	${.CURDIR}/files/sgcfg.in
 
 SQUID_UID?=	squid
 SQUID_GID?=	squid
 
 DATADIR?=	/var/db/${PORTNAME}
+SAMPLE_BL_DIR=	${DATADIR}.sample
+PLIST_SUB+=	SAMPLE_BL_DIR=${SAMPLE_BL_DIR}
 _DATADIR=	${WRKDIR}/data
 LOGDIR?=	/var/log
 
-SUB_FILES=	pkg-message
-SUB_LIST=	PORTNAME=${PORTNAME}
+SUB_FILES=	pkg-message pkg-deinstall
+SUB_LIST=	PORTNAME=${PORTNAME} \
+		SAMPLE_BL_DIR=${SAMPLE_BL_DIR}
 PKGMESSAGE=	${WRKDIR}/pkg-message
 
+OPTIONS=	SAMPLE_BL	"Install sample blacklists" On \
+		LDAP		"Enable LDAP support" Off
+
 .include <bsd.port.pre.mk>
 
+.if defined(WITH_LDAP)
+CONFIGURE_ARGS+=	--with-ldap
+USE_OPENLDAP=		yes
+.else
+CONFIGURE_ARGS+=	--without-ldap
+.endif
+
+.if defined(WITHOUT_SAMPLE_BL)
+INSTALL_BL=	no
+PLIST_SUB+=	BLACKLIST="@comment "
+.else
 .if !exists(${DATADIR})
-PLIST_SUB+=	BLACKLIST=""
 INSTALL_BL=	yes
 .else
-PLIST_SUB+=	BLACKLIST="@comment "
 INSTALL_BL=	no
 .endif
+PLIST_SUB+=	BLACKLIST=""
+.endif
 
 pre-fetch:
 	@if [ ${SQUID_UID} = "squid" -o ${SQUID_GID} = "squid" ] ; then \
@@ -63,7 +83,7 @@
 	fi
 
 post-build:
-.if ${INSTALL_BL} == "yes"
+.if !defined(WITHOUT_SAMPLE_BL)
 	@${ECHO_MSG} "===>   Building blacklists"
 	${MKDIR} ${_DATADIR}
 	@${TAR} -C ${_DATADIR} --exclude *.diff -pxzf \
@@ -77,6 +97,12 @@
 #
 # Install blacklists
 #
+.if !defined(WITHOUT_SAMPLE_BL)
+	@${MKDIR} ${SAMPLE_BL_DIR}
+	@${CP} -Rpf ${_DATADIR}/* ${SAMPLE_BL_DIR}
+	@${CHOWN} -R ${SQUID_UID}:${SQUID_GID} ${SAMPLE_BL_DIR}
+	${CHMOD} -R 550 ${SAMPLE_BL_DIR}
+.endif
 .if ${INSTALL_BL} == "yes"
 	@${ECHO_MSG} "===>   Installing blacklists"
 	@${MKDIR} ${DATADIR}
diff -ruN squidguard.old/files/pkg-deinstall.in squidguard/files/pkg-deinstall.in
--- squidguard.old/files/pkg-deinstall.in	1970-01-01 01:00:00.000000000 +0100
+++ squidguard/files/pkg-deinstall.in	2009-05-15 17:17:26.000000000 +0200
@@ -0,0 +1,11 @@
+#!/bin/sh
+# $FreeBSD$
+
+if [ "$2" != "POST-DEINSTALL" ]; then
+    exit 0
+fi
+
+echo "If you are completely removing squidguard you may want to also"
+echo "manually delete the blacklists in %%DATADIR%%"
+
+exit 0
diff -ruN squidguard.old/files/pkg-message.in squidguard/files/pkg-message.in
--- squidguard.old/files/pkg-message.in	2009-05-14 21:53:32.000000000 +0200
+++ squidguard/files/pkg-message.in	2009-05-15 16:44:24.000000000 +0200
@@ -3,5 +3,8 @@
 = To the contain "url_rewrite_program %%PREFIX%%/bin/%%PORTNAME%%"
 = and create a configuration file for %%PORTNAME%%.
 =
+= On disinstallation if you want to completely remove the blacklists
+= you will have to manually remove what remains in %%DATADIR%%.
+= 
 = To activate the changes do a %%PREFIX%%/sbin/squid -k reconfigure
 ===================================================================
diff -ruN squidguard.old/pkg-plist squidguard/pkg-plist
--- squidguard.old/pkg-plist	2009-05-14 21:53:32.000000000 +0200
+++ squidguard/pkg-plist	2009-05-15 17:06:16.000000000 +0200
@@ -32,51 +32,30 @@
 %%PORTDOCS%%%%DOCSDIR%%/squidGuard.gif
 %%PORTDOCS%%%%DOCSDIR%%/README.blacklists
 %%PORTDOCS%%@dirrm %%DOCSDIR%%
-%%BLACKLIST%%@cwd %%DATADIR%%
+%%BLACKLIST%%@cwd %%SAMPLE_BL_DIR%%
 %%BLACKLIST%%ads/domains
-%%BLACKLIST%%ads/domains.db
 %%BLACKLIST%%ads/urls
-%%BLACKLIST%%ads/urls.db
 %%BLACKLIST%%aggressive/domains
-%%BLACKLIST%%aggressive/domains.db
 %%BLACKLIST%%aggressive/urls
-%%BLACKLIST%%aggressive/urls.db
 %%BLACKLIST%%audio-video/domains
-%%BLACKLIST%%audio-video/domains.db
 %%BLACKLIST%%audio-video/urls
-%%BLACKLIST%%audio-video/urls.db
 %%BLACKLIST%%drugs/domains
-%%BLACKLIST%%drugs/domains.db
 %%BLACKLIST%%drugs/urls
-%%BLACKLIST%%drugs/urls.db
 %%BLACKLIST%%gambling/domains
-%%BLACKLIST%%gambling/domains.db
 %%BLACKLIST%%gambling/urls
-%%BLACKLIST%%gambling/urls.db
 %%BLACKLIST%%hacking/domains
-%%BLACKLIST%%hacking/domains.db
 %%BLACKLIST%%hacking/urls
-%%BLACKLIST%%hacking/urls.db
 %%BLACKLIST%%mail/domains
-%%BLACKLIST%%mail/domains.db
 %%BLACKLIST%%porn/domains
-%%BLACKLIST%%porn/domains.db
 %%BLACKLIST%%porn/urls
-%%BLACKLIST%%porn/urls.db
 %%BLACKLIST%%porn/expressions
 %%BLACKLIST%%proxy/domains
-%%BLACKLIST%%proxy/domains.db
 %%BLACKLIST%%proxy/urls
-%%BLACKLIST%%proxy/urls.db
 %%BLACKLIST%%violence/domains
-%%BLACKLIST%%violence/domains.db
 %%BLACKLIST%%violence/urls
-%%BLACKLIST%%violence/urls.db
 %%BLACKLIST%%violence/expressions
 %%BLACKLIST%%warez/domains
-%%BLACKLIST%%warez/domains.db
 %%BLACKLIST%%warez/urls
-%%BLACKLIST%%warez/urls.db
 %%BLACKLIST%%@dirrm ads
 %%BLACKLIST%%@dirrm aggressive
 %%BLACKLIST%%@dirrm audio-video
@@ -89,4 +68,5 @@
 %%BLACKLIST%%@dirrm violence
 %%BLACKLIST%%@dirrm warez
 %%BLACKLIST%%@cwd /
-%%BLACKLIST%%@dirrm %%DATADIR%%
+%%BLACKLIST%%@dirrm %%SAMPLE_BL_DIR%%
+%%BLACKLIST%%@dirrmtry %%DATADIR%%
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090709200353.B0AC6130C40>