diff options
author | pgollucci <pgollucci@FreeBSD.org> | 2009-07-20 13:31:08 +0800 |
---|---|---|
committer | pgollucci <pgollucci@FreeBSD.org> | 2009-07-20 13:31:08 +0800 |
commit | f4b980f82eb9c9cbd93543ca2dcf5efb26906ba6 (patch) | |
tree | 0f0021faaebb76e915d26ba33c6705418e7ff583 /www | |
parent | b1edce0fcb26f106ca122f12f5de984a4d729f62 (diff) | |
download | freebsd-ports-gnome-f4b980f82eb9c9cbd93543ca2dcf5efb26906ba6.tar.gz freebsd-ports-gnome-f4b980f82eb9c9cbd93543ca2dcf5efb26906ba6.tar.zst freebsd-ports-gnome-f4b980f82eb9c9cbd93543ca2dcf5efb26906ba6.zip |
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.
PR: ports/136628
Submitted by: Guido Falsi <mad@madpilot.net> (maintainer)
Diffstat (limited to 'www')
-rw-r--r-- | www/squidguard/Makefile | 36 | ||||
-rw-r--r-- | www/squidguard/files/pkg-deinstall.in | 11 | ||||
-rw-r--r-- | www/squidguard/files/pkg-message.in | 3 | ||||
-rw-r--r-- | www/squidguard/pkg-plist | 26 |
4 files changed, 48 insertions, 28 deletions
diff --git a/www/squidguard/Makefile b/www/squidguard/Makefile index 6de5795b142b..147a6e59609e 100644 --- a/www/squidguard/Makefile +++ b/www/squidguard/Makefile @@ -7,6 +7,7 @@ PORTNAME= squidGuard PORTVERSION= 1.4 +PORTREVISION= 1 CATEGORIES= www MASTER_SITES= http://www.squidguard.org/Downloads/ @@ -24,28 +25,47 @@ CONFIGURE_ARGS= --with-db-inc=${BDB_INCLUDE_DIR} \ --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 @@ post-patch: 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 @@ pre-install: # # 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 --git a/www/squidguard/files/pkg-deinstall.in b/www/squidguard/files/pkg-deinstall.in new file mode 100644 index 000000000000..a73302cf2387 --- /dev/null +++ b/www/squidguard/files/pkg-deinstall.in @@ -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 --git a/www/squidguard/files/pkg-message.in b/www/squidguard/files/pkg-message.in index 94a91e8c7c72..ed83a6222f04 100644 --- a/www/squidguard/files/pkg-message.in +++ b/www/squidguard/files/pkg-message.in @@ -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 --git a/www/squidguard/pkg-plist b/www/squidguard/pkg-plist index f9bd90193d2e..678984387c20 100644 --- a/www/squidguard/pkg-plist +++ b/www/squidguard/pkg-plist @@ -32,51 +32,30 @@ etc/squid/squidGuard.conf.sample %%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 @@ etc/squid/squidGuard.conf.sample %%BLACKLIST%%@dirrm violence %%BLACKLIST%%@dirrm warez %%BLACKLIST%%@cwd / -%%BLACKLIST%%@dirrm %%DATADIR%% +%%BLACKLIST%%@dirrm %%SAMPLE_BL_DIR%% +%%BLACKLIST%%@dirrmtry %%DATADIR%% |