Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Jul 2009 11:39:17 +0200
From:      Guido Falsi <mad@madpilot.net>
To:        Gianni Doe <gdoe6545@yahoo.it>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: squidGuard-1.4 + LDAP
Message-ID:  <20090709093917.GA93935@megatron.madpilot.net>
In-Reply-To: <C7AC560E-24A6-4D50-8320-BC6CFBFE2E91@yahoo.it>
References:  <C7AC560E-24A6-4D50-8320-BC6CFBFE2E91@yahoo.it>

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

--FCuugMFkClbJLl1L
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Thu, Jul 09, 2009 at 10:00:25AM +0200, Gianni Doe wrote:
> The SquidGuard port doesn't have the option to build in LDAP support
> so the 'ldapusersearch' source ACL option does not work.
> Would it be possible to include LDAP support in the port?
> Regards

Ciao,

Visto che siamo entrambi italiani, parliamo in italiano :)

E' possibilissimo, e avrei anche gia' una patch pronta, l'unico problema
e' che io non ho modo di provarla, l'ho mandato ad altre persone che
come te mi hanno richiesto questa funzione, ma poi nessuno si e' fatto
risentire per dirmi se funziona o meno.

Prima di mandarla per il commit preferirei avere almeno un riscontro.

Quindi ti allego la patch, ma ti prego, a differenza di chi ti ha
preceduto, di riferirmi se funziona correttamente, cosi' poi posso
mandarla ai committer per includerla nell'albero ufficiale.

Grazie a te, e mi spiace non avere potuto applicare prima questa patch.

-- 
Guido Falsi <mad@madpilot.net>

--FCuugMFkClbJLl1L
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="squidguard.diff"

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%%

--FCuugMFkClbJLl1L--



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