diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2010-12-07 09:11:50 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2010-12-07 09:11:50 +0000 |
commit | ccb2080adda583aa43cb39f13e4d6119beb04354 (patch) | |
tree | 134104e5c336e69e08b7f9e8bc375206f0793f8e /net-proxy | |
parent | Corrected logic on die, thanks Guilherme Amadio for the patch #347929 (diff) | |
download | gentoo-2-ccb2080adda583aa43cb39f13e4d6119beb04354.tar.gz gentoo-2-ccb2080adda583aa43cb39f13e4d6119beb04354.tar.bz2 gentoo-2-ccb2080adda583aa43cb39f13e4d6119beb04354.zip |
Version bump. This new version renames the init script to ufdb (to fall in line with the official documentation), relocates the blacklists and the configuration file, allows setting user/password for download without editing the script, allows to disable at build time the use of ufdbhttpd, installs a cron.daily file to update the database and adds a reload target to the init script (with a reconfig alias as that's what the official documentation suggests to use). Also add a doc USE flag to download and install the official reference manual for the version.
(Portage version: 2.2.0_alpha7/cvs/Linux x86_64)
Diffstat (limited to 'net-proxy')
-rw-r--r-- | net-proxy/ufdbguard/ChangeLog | 18 | ||||
-rw-r--r-- | net-proxy/ufdbguard/files/ufdb.confd | 17 | ||||
-rw-r--r-- | net-proxy/ufdbguard/files/ufdb.initd | 77 | ||||
-rw-r--r-- | net-proxy/ufdbguard/files/ufdbUpdate.cron | 14 | ||||
-rw-r--r-- | net-proxy/ufdbguard/files/ufdbguard-1.23-gentoo.patch | 70 | ||||
-rw-r--r-- | net-proxy/ufdbguard/files/ufdbguard-1.23-parallel-make.patch | 133 | ||||
-rw-r--r-- | net-proxy/ufdbguard/files/ufdbhttpd.confd | 11 | ||||
-rw-r--r-- | net-proxy/ufdbguard/files/ufdbhttpd.initd | 23 | ||||
-rw-r--r-- | net-proxy/ufdbguard/metadata.xml | 31 | ||||
-rw-r--r-- | net-proxy/ufdbguard/ufdbguard-1.23.ebuild | 130 |
10 files changed, 481 insertions, 43 deletions
diff --git a/net-proxy/ufdbguard/ChangeLog b/net-proxy/ufdbguard/ChangeLog index 8891b89dcf87..22e74c912b2e 100644 --- a/net-proxy/ufdbguard/ChangeLog +++ b/net-proxy/ufdbguard/ChangeLog @@ -1,6 +1,22 @@ # ChangeLog for net-proxy/ufdbguard # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-proxy/ufdbguard/ChangeLog,v 1.9 2010/05/07 03:37:35 jer Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-proxy/ufdbguard/ChangeLog,v 1.10 2010/12/07 09:11:50 flameeyes Exp $ + +*ufdbguard-1.23 (07 Dec 2010) + + 07 Dec 2010; Diego E. Pettenò <flameeyes@gentoo.org> +ufdbguard-1.23.ebuild, + +files/ufdbguard-1.23-gentoo.patch, + +files/ufdbguard-1.23-parallel-make.patch, +files/ufdb.confd, + +files/ufdb.initd, +files/ufdbUpdate.cron, -files/ufdbhttpd.confd, + -files/ufdbhttpd.initd, metadata.xml: + Version bump. This new version renames the init script to ufdb (to fall in + line with the official documentation), relocates the blacklists and the + configuration file, allows setting user/password for download without editing + the script, allows to disable at build time the use of ufdbhttpd, installs a + cron.daily file to update the database and adds a reload target to the init + script (with a reconfig alias as that's what the official documentation + suggests to use). Also add a doc USE flag to download and install the + official reference manual for the version. 07 May 2010; Jeroen Roovers <jer@gentoo.org> ufdbguard-1.20.ebuild: Remove dev cruft from ebuild. diff --git a/net-proxy/ufdbguard/files/ufdb.confd b/net-proxy/ufdbguard/files/ufdb.confd new file mode 100644 index 000000000000..5ef5e4af6c53 --- /dev/null +++ b/net-proxy/ufdbguard/files/ufdb.confd @@ -0,0 +1,17 @@ +# -*- sh -*- +# $Header: /var/cvsroot/gentoo-x86/net-proxy/ufdbguard/files/ufdb.confd,v 1.1 2010/12/07 09:11:50 flameeyes Exp $ + +# Tables to re-generate when starting or reloading ufdbguard +UFDB_GT="alwaysallow alwaysdeny" + +# User under which to run ufdbguard; it should be the same as the +# proxy server you're using, so by default it is squid. +UFDB_USER="squid" + +# Options to pass to ufdbguardd; see /usr/libexec/ufdbguard/ufdbguardd +# -h for a brief list. +UFDB_OPTS="" + +# Options used by the modified ufdbUpdate script in Gentoo +DOWNLOAD_USER="" +DOWNLOAD_PASSWORD="" diff --git a/net-proxy/ufdbguard/files/ufdb.initd b/net-proxy/ufdbguard/files/ufdb.initd new file mode 100644 index 000000000000..b6c02c6b34fd --- /dev/null +++ b/net-proxy/ufdbguard/files/ufdb.initd @@ -0,0 +1,77 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/ufdbguard/files/ufdb.initd,v 1.1 2010/12/07 09:11:50 flameeyes Exp $ + +# reconfig is what the upstream documentation suggests, so let's +# provide it for compatibility. +opts="${opts} reload reconfig" + +depend() { + need net + before squid + use logger +} + +get_config() { + awk '$1 == "'$1'" { print $2 }' "/etc/ufdbGuard.conf" +} + +gentables() { + local dbhome=$(get_config dbhome) + + for gt in ${UFDB_GT} ; do + if [ -f "${dbhome}/${gt}/domains" ] ; then + einfo "Generating domainlist ${gt}" + ufdbGenTable -t "${gt}" -d "${dbhome}/${gt}/domains" + fi + done +} + +start() { + gentables + + local logdir=$(get_config logdir) + + if [ ! -d "${logdir}" ] ; then + mkdir -p ${logdir} + chown -R ${UFDB_USER} ${logdir} + fi + + if [ ! -d /var/run/ufdbguardd ] ; then + mkdir -p /var/run/ufdbguard + chown -R ${UFDB_USER} /var/run/ufdbguard + fi + + ebegin "Starting ufdbGuard" + start-stop-daemon --start --chuid ${UFDB_USER} \ + --exec /usr/libexec/ufdbguard/ufdbguardd \ + --pidfile /var/run/ufdbguard/ufdbguardd.pid -- \ + -c /etc/ufdbGuard.conf ${UFDB_OPTS} + eend $? "Failed to start ufdbGuard" +} + +stop() { + ebegin "Stopping ufdbGuard" + start-stop-daemon --stop \ + --exec /usr/libexec/ufdbguard/ufdbguardd \ + --pidfile /var/run/ufdbguard/ufdbguardd.pid + eend $? "Failed to stop ufdbGuard" +} + +reload() { + if ! [ -f /var/run/ufdbguard/ufdbguardd.pid ]; then + eerror "Unable to find PID file for ufdbguardd, was it just started?" + return 1 + fi + + gentables + + ebegin "Reloading ufdbGuard" + kill -HUP $(</var/run/ufdbguard/ufdbguardd.pid) + eend $? "Failed to reload ufdbGuard" +} + +reconfig() { + reload +} diff --git a/net-proxy/ufdbguard/files/ufdbUpdate.cron b/net-proxy/ufdbguard/files/ufdbUpdate.cron new file mode 100644 index 000000000000..9442823d73ad --- /dev/null +++ b/net-proxy/ufdbguard/files/ufdbUpdate.cron @@ -0,0 +1,14 @@ +#!/bin/sh +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/ufdbguard/files/ufdbUpdate.cron,v 1.1 2010/12/07 09:11:50 flameeyes Exp $ + +# cron.daily file to update the ufdb database + +# Avoid doing anything if no download user is set in the configuration +# file +( . /etc/conf.d/ufdb ; [ -z "${DOWNLOAD_USER}" ]; ) && return 0 + +/usr/sbin/ufdbUpdate + +/etc/init.d/squid rotate diff --git a/net-proxy/ufdbguard/files/ufdbguard-1.23-gentoo.patch b/net-proxy/ufdbguard/files/ufdbguard-1.23-gentoo.patch new file mode 100644 index 000000000000..a63a2876975f --- /dev/null +++ b/net-proxy/ufdbguard/files/ufdbguard-1.23-gentoo.patch @@ -0,0 +1,70 @@ +Index: ufdbGuard-1.23/src/ufdbUpdate.in +=================================================================== +--- ufdbGuard-1.23.orig/src/ufdbUpdate.in ++++ ufdbGuard-1.23/src/ufdbUpdate.in +@@ -27,6 +27,8 @@ WGET_COMMAND="@WGET@" + NOTIFY_UFDBGUARDD="yes" # send HUP signal to ufdbguardd + SYSLOG_FACILITY="local6" # errors/warnings in system log have this facility name + ++source /etc/conf.d/ufdb ++ + # end of user settings. + # DO NOT EDIT ANYTHING BELOW THIS LINE. ######################################## + +@@ -268,45 +270,18 @@ else # no ufdbguardd processes... + then + echo "No ufdbguardd processes found. Starting the daemon..." + fi +- for dir in /usr/pkg/etc/rc.d \ +- /usr/local/etc/rc.d \ +- /etc/rc.d/init.d \ +- /etc/init.d \ +- /sbin/init.d \ +- $BINDIR +- do +- if [ -f $dir/ufdb.sh -o -f $dir/ufdb ] +- then +- # The most common reason why ufdbguardd does not start is because +- # the UNIX socket /tmp/ufdbguardd-03977 exists, so remove it! +- rm -f /tmp/ufdbguardd-03977 +- +- if [ -x $dir/ufdb.sh ] +- then +- $dir/ufdb.sh start +- else +- $dir/ufdb start +- fi +- exitcode=$? +- if [ $exitcode -ne 0 ] +- then +- logger -p $SYSLOG_FACILITY.error -t ufdbUpdate \ +- "The ufdbguardd daemon did not start (exit code is $exitval)." +- if [ $verbose = yes ] +- then +- echo "The ufdbguardd daemon did not start (exit code is $exitval)." +- fi +- fi +- exit 0 +- fi +- done +- +- logger -p $SYSLOG_FACILITY.error -t ufdbUpdate \ +- "The ufdbguardd daemon could not be started (could not find the ufdb[.sh] start script)." +- if [ $verbose = yes ] +- then +- echo "The ufdbguardd daemon could not be started (could not find the ufdb[.sh] start script)." ++ /etc/init.d/ufdb start ++ exitcode=$? ++ if [ $exitcode -ne 0 ] ++ then ++ logger -p $SYSLOG_FACILITY.error -t ufdbUpdate \ ++ "The ufdbguardd daemon did not start (exit code is $exitval)." ++ if [ $verbose = yes ] ++ then ++ echo "The ufdbguardd daemon did not start (exit code is $exitval)." ++ fi + fi ++ exit 0 + fi + + # Check the latest version. diff --git a/net-proxy/ufdbguard/files/ufdbguard-1.23-parallel-make.patch b/net-proxy/ufdbguard/files/ufdbguard-1.23-parallel-make.patch new file mode 100644 index 000000000000..3f95f2cbb3fa --- /dev/null +++ b/net-proxy/ufdbguard/files/ufdbguard-1.23-parallel-make.patch @@ -0,0 +1,133 @@ +--- a/src/Makefile.in 2010-04-12 04:39:43.000000000 +0200 +--- b/src/Makefile.in 2010-05-07 05:26:03.000000000 +0200 +@@ -135,8 +135,8 @@ + # Dependencies for installing + # + +-daemon: +- cd mtserver; make ++daemon: $(UFDBOBJS) ++ cd mtserver; $(MAKE) + + ufdbhttpd: ufdbhttpd.o httpserver.o ufdbbase.o ufdblib.o sgLog.o crypt.o + $(LINK) ufdbhttpd.o httpserver.o ufdbbase.o ufdblib.o sgLog.o crypt.o $(LIBS) +@@ -235,7 +235,7 @@ + $(RM) $(bindir)/ufdbhttpd + + install.mt:: +- cd mtserver ; make ++ cd mtserver ; $(MAKE) + $(INSTALL_PROGRAM) mtserver/ufdbguardd $(bindir)/ufdbguardd + $(INSTALL_PROGRAM) mtserver/ufdbgclient $(bindir)/ufdbgclient + +@@ -272,8 +272,8 @@ + $(RM) *~ *.bak core core.* *.log *.log.[0-9] *.error + $(RM) *.o y.tab.c y.tab.h ufdbGuard ufdbGenTable ufdbAnalyse ufdbPrintTable ufdbhttpd + $(RM) ipv6 iptst rwtest lex.yy.c +- -@cd mtserver && make clean +- -@cd api 2>/dev/null && make clean ++ -@cd mtserver && $(MAKE) clean ++ -@cd api 2>/dev/null && $(MAKE) clean + + realclean:: clean + @echo making $@ in `basename \`pwd\`` +@@ -286,11 +286,11 @@ + distclean:: realclean + @echo making $@ in `basename \`pwd\`` + $(RM) Makefile sg.h config.h ufdbUpdate ufdbConvertDB ufdbGuard.conf +- -cd mtserver ; make distclean ++ -cd mtserver ; $(MAKE) distclean + + apidistclean: distclean + @echo making $@ in `basename \`pwd\`` +- -cd api ; make distclean ++ -cd api ; $(MAKE) distclean + + grab: ufdbGrab + ./ufdbGrab $(cfgdir) $(logdir) +@@ -532,25 +532,25 @@ + $(CC) --version + + g2953: +- make clean +- CC=/usr/local/gcc/2.95.3/bin/gcc make -e $(MAKEFLAGS) ccversion all ufdbPrintTable ++ $(MAKE) clean ++ CC=/usr/local/gcc/2.95.3/bin/gcc $(MAKE) -e $(MAKEFLAGS) ccversion all ufdbPrintTable + + g344: +- make clean +- CC=/usr/local/gcc/3.4.4/bin/gcc make -e $(MAKEFLAGS) ccversion all ufdbPrintTable ++ $(MAKE) clean ++ CC=/usr/local/gcc/3.4.4/bin/gcc $(MAKE) -e $(MAKEFLAGS) ccversion all ufdbPrintTable + + g401: +- make clean +- CC=/usr/local/gcc/4.0.1/bin/gcc make -e $(MAKEFLAGS) ccversion all ufdbPrintTable ++ $(MAKE) clean ++ CC=/usr/local/gcc/4.0.1/bin/gcc $(MAKE) -e $(MAKEFLAGS) ccversion all ufdbPrintTable + + g411: +- make clean +- CC=/usr/local/gcc/4.1.1/bin/gcc make -e $(MAKEFLAGS) ccversion all ufdbPrintTable ++ $(MAKE) clean ++ CC=/usr/local/gcc/4.1.1/bin/gcc $(MAKE) -e $(MAKEFLAGS) ccversion all ufdbPrintTable + + qinst: + /etc/init.d/squid stop + /etc/init.d/ufdb stop +- make install ++ $(MAKE) install + /etc/init.d/ufdb start + /etc/init.d/squid start + +--- a/src/mtserver/Makefile.in 2010-04-12 02:56:20.000000000 +0200 +--- b/src/mtserver/Makefile.in 2010-05-07 05:26:03.000000000 +0200 +@@ -48,10 +48,10 @@ + $(LINK) ufdbgclient.o -L. -lufdbd $(SOLARIS_LIBS) + + ../lex.yy.o: +- cd .. ; make lex.yy.o ++ cd .. ; $(MAKE) lex.yy.o + + ../y.tab.o: +- cd .. ; make y.tab.o ++ cd .. ; $(MAKE) y.tab.o + + $(MYLIB): ../crypt.o ../lex.yy.o ../sgDiv.o ../sgLog.o ../ufdbLookup.o \ + ../ufdblib.o ../y.tab.o ../ufdbbase.o +@@ -60,7 +60,7 @@ + ../ufdblib.o ../y.tab.o ../ufdbbase.o + + ptmalloc3/libptmalloc3.a: +- cd ptmalloc3 ; make linux-pthread ++ cd ptmalloc3 ; $(MAKE) linux-pthread + + $(MYLIBSSL): ../ufdbchkport.o ../httpsQueue.o ../ufdbHashtable.o + -@rm -f $(MYLIBSSL) +@@ -102,7 +102,7 @@ + ./ufdbgclient -p $(PORT) -l . -d "www.sex.com" 10.1.1.1 kees + + ../../test/blacklist/domains.ufdb: ../../test/blacklist/domains +- cd ../../test ; make blacklist/domains.ufdb ++ cd ../../test ; $(MAKE) blacklist/domains.ufdb + + LEAKOPTS= --leak-check=full --show-reachable=yes + LEAKOPTS= +@@ -382,7 +382,7 @@ + time ./ufdbgclient -p $(PORT) -l . < ../100000 > /dev/null 2>&1 + + tt: +- make tp3 ++ $(MAKE) tp3 + sleep 3 + kill -HUP `ps -ef | grep ufdbguardd | grep -v grep | head -1 | awk '{ print $$2 }'` + +@@ -455,6 +455,6 @@ + + + g411: +- make clean +- CC=/usr/local/gcc/4.1.1/bin/gcc make -e $(MAKEFLAGS) all ++ $(MAKE) clean ++ CC=/usr/local/gcc/4.1.1/bin/gcc $(MAKE) -e $(MAKEFLAGS) all + diff --git a/net-proxy/ufdbguard/files/ufdbhttpd.confd b/net-proxy/ufdbguard/files/ufdbhttpd.confd deleted file mode 100644 index fad3f01cbed8..000000000000 --- a/net-proxy/ufdbguard/files/ufdbhttpd.confd +++ /dev/null @@ -1,11 +0,0 @@ -UFDB_HUSER="squid" -UFDB_HPORT="80" - -# option : ufdbhttpd --help # -UFDB_HOPTS="" - -# Better not change that # -UFDB_HIMG="/usr/share/ufdbguard/images" -UFDB_HBIN="/usr/bin/ufdbhttpd" -UFDB_HPIDFILE="/var/run/ufdbhttpd.pid" -UFDB_HLOGDIR=$( grep logdir ${UFDB_CONF} 2>/dev/null | awk '{print $2}' ) diff --git a/net-proxy/ufdbguard/files/ufdbhttpd.initd b/net-proxy/ufdbguard/files/ufdbhttpd.initd deleted file mode 100644 index 3f7dbcb28a98..000000000000 --- a/net-proxy/ufdbguard/files/ufdbhttpd.initd +++ /dev/null @@ -1,23 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2009 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-proxy/ufdbguard/files/ufdbhttpd.initd,v 1.1 2009/03/18 17:08:50 bass Exp $ - -depend() { - need net - use logger -} - -start() { - ebegin "Starting ufdbHttpd" - start-stop-daemon --start --chuid ${UFDB_HUSER} \ - --exec ${UFDB_HBINARY} --pidfile ${UFDB_HPIDFILE} -- -p ${UFDB_HPORT} \ - -I ${UFDB_HIMG} -l ${UFDB_HLOGDIR} ${UFDB_HOPTS} - eend $? "Failed to start ufdbHttpd" -} - -stop() { - ebegin "Stopping ufdbHttpd" - start-stop-daemon --stop --exec ${UFDB_HBINARY} --pidfile ${UFDB_HPIDFILE} - eend $? "Failed to stop ufdbHttpd" -} diff --git a/net-proxy/ufdbguard/metadata.xml b/net-proxy/ufdbguard/metadata.xml index 2c5bd1d92d46..9a3457e1a868 100644 --- a/net-proxy/ufdbguard/metadata.xml +++ b/net-proxy/ufdbguard/metadata.xml @@ -1,12 +1,27 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> - <herd>no-herd</herd> - <maintainer> - <email>bass@gentoo.org</email> -<!-- <description>Description of the maintainership</description> --> - </maintainer> - <longdescription> - The fastest URL filter with 25,000 URL verifications/sec to filter unwanted web content. ufdbGuard is a redirector for the Squid internet proxy. - </longdescription> + <herd>no-herd</herd> + <maintainer> + <email>bass@gentoo.org</email> + </maintainer> + <maintainer restrict="=net-proxy/ufdbguard-1.23*"> + <email>flameeyes@gentoo.org</email> + <description>Co-maintainer for version 1.23</description> + </maintainer> + <longdescription> + The fastest URL filter with 25,000 URL verifications/sec to filter + unwanted web content. ufdbGuard is a redirector for the Squid + internet proxy. + </longdescription> + <use> + <flag name="httpd"> + Build, install and start the provided mini-http daemon with the + redirect CGI integrated. Since there is no way to tell ufdbguard + to not start it, this is a build-time option. + </flag> + <flag name="doc"> + Download and install the ufdbguard reference manual in PDF. + </flag> + </use> </pkgmetadata> diff --git a/net-proxy/ufdbguard/ufdbguard-1.23.ebuild b/net-proxy/ufdbguard/ufdbguard-1.23.ebuild new file mode 100644 index 000000000000..4c72e864b58b --- /dev/null +++ b/net-proxy/ufdbguard/ufdbguard-1.23.ebuild @@ -0,0 +1,130 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/ufdbguard/ufdbguard-1.23.ebuild,v 1.1 2010/12/07 09:11:50 flameeyes Exp $ + +EAPI="2" + +inherit eutils + +MY_P="ufdbGuard-${PV}" + +DESCRIPTION="ufdbGuard is a redirector for the Squid internet proxy." +HOMEPAGE="http://www.urlfilterdb.com/en/products/ufdbguard.html" +SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz + doc? ( mirror://sourceforge/${PN}/ReferenceManual_v${PV/\./_}.pdf -> ${P}-manual.pdf )" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="+httpd doc" + +RDEPEND="dev-libs/openssl + app-arch/bzip2 + net-misc/wget" + +DEPEND="${RDEPEND} + sys-devel/bison + sys-devel/flex" + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + # create the squid user exactly as done by net-proxy/squid-3.1.9 + enewgroup squid 31 + enewuser squid 31 -1 /var/cache/squid squid +} + +src_prepare() { + epatch "${FILESDIR}"/${P}-parallel-make.patch + epatch "${FILESDIR}"/${P}-gentoo.patch + + egrep -r -e '/var/tmp/ufdb(guard|http)d.pid' "${S}" -lZ | xargs -0 \ + sed -i -e 's:/var/tmp/ufdb\(guard\|http\)d.pid:/var/run/ufdbguard/ufdb\1d.pid:' \ + || die + + # directory where ufdbhttpd is to be found + sed -i -e 's:DEFAULT_BINDIR.*:DEFAULT_BINDIR "/usr/libexec/ufdbguard":' \ + src/ufdb.h.in || die +} + +src_configure() { + econf \ + --with-ufdb-user=squid \ + --with-ufdb-config=/etc \ + --with-ufdb-logdir=/var/log/ufdbguard \ + --with-ufdb-dbhome=/usr/share/ufdbguard/blacklists \ + --with-ufdb-images_dir=/usr/share/ufdbguard/images +} + +src_install() { + dodoc CHANGELOG INSTALL README src/sampleufdbGuard.conf || die + doman doc/*.1 || die + + dobin src/ufdbAnalyse src/ufdbGenTable src/ufdbGrab \ + src/ufdbConvertDB || die + dosbin src/ufdbUpdate || die + + exeinto /usr/libexec/ufdbguard + doexe src/mtserver/ufdbguardd src/mtserver/ufdbgclient || die + + if use httpd; then + exeinto /usr/libexec/ufdbguard + doexe src/ufdbhttpd || die + fi + + keepdir /usr/share/ufdbguard/blacklists + + insinto /etc + doins src/ufdbGuard.conf || die + + insinto /usr/share/ufdbguard/images + doins src/images/* || die + + newconfd "${FILESDIR}"/ufdb.confd ufdb || die + newinitd "${FILESDIR}"/ufdb.initd ufdb || die + + exeinto /etc/cron.daily + newexe "${FILESDIR}"/ufdbUpdate.cron ufdbUpdate || die + + if use doc; then + insinto /usr/share/doc/${PF} + newins "${DISTDIR}"/${P}-manual.pdf ReferenceManual.pdf || die + fi +} + +pkg_postinst() { + elog "The default location for the blacklist database has been" + elog "moved to /usr/share/ufdbguard/blacklists." + elog "" + elog "The configuration file is no longer configurable in the" + elog "service file, and now resides at /etc/ufdbGuard.conf ." + elog "" + elog "The service script has been renamed from ufdbguad to simply" + elog "/etc/init.d/ufdb, to follow the official documentation, and" + elog "it gained a reload option with a reconfig alias." + elog "" + elog "You can configure the username and password parameters for" + elog "ufdbUpdate, to fetch the blacklist database provided by" + elog "URLfilterDB, directly in /etc/conf.d/ufdb without touching" + elog "the script itself." + elog "" + elog "To enable ufdbguard in squid, you should add this to your" + elog "squid.conf:" + elog "" + elog " url_rewrite_program /usr/libexec/ufdbguard/ufdbgclient -l /var/log/ufdbguard" + elog " url_rewrite_children 64" + elog "" + if ! use httpd; then + elog "You chose to not install the lightweight http daemon that" + elog "comes with ufdbguard." + else + elog "The ufdb service will start both the ufdbguardd daemon and" + elog "the ufdbhttpd http daemon to provide a local redirect CGI." + elog "If you don't want this to happen, disable the httpd USE flag." + fi + if use doc; then + elog "" + elog "The reference manual has been installed as" + elog " /usr/share/doc/${PF}/ReferenceManual.pdf" + fi +} |