summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2002-02-09 16:39:41 +0000
committerCy Schubert <cy@FreeBSD.org>2002-02-09 16:39:41 +0000
commit6d78fe8506e721b03760ac125c7392585dc95fe7 (patch)
treee7ca29a288a5fee5450bb19a49190e9b2fdccdeb
parentThis is a PhotoCD tool collection. (diff)
Update squidguard 1.1.4 -> 1.2.0.
PR: ports/33636 Submitted by: MAINTAINER: Dan Larsson <dl@tyfon.net> Reviewed by: nectar Approved by: MAINTAINER: Dan Larsson <dl@tyfon.net>
Notes
Notes: svn path=/head/; revision=54444
Diffstat (limited to '')
-rw-r--r--www/squidguard/Makefile140
-rw-r--r--www/squidguard/distinfo2
-rw-r--r--www/squidguard/files/patch-ab46
-rw-r--r--www/squidguard/files/patch-ac15
-rw-r--r--www/squidguard/files/sgcfg.in41
-rw-r--r--www/squidguard/pkg-plist30
-rw-r--r--www/squidguard/pkg-plist.blacklist58
7 files changed, 199 insertions, 133 deletions
diff --git a/www/squidguard/Makefile b/www/squidguard/Makefile
index c798b458012b..7323536f880b 100644
--- a/www/squidguard/Makefile
+++ b/www/squidguard/Makefile
@@ -6,105 +6,125 @@
#
PORTNAME= squidGuard
-PORTVERSION= 1.1.4
+PORTVERSION= 1.2.0
CATEGORIES= www
MASTER_SITES= http://ftp.ost.eltele.no/pub/www/proxy/squidGuard/ \
ftp://ftp.ost.eltele.no/pub/www/proxy/squidGuard/
MAINTAINER= ports@tyfon.net
-BUILD_DEPENDS= ${LOCALBASE}/lib/libdb2.a:${PORTSDIR}/databases/db
+BUILD_DEPENDS= ${LOCALBASE}/lib/libdb3.so.2:${PORTSDIR}/databases/db3
RUN_DEPENDS= ${LOCALBASE}/sbin/squid:${PORTSDIR}/www/squid24
HAS_CONFIGURE= yes
-CONFIGURE_ARGS= --with-db-inc=${PREFIX}/include/db2 \
+CONFIGURE_ARGS= --with-db-inc=${PREFIX}/include/db3 \
--with-db-lib=${PREFIX}/lib \
- --with-sg-config=${PREFIX}/etc/squid/squidguard.conf \
+ --with-sg-config=${PREFIX}/etc/squid/${PORTNAME}.conf \
--with-sg-dbhome=${DATADIR} \
--with-sg-logdir=${LOGDIR}
-### To change any of the below paths add it to your make arg
-.if !defined(DATADIR)
-DATADIR= /var/db/${PORTNAME}
-.endif
-.if !defined(LOGDIR)
-LOGDIR= /var/log
-.endif
+CFGINPUT= files/sgcfg.in
-PLIST_SUB= DATADIR=${DATADIR}
+SQUID_UID?= nobody
+SQUID_GID?= nogroup
-### To optimize squidGuard add OPTIMIZE=YES to your make arg
-
-.if defined(OPTIMIZE) && ${OPTIMIZE} == YES
-CC= gcc
-CFLAGS= -pipe -O6 -Wall -fomit-frame-pointer
-.endif
+DATADIR?= /var/db/${PORTNAME}
+LOGDIR?= /var/log
-post-install:
+PLIST:= ${WRKDIR}/PLIST
+PLIST_SUB= DATADIR=${DATADIR}
-### Install documentation
+pre-fetch:
+ @if [ ${SQUID_UID} = "nobody" -o ${SQUID_GID} = "nogroup" ] ; then \
+ ${ECHO_MSG} "===> SQUID_UID is set to \"${SQUID_UID}\" and SQUID_GID is set to \"${SQUID_GID}\"." ; \
+ ${ECHO_MSG} " To change this specify them with your make arguments, e.g." ; \
+ ${ECHO_MSG} " make SQUID_UID=squid SQUID_GID=squid" ; \
+ fi
-.if !defined(NOPORTDOCS)
- @${ECHO_MSG} "===> Installing ${PORTNAME} documentation"
- -@${MKDIR} ${PREFIX}/share/doc/${PORTNAME}
-.for i in ${WRKSRC}/doc/*.txt ${WRKSRC}/doc/*.html ${WRKSRC}/doc/*.gif ${WRKSRC}/doc/README
- @${INSTALL_DATA} ${WRKSRC}$i ${PREFIX}/share/doc/${PORTNAME}
-.endfor
- @${ECHO_MSG} " -> Documentation installed in: ${PREFIX}/share/doc/${PORTNAME}"
-.endif
+pre-install:
+ @${CP} ${PKGDIR}/pkg-plist ${PLIST}
-### Install blacklist databases
+### Install blacklists
.if !exists(${DATADIR})
- @${ECHO_MSG} "===> Installing blacklist databases"
- @${MKDIR} ${DATADIR}
- @cd ${DATADIR} ; \
- ${TAR} fpxz ${WRKSRC}/samples/dest/blacklists.tar.gz ; \
- for f in blacklists/* ; do \
- ${MV} $$f ${DATADIR} ; \
- done
- @if [ -d ${PREFIX}/share/doc/${PORTNAME} ] ; then \
- ${MV} -f ${DATADIR}/README \
- ${PREFIX}/share/doc/${PORTNAME}/README.blacklists ; \
- else \
- ${RM} -f ${DATADIR}/README ; \
- fi
- @for d in ${DATADIR}/ads ${DATADIR}/agressive ${DATADIR}/drugs \
- ${DATADIR}/hacking ${DATADIR}/porn ; do \
- cd $$d ; \
- ${RM} -f newdomains.* newurls.* ; \
- ${CHOWN} root:nobody * ; \
- ${CHMOD} 640 * ; \
- cd ${DATADIR} ; \
- done
- @${RM} -rf ${DATADIR}/blacklists*
- @${CHOWN} root:nobody ${DATADIR}/* ${DATADIR}
- @${CHMOD} 750 ${DATADIR}/* ${DATADIR}
+ @${ECHO_MSG} "===> Installing blacklists"
+ @${MKDIR} -p ${DATADIR}
+ @${TAR} -C ${DATADIR} --exclude *.diff -pxzf ${WRKSRC}/samples/dest/blacklists.tar.gz
+ @${MV} -f ${DATADIR}/blacklists/README ${WRKDIR}/README.blacklists
+ @${MV} -f ${DATADIR}/blacklists/* ${DATADIR}/
+ @${RM} -r ${DATADIR}/blacklists
+ @${CHOWN} -R ${SQUID_UID}:${SQUID_GID} ${DATADIR}
+ @${CHMOD} -R 550 ${DATADIR}
+ @${CAT} ${PKGDIR}/pkg-plist.blacklist >> ${PLIST}
@${ECHO_MSG} " -> Blacklists installed in: ${DATADIR}"
.else
@${ECHO_MSG} "===> Found existing datadirectory - skipping blacklist installation"
.endif
-### Install sample configuration file
+### Create sample configuration file
- @if [ ! -f ${PREFIX}/etc/squid/squidguard.conf ] ; then \
+ @if [ ! -f "${PREFIX}/etc/squid/${PORTNAME}.conf" ] ; then \
${ECHO_MSG} "===> Installing sample configuration file" ; \
- ${SED} -e 's!%%DATADIR%%!${DATADIR}!' -e 's!%%LOGDIR%%!${LOGDIR}!' \
- ${WRKSRC}/samples/sample.conf > \
- ${PREFIX}/etc/squid/squidguard.conf.sample ; \
- ${CHOWN} root:nobody ${PREFIX}/etc/squid/squidguard.conf.sample ; \
- ${CHMOD} 640 ${PREFIX}/etc/squid/squidguard.conf.sample ; \
+ BLACKLIST_DIRS=`(cd ${DATADIR} && ${FIND} . -type d | ${SED} '/^\.$$/d; s/^\.\//!/' | ${XARGS} ${ECHO_CMD})`; \
+ for I in `${ECHO_CMD} $${BLACKLIST_DIRS} | ${SED} 's/!//g'`; do \
+ ${ECHO_CMD} "dest $${I} {"; \
+ ${TEST} -f ${DATADIR}/$${I}/domains && \
+ ${ECHO_CMD} " domainlist $${I}/domains"; \
+ ${TEST} -f ${DATADIR}/$${I}/urls && \
+ ${ECHO_CMD} " urllist $${I}/urls"; \
+ ${TEST} -f ${DATADIR}/$${I}/expressions && \
+ ${ECHO_CMD} " expressionlist $${I}/expressions"; \
+ ${ECHO_CMD} "}"; \
+ done > ${WRKDIR}/${PORTNAME}.conf.dests ; \
+ ${SED} "s|DATADIR|${DATADIR}|;s|LOGDIR|${LOGDIR}|;s|BLACKLIST_DIRS|$${BLACKLIST_DIRS}|;/DEST_CLASSES/r ${WRKDIR}/${PORTNAME}.conf.dests" \
+ ${CFGINPUT} | \
+ ${SED} "/DEST_CLASSES/d" > \
+ ${PREFIX}/etc/squid/${PORTNAME}.conf.sample ; \
+ ${CHOWN} ${SQUID_UID}:${SQUID_GID} ${PREFIX}/etc/squid/${PORTNAME}.conf.sample ; \
${ECHO_MSG} " -> Sample configuration file installed in: ${PREFIX}/etc/squid" ; \
else \
${ECHO_MSG} "===> Existing configuration file found - sample not installed" ; \
fi
+### Create blacklist databases (assume fresh install if we only have a sample config)
+
+ @if [ ! -f "${PREFIX}/etc/squid/${PORTNAME}.conf" -a \
+ -f "${PREFIX}/etc/squid/${PORTNAME}.conf.sample" ] ; then \
+ ${ECHO_MSG} "===> Creating blacklist databases" ; \
+ ${WRKSRC}/src/${PORTNAME} -d -c ${PREFIX}/etc/squid/${PORTNAME}.conf.sample -C all ; \
+ ${CHOWN} -R ${SQUID_UID}:${SQUID_GID} ${DATADIR} ; \
+ ${FIND} ${DATADIR} -type f -name *.db -exec ${CHMOD} 660 {} \; ; \
+ ${ECHO_MSG} " -> Blacklist databases installed in: ${DATADIR}" ; \
+ ${ECHO_MSG} " -> Be sure to check \"${LOGDIR}/${PORTNAME}.log\" for any errors" ; \
+ ${CHOWN} ${SQUID_UID}:${SQUID_GID} ${LOGDIR}/${PORTNAME}.log ; \
+ else \
+ ${ECHO_MSG} "===> Existing configuration file found - blacklist databases not created" ; \
+ fi
+
+post-install:
+
+### Install documentation
+
+.if !defined(NOPORTDOCS)
+ @${ECHO_MSG} "===> Installing ${PORTNAME} documentation"
+ -@${MKDIR} ${PREFIX}/share/doc/${PORTNAME}
+.for i in ${WRKSRC}/doc/*.txt ${WRKSRC}/doc/*.html ${WRKSRC}/doc/*.gif ${WRKSRC}/doc/README
+ @${INSTALL_DATA} ${WRKSRC}$i ${PREFIX}/share/doc/${PORTNAME}
+.endfor
+ @if [ -f ${WRKDIR}/README.blacklists ] ; then \
+ ${INSTALL_DATA} ${WRKDIR}/README.blacklists ${PREFIX}/share/doc/${PORTNAME} ; \
+ fi
+ @${ECHO_MSG} " -> Documentation installed in: ${PREFIX}/share/doc/${PORTNAME}"
+.endif
+
.if !exists(${LOGDIR})
@${MKDIR} ${LOGDIR}
+ @${CHOWN} -R ${SQUID_UID}:${SQUID_GID} ${LOGDIR}
.endif
### View short howto message
+ @${ECHO_MSG} " "
@${ECHO_MSG} "==================================================================="
@${ECHO_MSG} "= In order to activate ${PORTNAME} you have to edit squid.conf"
@${ECHO_MSG} "= To the contain \"redirect_program ${PREFIX}/bin/${PORTNAME}\""
diff --git a/www/squidguard/distinfo b/www/squidguard/distinfo
index 162b60013064..abcb8eecc431 100644
--- a/www/squidguard/distinfo
+++ b/www/squidguard/distinfo
@@ -1 +1 @@
-MD5 (squidGuard-1.1.4.tar.gz) = 300a179d05fcba2068c4e766b607d73f
+MD5 (squidGuard-1.2.0.tar.gz) = c6e2e9112fdbda0602656f94c1ce31fd
diff --git a/www/squidguard/files/patch-ab b/www/squidguard/files/patch-ab
index 248dd6e013f3..a771cdbe5dd7 100644
--- a/www/squidguard/files/patch-ab
+++ b/www/squidguard/files/patch-ab
@@ -1,38 +1,28 @@
---- configure.orig Wed Mar 29 11:40:54 2000
-+++ configure Fri Jun 2 08:44:14 2000
-@@ -1085,7 +1085,7 @@
- fi
- done
- IFS="$ac_save_ifs"
-- test -z "$ac_cv_path_LYNX" && ac_cv_path_LYNX="/bin/false"
-+ test -z "$ac_cv_path_LYNX" && ac_cv_path_LYNX="/usr/bin/false"
- ;;
- esac
- fi
-@@ -1217,14 +1217,14 @@
+--- configure.orig Tue Dec 18 11:16:53 2001
++++ configure Thu Dec 27 01:46:53 2001
+@@ -2402,13 +2402,13 @@
+ CPPFLAGS="$CPPFLAGS $db_inc"
LDFLAGS="$LDFLAGS $db_lib"
-
--echo $ac_n "checking for db_version in -ldb""... $ac_c" 1>&6
--echo "configure:1222: checking for db_version in -ldb" >&5
-+echo $ac_n "checking for db_version in -ldb2""... $ac_c" 1>&6
-+echo "configure:1222: checking for db_version in -ldb2" >&5
- ac_lib_var=`echo db'_'db_version | sed 'y%./+-%__p_%'`
- if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+-echo "$as_me:2405: checking for db_version in -ldb" >&5
+-echo $ECHO_N "checking for db_version in -ldb... $ECHO_C" >&6
++echo "$as_me:2405: checking for db_version in -ldb3" >&5
++echo $ECHO_N "checking for db_version in -ldb3... $ECHO_C" >&6
+ if test "${ac_cv_lib_db_db_version+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_save_LIBS="$LIBS"
+ ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldb $LIBS"
-+LIBS="-ldb2 $LIBS"
- cat > conftest.$ac_ext <<EOF
- #line 1230 "configure"
++LIBS="-ldb3 $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ #line 2413 "configure"
#include "confdefs.h"
-@@ -1258,7 +1258,7 @@
- #define $ac_tr_lib 1
+@@ -2456,7 +2456,7 @@
+ #define HAVE_LIBDB 1
EOF
- LIBS="-ldb $LIBS"
-+ LIBS="-ldb2 $LIBS"
++ LIBS="-ldb3 $LIBS"
else
- echo "$ac_t""no" 1>&6
+
diff --git a/www/squidguard/files/patch-ac b/www/squidguard/files/patch-ac
deleted file mode 100644
index 5a97ebbb6894..000000000000
--- a/www/squidguard/files/patch-ac
+++ /dev/null
@@ -1,15 +0,0 @@
---- samples/sample.conf.in.orig Sun Jun 11 21:45:41 2000
-+++ samples/sample.conf.in Sun Jun 11 21:46:54 2000
-@@ -1,9 +1,9 @@
- #
--# CONFIG FILE FOR SQUIDGUARD
-+# SAMPLE CONFIG FILE FOR SQUIDGUARD
- #
-
--dbhome @prefix@/squidGuard/db
--logdir @prefix@/squidGuard/logs
-+dbhome %%DATADIR%%
-+logdir %%LOGDIR%%
-
- #
- # TIME RULES:
diff --git a/www/squidguard/files/sgcfg.in b/www/squidguard/files/sgcfg.in
new file mode 100644
index 000000000000..8d57a821c1dc
--- /dev/null
+++ b/www/squidguard/files/sgcfg.in
@@ -0,0 +1,41 @@
+#
+# SAMPLE CONFIG FILE FOR SQUIDGUARD
+# (for further configuration options see the
+# documentation and http://www.squidguard.org/)
+#
+dbhome DATADIR
+logdir LOGDIR
+
+#
+# TIME RULES:
+# abbrev for weekdays:
+# s = sun, m = mon, t =tue, w = wed, h = thu, f = fri, a = sat
+time workhours {
+ weekly mtwhf 08:00 - 16:30
+ date *-*-01 08:00 - 16:30
+}
+
+#
+# SOURCE ADDRESSES
+#
+source sample-clients {
+ ip 10.0.0.0/24
+}
+
+#
+# DESTINATION CLASSES
+#
+DEST_CLASSES
+
+acl {
+ sample-clients within workhours {
+ pass BLACKLIST_DIRS !in-addr any
+ } else {
+ pass any
+ }
+
+ default {
+ pass none
+ redirect http://admin.foo.bar.no/cgi/blocked?clientaddr=%a+clientname=%n+clientident=%i+srcclass=%s+targetclass=%t+url=%u
+ }
+}
diff --git a/www/squidguard/pkg-plist b/www/squidguard/pkg-plist
index 8468f82726fd..087ac85714d3 100644
--- a/www/squidguard/pkg-plist
+++ b/www/squidguard/pkg-plist
@@ -9,33 +9,5 @@ share/doc/squidGuard/index.html
share/doc/squidGuard/installation.html
share/doc/squidGuard/installation.txt
share/doc/squidGuard/squidGuard.gif
+etc/squid/squidGuard.conf.sample
@dirrm share/doc/squidGuard
-@cwd %%DATADIR%%
-ads/domains
-ads/domains.db
-ads/urls
-ads/urls.db
-agressive/domains
-agressive/domains.db
-agressive/urls
-agressive/urls.db
-drugs/domains
-drugs/domains.db
-drugs/urls
-drugs/urls.db
-hacking/domains
-hacking/domains.db
-hacking/urls
-hacking/urls.db
-porn/domains
-porn/domains.db
-porn/expressions
-porn/urls
-porn/urls.db
-@dirrm ads
-@dirrm agressive
-@dirrm drugs
-@dirrm hacking
-@dirrm porn
-@cwd /
-@dirrm %%DATADIR%%
diff --git a/www/squidguard/pkg-plist.blacklist b/www/squidguard/pkg-plist.blacklist
new file mode 100644
index 000000000000..f3ec880fda52
--- /dev/null
+++ b/www/squidguard/pkg-plist.blacklist
@@ -0,0 +1,58 @@
+@cwd %%DATADIR%%
+ads/domains
+ads/domains.db
+ads/urls
+ads/urls.db
+aggressive/domains
+aggressive/domains.db
+aggressive/urls
+aggressive/urls.db
+audio-video/domains
+audio-video/domains.db
+audio-video/urls
+audio-video/urls.db
+drugs/domains
+drugs/domains.db
+drugs/urls
+drugs/urls.db
+gambling/domains
+gambling/domains.db
+gambling/urls
+gambling/urls.db
+hacking/domains
+hacking/domains.db
+hacking/urls
+hacking/urls.db
+mail/domains
+mail/domains.db
+porn/domains
+porn/domains.db
+porn/urls
+porn/urls.db
+porn/expressions
+proxy/domains
+proxy/domains.db
+proxy/urls
+proxy/urls.db
+violence/domains
+violence/domains.db
+violence/urls
+violence/urls.db
+violence/expressions
+warez/domains
+warez/domains.db
+warez/urls
+warez/urls.db
+@dirrm ads
+@dirrm aggressive
+@dirrm audio-video
+@dirrm drugs
+@dirrm gambling
+@dirrm hacking
+@dirrm mail
+@dirrm porn
+@dirrm proxy
+@dirrm violence
+@dirrm warez
+@cwd /
+@dirrm %%DATADIR%%