You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
127 lines
3.5 KiB
127 lines
3.5 KiB
8 years ago
|
# Copyright 1999-2016 Gentoo Foundation
|
||
12 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
8 years ago
|
EAPI=6
|
||
12 years ago
|
|
||
11 years ago
|
inherit eutils flag-o-matic user
|
||
12 years ago
|
|
||
|
MY_P="ufdbGuard-${PV}"
|
||
|
|
||
10 years ago
|
DESCRIPTION="ufdbGuard is a redirector for the Squid internet proxy"
|
||
12 years ago
|
HOMEPAGE="http://www.urlfilterdb.com/en/products/ufdbguard.html"
|
||
|
SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz
|
||
8 years ago
|
doc? ( mirror://sourceforge/${PN}/${PV/\.?/}/ReferenceManual.pdf -> ${P}-manual.pdf )"
|
||
12 years ago
|
|
||
|
LICENSE="GPL-2"
|
||
|
SLOT="0"
|
||
|
KEYWORDS="~amd64 ~x86"
|
||
8 years ago
|
IUSE="doc +httpd"
|
||
12 years ago
|
|
||
8 years ago
|
COMMON_DEPEND="
|
||
12 years ago
|
app-arch/bzip2
|
||
8 years ago
|
dev-libs/openssl:0=
|
||
|
net-misc/wget
|
||
|
"
|
||
|
DEPEND="${COMMON_DEPEND}
|
||
12 years ago
|
sys-devel/bison
|
||
8 years ago
|
sys-devel/flex
|
||
|
"
|
||
|
RDEPEND="${COMMON_DEPEND}
|
||
|
sys-apps/openrc
|
||
|
"
|
||
|
|
||
|
DOCS=( CHANGELOG README src/sampleufdbGuard.conf )
|
||
12 years ago
|
|
||
8 years ago
|
PATCHES=( "${FILESDIR}"/${PN}-1.24-gentoo.patch )
|
||
12 years ago
|
|
||
|
S="${WORKDIR}/${MY_P}"
|
||
|
|
||
|
pkg_setup() {
|
||
10 years ago
|
enewgroup squid
|
||
|
enewuser squid -1 -1 /var/cache/squid squid
|
||
12 years ago
|
}
|
||
|
|
||
|
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 \
|
||
8 years ago
|
--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
|
||
12 years ago
|
}
|
||
|
|
||
|
src_install() {
|
||
8 years ago
|
einstalldocs
|
||
12 years ago
|
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
|
||
8 years ago
|
doins -r src/images/.
|
||
12 years ago
|
|
||
|
newconfd "${FILESDIR}"/ufdb.confd ufdb
|
||
|
newinitd "${FILESDIR}"/ufdb.initd.2 ufdb
|
||
|
|
||
|
exeinto /etc/cron.daily
|
||
|
newexe "${FILESDIR}"/ufdbUpdate.cron ufdbUpdate
|
||
|
|
||
8 years ago
|
use doc && newdoc "${DISTDIR}"/${P}-manual.pdf ReferenceManual.pdf
|
||
12 years ago
|
}
|
||
|
|
||
|
pkg_postinst() {
|
||
|
elog "The default location for the blacklist database has been"
|
||
8 years ago
|
elog "moved to ${EROOT%/}/usr/share/ufdbguard/blacklists."
|
||
12 years ago
|
elog ""
|
||
|
elog "The configuration file is no longer configurable in the"
|
||
8 years ago
|
elog "service file, and now resides at ${EROOT%/}/etc/ufdbGuard.conf ."
|
||
12 years ago
|
elog ""
|
||
|
elog "The service script has been renamed from ufdbguad to simply"
|
||
8 years ago
|
elog "${EROOT%/}/etc/init.d/ufdb, to follow the official documentation, and"
|
||
12 years ago
|
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"
|
||
8 years ago
|
elog "URLfilterDB, directly in ${EROOT%/}/etc/conf.d/ufdb without touching"
|
||
12 years ago
|
elog "the script itself."
|
||
|
elog ""
|
||
|
elog "To enable ufdbguard in squid, you should add this to your"
|
||
|
elog "squid.conf:"
|
||
|
elog ""
|
||
8 years ago
|
elog " url_rewrite_program ${EROOT%/}/usr/libexec/ufdbguard/ufdbgclient -l ${EROOT%/}/var/log/ufdbguard"
|
||
12 years ago
|
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"
|
||
8 years ago
|
elog " ${EROOT%/}/usr/share/doc/${PF}/ReferenceManual.pdf"
|
||
12 years ago
|
fi
|
||
|
}
|