diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /net-proxy/ufdbguard |
reinit the tree, so we can have metadata
Diffstat (limited to 'net-proxy/ufdbguard')
-rw-r--r-- | net-proxy/ufdbguard/Manifest | 11 | ||||
-rw-r--r-- | net-proxy/ufdbguard/files/ufdb.confd | 20 | ||||
-rw-r--r-- | net-proxy/ufdbguard/files/ufdb.initd | 82 | ||||
-rw-r--r-- | net-proxy/ufdbguard/files/ufdb.initd.2 | 67 | ||||
-rw-r--r-- | net-proxy/ufdbguard/files/ufdbUpdate.cron | 13 | ||||
-rw-r--r-- | net-proxy/ufdbguard/files/ufdbguard-1.24-gentoo.patch | 13 | ||||
-rw-r--r-- | net-proxy/ufdbguard/metadata.xml | 22 | ||||
-rw-r--r-- | net-proxy/ufdbguard/ufdbguard-1.32.4.ebuild | 126 |
8 files changed, 354 insertions, 0 deletions
diff --git a/net-proxy/ufdbguard/Manifest b/net-proxy/ufdbguard/Manifest new file mode 100644 index 000000000000..3adb1d321665 --- /dev/null +++ b/net-proxy/ufdbguard/Manifest @@ -0,0 +1,11 @@ +AUX ufdb.confd 558 SHA256 7f9031f7cd7597d3dd7581e4d1b3068569a1e99f18ae8be924d730e39ce99347 SHA512 1f010ae16ee196243b4515832fe8c1979c591b1a0f43368d6eeceda8348183f7e0c758eee403ef922276006cd8721d1b642fc08c0d46581c4912f6a6804d4ad5 WHIRLPOOL 85beb99a72a421644419119ca3f382282cc8a8a7b00ff4892937858686275ceb19aa95f4f4e08f5cc8ec03480893ab20a7e3ae9e89791ab78c9c2c4d6259ae1d +AUX ufdb.initd 1792 SHA256 6b984c2219423bd77aab1a6c4b367a66b77329324d1ddfb09aa764b8f453c499 SHA512 3a4c8cd3f79242f46c3bb34019680db2502ff1d0c614814079dbba3cb9a0e6722727bb8ca23ceedd837d11b0a605b3d7612e0acb774d09c4c6579925da76c433 WHIRLPOOL 22fcb672723e1d360508585d34ce6b37075f613f9c28368587de7ad69df43a82b388eee43732bc7000216e7d178a5dd1936b186fb9241f633ad1070554299a7a +AUX ufdb.initd.2 1510 SHA256 83c62bd9ad139100ee8df9b7f966aff400e1050fd4e3be78f1f4c82afb2745e4 SHA512 aca83823cab027ae38a9e63f885c5ffecebf3c6352eeb672a90c92360168544691dfdb2a70b967b718856624a36435b0c9263693b4c7b90af06204f16ffe7309 WHIRLPOOL d9400b09dea4564029b43e14a9fb6fad42d92fe9642bd3db248522258edc726fa19e8e4ee07d520c699a82c3c11aab54d95242685a4f4d929396cf538204d619 +AUX ufdbUpdate.cron 351 SHA256 924b3c267dffa86cdd4de10fb4d4a0702f3c06aa6e01c5f1f81665796e4b3ce6 SHA512 17a6b17e0bb1d6f0a80609d8341c6c803749d4d38f37f1bbc0ab01c5614d07fd3dae580222ed38825480bfeb74cb4af4f81448e843ab61f4044cf755602c3cf6 WHIRLPOOL 061d99416f07eb23e98be80aae5746e19a2fecd38927692a31710757cefaaf28dd7d67baa3fd6b488dcb2f46c72c53d0dee8f13b4aa3cca4664886ffde5b9a30 +AUX ufdbguard-1.24-gentoo.patch 536 SHA256 3e22a42b73c6aa6ff6737455b19d202d661990c9931ffa3785b6aaa78af73d90 SHA512 ddd39b4841d740df5102717dbe2eb41917e49d42338343f7f402e4049a5ab252841138541b7c659934d30cf9a31a7274bf226c108af80826b608fbc2e709f6e4 WHIRLPOOL a463f073cb6255e7c5300e08bcdb649e3dfbf863148261fec91077d98213624c60cab918ada0fa89e696b49bc8d528f080f13c29fada9a253ac940139ef99ab3 +DIST ufdbGuard-1.32.4.tar.gz 2499206 SHA256 037d2652087a544e4bfa10fefcb9e155e730536baf39331b3e9dca26c605e3df SHA512 189cb67c533ab71ba1d3292a376d746e0565a3bf5de17f4407c5892ee24c20cd2574752bdcb08be19621a93114cc69a89767c581d531027ecbf6487ef3119d91 WHIRLPOOL 56ae089ff7463bf2184ae04d15105fe183fa39be807b8440fbd0b4520d47282136e4f07cd5821502a57b2698aab37b8e3ff585b69a2b553bd08c4bbe00f6022d +DIST ufdbguard-1.32.4-manual.pdf 642626 SHA256 42a954d45697a1ea7c4dc8d97faa7e02e2f52414461b4bf73fe975a7a3ebb57d SHA512 98444689c07da3ce9937675b45607ea88fc5a10c65051746cd821650788ec21cbc836a043a486de51813b85d836e255bb3a64a62252808dfe93310e6e169fdb1 WHIRLPOOL 2cb798f2e201e1b7e203ae9d8742336c2b0036b139a842df6c5943a52d4e118aaea97d68fc9e8dbec15a489273f96191c45c82263208fab0644b16c0eabece1d +EBUILD ufdbguard-1.32.4.ebuild 3559 SHA256 a1e3854076b202b7c2bb5a609ec6aa2b63b8a96570c1d41ab57807caf8fa199a SHA512 b73210979b0aa21293783ddf54b956ed4be257c89da4443fd3d887fb3b92931998da8456029e450c1f2e72230d398a91cec24ad432d3f909bd3b0965c2927c82 WHIRLPOOL 825197a41a2ed1699336c1c90759c52d8a9e14e0311faa6f898fc68b6a86183dff643999b32df2cf7f81467ce38f93b9b3f4a3b6cebf60086620faaea1b1040d +MISC ChangeLog 2723 SHA256 007c1cafd7bc5f23c7e71ac6d22a87c56a68df13965543a517e956a735669c8c SHA512 9e3ac43172d234bb2d8a1d4b9bff39aa1be0a978081b3f13ce6e95b7f526a5ffcbe28f5ec34ab223bcb7d5804eb4ea498dab8ef6e1f88c99d8dc19b7b3eb802b WHIRLPOOL f281da5e112f070e4b5372c807f6dd03c6e6fb6a766792a7054c2b5891aa9cf044e03ca35989f6a1430dc22192afee83dadcb5469f8cd6d7bf5314c73c7b9319 +MISC ChangeLog-2015 6485 SHA256 8798a2eea0a3cfa804e4073c96f16189e53c9e1b6f87f52b649b236177408c50 SHA512 8c190580483aefe2e6d449b66a6ed4465f78fd48ef6db832b3a95b1d978e6057c83f1555b36e7e8383b9ea2795a467a1a589fbab4f920f64c78a816e194e4276 WHIRLPOOL f3a3890abe6c5b40b469527299d924198539716a57dcb5e6719979d8f526bc20c83e5ca140cab01a0d90dee257f16cbaed954e58d69a1ca77faebbb6be06df63 +MISC metadata.xml 766 SHA256 38608d2c11064a87bf41ea78d1dc9ebee2c0d9b83837aea270d9b6fb26ccd8c9 SHA512 c01ba7f9fcea23fa66901809d2bef786ecf0ca6673d99ce082840d164a26870c388652ea6ba9764a62773c49f090a236824ae06f6bb36052ebb4767fef38edd9 WHIRLPOOL 8e2f33f15d72bc6e8ea02624ab16a4a2aa290f15174e9a184f6fce07a359f04a6c4fd416c4462aa1ecf2066342871d484dd0df2dba95a574062c994287c80e50 diff --git a/net-proxy/ufdbguard/files/ufdb.confd b/net-proxy/ufdbguard/files/ufdb.confd new file mode 100644 index 000000000000..08c7e5f1a8fa --- /dev/null +++ b/net-proxy/ufdbguard/files/ufdb.confd @@ -0,0 +1,20 @@ +# -*- sh -*- + +# Tables to re-generate when starting or reloading ufdbguard +UFDB_GT="alwaysallow alwaysdeny" + +# Options passed to ufdbGenTable when generating the tables listed in +# UFDB_GT +GENTABLE_OPTIONS="-W" + +# 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..e55c0e7d1a1e --- /dev/null +++ b/net-proxy/ufdbguard/files/ufdb.initd @@ -0,0 +1,82 @@ +#!/sbin/openrc-run +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# reconfig is what the upstream documentation suggests, so let's +# provide it for compatibility. +extra_started_commands="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 + [ -f "${dbhome}/${gt}/domains" ] || continue + + urls= + [ -f "${dbhome}/${gt}/urls" ] && urls="${dbhome}/${gt}/urls" + + ebegin "Generating domainlist ${gt}" + ufdbGenTable ${GENTABLE_OPTIONS} -t "${gt}" -d "${dbhome}/${gt}/domains" ${urls:+-u "${urls}"} + eend $? + 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 \ + --user ${UFDB_USER} \ + --wait 1500 \ + --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 "$(cat /var/run/ufdbguard/ufdbguardd.pid)" + eend $? "Failed to reload ufdbGuard" +} + +reconfig() { + reload +} diff --git a/net-proxy/ufdbguard/files/ufdb.initd.2 b/net-proxy/ufdbguard/files/ufdb.initd.2 new file mode 100644 index 000000000000..44a7f59026e0 --- /dev/null +++ b/net-proxy/ufdbguard/files/ufdb.initd.2 @@ -0,0 +1,67 @@ +#!/sbin/openrc-run +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# reconfig is what the upstream documentation suggests, so let's +# provide it for compatibility. +extra_started_commands="reload reconfig" + +: ${configfile:=/etc/ufdbGuard.conf} + +pidfile=/var/run/ufdbguard/ufdbguardd.pid +command=/usr/libexec/ufdbguard/ufdbguardd +command_arguments="-c ${configfile} ${FUDB_OPTS}" + +start_stop_daemon_args="--user ${UFDB_USER} --wait 1500" + +name="ufdbGuard Daemon" + +depend() { + need localmount + before squid + use logger +} + +get_config() { + # Okay this sounds silly, but it is important because the settings + # in ufdbGuard are quoted, so this unquotes them. + eval echo $(awk '$1 == "'$1'" { print $2 }' "${configfile}") +} + +gentables() { + local dbhome=$(get_config dbhome) + + for gt in ${UFDB_GT} ; do + [ -f "${dbhome}/${gt}/domains" ] || continue + + urls= + [ -f "${dbhome}/${gt}/urls" ] && urls="${dbhome}/${gt}/urls" + + ebegin "Generating domainlist ${gt}" + ufdbGenTable ${GENTABLE_OPTIONS} -t "${gt}" -d "${dbhome}/${gt}/domains" ${urls:+-u "${urls}"} + eend $? + done +} + +start_pre() { + gentables + + checkpath -d -m 0755 -o ${UFDB_USER} $(get_config logdir) "$(dirname "${pidfile}")" +} + +reload() { + if ! [ -f ${pidfile} ]; then + eerror "Unable to find PID file for ufdbguardd, was it just started?" + return 1 + fi + + gentables + + ebegin "Reloading ufdbGuard" + kill -HUP "$(cat ${pidfile})" + 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..f9147648c8b7 --- /dev/null +++ b/net-proxy/ufdbguard/files/ufdbUpdate.cron @@ -0,0 +1,13 @@ +#!/bin/sh +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# 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}" ]; ) && exit + +/usr/sbin/ufdbUpdate + +/etc/init.d/squid rotate diff --git a/net-proxy/ufdbguard/files/ufdbguard-1.24-gentoo.patch b/net-proxy/ufdbguard/files/ufdbguard-1.24-gentoo.patch new file mode 100644 index 000000000000..63da98175a0e --- /dev/null +++ b/net-proxy/ufdbguard/files/ufdbguard-1.24-gentoo.patch @@ -0,0 +1,13 @@ +Index: ufdbGuard-1.24/src/ufdbUpdate.in +=================================================================== +--- ufdbGuard-1.24.orig/src/ufdbUpdate.in ++++ ufdbGuard-1.24/src/ufdbUpdate.in +@@ -39,6 +39,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. ######################################## + diff --git a/net-proxy/ufdbguard/metadata.xml b/net-proxy/ufdbguard/metadata.xml new file mode 100644 index 000000000000..3914a0ffa999 --- /dev/null +++ b/net-proxy/ufdbguard/metadata.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <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> + <upstream> + <remote-id type="sourceforge">ufdbguard</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-proxy/ufdbguard/ufdbguard-1.32.4.ebuild b/net-proxy/ufdbguard/ufdbguard-1.32.4.ebuild new file mode 100644 index 000000000000..49efe94f7e60 --- /dev/null +++ b/net-proxy/ufdbguard/ufdbguard-1.32.4.ebuild @@ -0,0 +1,126 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit eutils flag-o-matic user + +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}/${PV/\.?/}/ReferenceManual.pdf -> ${P}-manual.pdf )" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="doc +httpd" + +COMMON_DEPEND=" + app-arch/bzip2 + dev-libs/openssl:0= + net-misc/wget +" +DEPEND="${COMMON_DEPEND} + sys-devel/bison + sys-devel/flex +" +RDEPEND="${COMMON_DEPEND} + sys-apps/openrc +" + +DOCS=( CHANGELOG README src/sampleufdbGuard.conf ) + +PATCHES=( "${FILESDIR}"/${PN}-1.24-gentoo.patch ) + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + enewgroup squid + enewuser squid -1 -1 /var/cache/squid squid +} + +src_configure() { + # better safe than sorry, the code has a number of possible + # breakage, and at least one certain breakage. + append-flags -fno-strict-aliasing + + econf \ + --with-ufdb-user=squid \ + --with-ufdb-config="${EPREFIX}"/etc \ + --with-ufdb-bindir="${EPREFIX}"/usr/libexec/ufdbguard \ + --with-ufdb-logdir="${EPREFIX}"/var/log/ufdbguard \ + --with-ufdb-dbhome="${EPREFIX}"/usr/share/ufdbguard/blacklists \ + --with-ufdb-images_dir="${EPREFIX}"/usr/share/ufdbguard/images +} + +src_install() { + einstalldocs + doman doc/*.1 + + dobin src/ufdbAnalyse src/ufdbGenTable src/ufdbGrab \ + src/ufdbConvertDB + dosbin src/ufdbUpdate + + exeinto /usr/libexec/ufdbguard + doexe src/mtserver/ufdbguardd src/mtserver/ufdbgclient + + if use httpd; then + exeinto /usr/libexec/ufdbguard + doexe src/ufdbhttpd + fi + + keepdir /usr/share/ufdbguard/blacklists + + insinto /etc + doins src/ufdbGuard.conf + + insinto /usr/share/ufdbguard/images + doins -r src/images/. + + newconfd "${FILESDIR}"/ufdb.confd ufdb + newinitd "${FILESDIR}"/ufdb.initd.2 ufdb + + exeinto /etc/cron.daily + newexe "${FILESDIR}"/ufdbUpdate.cron ufdbUpdate + + use doc && newdoc "${DISTDIR}"/${P}-manual.pdf ReferenceManual.pdf +} + +pkg_postinst() { + elog "The default location for the blacklist database has been" + elog "moved to ${EROOT%/}/usr/share/ufdbguard/blacklists." + elog "" + elog "The configuration file is no longer configurable in the" + elog "service file, and now resides at ${EROOT%/}/etc/ufdbGuard.conf ." + elog "" + elog "The service script has been renamed from ufdbguad to simply" + elog "${EROOT%/}/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 ${EROOT%/}/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 ${EROOT%/}/usr/libexec/ufdbguard/ufdbgclient -l ${EROOT%/}/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 " ${EROOT%/}/usr/share/doc/${PF}/ReferenceManual.pdf" + fi +} |