1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools systemd toolchain-funcs user
8 [ "${PV##*_}" = "beta" ] &&
9 PRIVOXY_STATUS="beta" ||
10 PRIVOXY_STATUS="stable"
12 HOMEPAGE="http://www.privoxy.org https://sourceforge.net/projects/ijbswa/"
13 DESCRIPTION="A web proxy with advanced filtering capabilities for enhancing privacy"
14 SRC_URI="mirror://sourceforge/ijbswa/${P%_*}-${PRIVOXY_STATUS}-src.tar.gz"
16 IUSE="+acl client-tags compression editor extended-host-patterns
17 external-filters +fast-redirects +force fuzz graceful-termination
18 +image-blocking ipv6 lfs png-images selinux +stats +threads toggle
19 tools whitelists +zlib"
21 KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86"
26 zlib? ( sys-libs/zlib )
29 extended-host-patterns? ( dev-lang/perl )
30 selinux? ( sec-policy/selinux-privoxy )
41 S="${WORKDIR}/${P%_*}-${PRIVOXY_STATUS}"
43 PATCHES=( "${FILESDIR}"/${PN}-3.0.19-gentoo.patch )
46 if ! use threads; then
48 ewarn "Privoxy may be very slow without threads support, consider to enable them."
49 ewarn "See also http://www.privoxy.org/faq/trouble.html#GENTOO-RICERS"
56 enewuser privoxy -1 -1 /etc/privoxy privoxy
61 mv configure.in configure.ac || die
62 sed -i "s|/p\.p/|/config.privoxy.org/|g" tools/privoxy-regression-test.pl || die
64 # autoreconf needs to be called even if we don't modify any autotools source files
70 # --with-debug only enables debug CFLAGS
71 # --with-docbook and --with-db2html and their deps are useless,
72 # since docs are already pregenerated in the source tarball
74 --docdir=/usr/share/doc/${PF} \
75 --sysconfdir=/etc/privoxy \
76 --enable-dynamic-pcre \
78 --with-group=privoxy \
79 $(use_enable acl acl-support) \
80 $(use_enable compression) \
81 $(use_enable client-tags) \
82 $(use_enable editor) \
83 $(use_enable extended-host-patterns) \
84 $(use_enable fast-redirects) \
87 $(use_enable graceful-termination) \
88 $(use_enable image-blocking) \
89 $(use_enable ipv6 ipv6-support) \
90 $(use_enable kernel_FreeBSD accept-filter) \
91 $(use_enable lfs large-file-support) \
92 $(use_enable png-images no-gifs) \
94 $(use_enable threads pthread) \
95 $(use_enable toggle) \
96 $(use_enable whitelists trust-files) \
103 newinitd "${FILESDIR}/privoxy.initd-3" privoxy
104 systemd_dounit "${FILESDIR}"/${PN}.service
106 insinto /etc/logrotate.d
107 newins "${FILESDIR}/privoxy.logrotate" privoxy
109 diropts -m 0750 -g privoxy -o privoxy
110 keepdir /var/log/privoxy
112 use extended-host-patterns && newbin tools/url-pattern-translator.pl privoxy-url-pattern-translator.pl
114 dobin tools/{privoxy-log-parser.pl,privoxy-regression-test.pl}
115 newbin tools/uagen.pl privoxy-uagen.pl
120 if use extended-host-patterns; then
122 ewarn "You enabled extended-host-patterns, now you *must* convert all action files in"
123 ewarn "PCRE-compatible format, or privoxy will fail to start. Helper tool"
124 ewarn "privoxy-url-pattern-translator.pl is available."