dev-python/aiodns: arm64 keyworded (bug #723444)
[gentoo.git] / net-proxy / tinyproxy / tinyproxy-1.10.0-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit autotools systemd tmpfiles user
7
8 DESCRIPTION="A lightweight HTTP/SSL proxy"
9 HOMEPAGE="https://github.com/tinyproxy/tinyproxy/"
10 SRC_URI="https://github.com/tinyproxy/tinyproxy/releases/download/${PV}/${P}.tar.xz"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="~alpha amd64 ~arm ~ia64 ppc ~sparc x86"
15
16 IUSE="test debug +filter-proxy reverse-proxy transparent-proxy
17 +upstream-proxy +xtinyproxy-header"
18 RESTRICT="!test? ( test )"
19
20 REQUIRED_USE="test? ( xtinyproxy-header )"
21
22 pkg_setup() {
23         enewgroup ${PN}
24         enewuser ${PN} "" "" "" ${PN}
25 }
26
27 src_prepare() {
28         default
29
30         sed -i \
31                 -e "s|nobody|${PN}|g" \
32                 etc/${PN}.conf.in || die "sed failed"
33
34         eautoreconf
35 }
36
37 src_configure() {
38         econf \
39                 $(use_enable debug) \
40                 $(use_enable filter-proxy filter) \
41                 $(use_enable reverse-proxy reverse) \
42                 $(use_enable transparent-proxy transparent) \
43                 $(use_enable upstream-proxy upstream) \
44                 $(use_enable xtinyproxy-header xtinyproxy) \
45                 --localstatedir=/var
46 }
47
48 src_test() {
49         # The make check target does not run the test suite
50         emake test
51 }
52
53 src_install() {
54         default
55
56         dodoc AUTHORS ChangeLog NEWS README TODO
57
58         diropts -m0775 -o ${PN} -g ${PN}
59         keepdir /var/log/${PN}
60
61         newinitd "${FILESDIR}"/${PN}-1.10.0.initd tinyproxy
62         systemd_newunit "${FILESDIR}"/${PN}-1.10.0.service tinyproxy.service
63         systemd_dotmpfilesd "${FILESDIR}"/${PN}.tmpfiles.conf
64 }
65
66 pkg_postinst() {
67         tmpfiles_process ${PN}.tmpfiles.conf
68
69         elog "For filtering domains and URLs, enable filter option in the configuration"
70         elog "file and add them to the filter file (one domain or URL per line)."
71 }