Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/dnscrypt-proxy/
Date: Fri, 07 Sep 2018 07:32:01
Message-Id: 1536305377.05ca9e6952e072b0b561d627488ada6f72131e4c.gyakovlev@gentoo
1 commit: 05ca9e6952e072b0b561d627488ada6f72131e4c
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 7 07:28:37 2018 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 7 07:29:37 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=05ca9e69
7
8 net-dns/dnscrypt-proxy: add 2.0.17 pre-release
9
10 This one is compatible with go-1.11
11
12 Closes: https://bugs.gentoo.org/665422
13 Package-Manager: Portage-2.3.49, Repoman-2.3.10
14
15 net-dns/dnscrypt-proxy/Manifest | 1 +
16 .../dnscrypt-proxy-2.0.17_pre20180903.ebuild | 118 +++++++++++++++++++++
17 2 files changed, 119 insertions(+)
18
19 diff --git a/net-dns/dnscrypt-proxy/Manifest b/net-dns/dnscrypt-proxy/Manifest
20 index 17454adf09d..25ffa0e6c66 100644
21 --- a/net-dns/dnscrypt-proxy/Manifest
22 +++ b/net-dns/dnscrypt-proxy/Manifest
23 @@ -1 +1,2 @@
24 DIST dnscrypt-proxy-2.0.16.tar.gz 3770249 BLAKE2B e6dc40ec503cff11e4deec1a243875fff42ec7ecba8c7c3552b69322d405c762fa152e7e9417baf944e2a476715f00813a305c20db583970520d35acd378f1d4 SHA512 f138df20560dd440a2ed390c1468d630191ae7b0e50521b4dde3fa7ef4377c3ae6409e8c547858bace53216c84aeeea6794305546b9ff87832f704c160c6782f
25 +DIST dnscrypt-proxy-da5ee45b8ceb9233f4bc21b2a5f1eb7c875947cc.tar.gz 3266257 BLAKE2B bc724b56ef75faf1e2416e81fe3e68947f1581ef1c85575b8c7c5bde721f41f32604835678923dd12654b23a2c97a7e84d598eb8c7a7f553cb59c998141ff19c SHA512 cd23bc4cee7a1d9337ad5a41cf49c5603d9bfb8b7a0458532de68df35f8bd1bb75c39c069dc692506673bdba485e360b23712e997072ed86b541597aa3ea9b12
26
27 diff --git a/net-dns/dnscrypt-proxy/dnscrypt-proxy-2.0.17_pre20180903.ebuild b/net-dns/dnscrypt-proxy/dnscrypt-proxy-2.0.17_pre20180903.ebuild
28 new file mode 100644
29 index 00000000000..c9ee2a53186
30 --- /dev/null
31 +++ b/net-dns/dnscrypt-proxy/dnscrypt-proxy-2.0.17_pre20180903.ebuild
32 @@ -0,0 +1,118 @@
33 +# Copyright 1999-2018 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=6
37 +
38 +EGIT_COMMIT="da5ee45b8ceb9233f4bc21b2a5f1eb7c875947cc"
39 +EGO_PN="github.com/jedisct1/${PN}"
40 +MY_P="${PN}-${EGIT_COMMIT}"
41 +
42 +inherit fcaps golang-build systemd user
43 +
44 +DESCRIPTION="A flexible DNS proxy, with support for encrypted DNS protocols"
45 +HOMEPAGE="https://github.com/jedisct1/dnscrypt-proxy"
46 +SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${MY_P}.tar.gz"
47 +
48 +LICENSE="ISC"
49 +SLOT="0"
50 +KEYWORDS="~amd64 ~arm ~x86"
51 +IUSE="pie test"
52 +
53 +FILECAPS=( cap_net_bind_service+ep usr/bin/dnscrypt-proxy )
54 +PATCHES=( "${FILESDIR}"/config-full-paths-r10.patch )
55 +
56 +S="${WORKDIR}/${MY_P}"
57 +
58 +pkg_setup() {
59 + enewgroup dnscrypt-proxy
60 + enewuser dnscrypt-proxy -1 -1 /var/empty dnscrypt-proxy
61 +}
62 +
63 +src_prepare() {
64 + default
65 + # Create directory structure suitable for building
66 + mkdir -p "src/${EGO_PN%/*}" || die
67 + mv "${PN}" "src/${EGO_PN}" || die
68 + mv "vendor" "src/" || die
69 +}
70 +
71 +src_configure() {
72 + EGO_BUILD_FLAGS="-buildmode=$(usex pie pie default)"
73 +}
74 +
75 +src_compile() {
76 + ego_pn_check
77 + GOPATH="${WORKDIR}/${MY_P}:$(get_golibdir_gopath)" \
78 + go build -v -work -x ${EGO_BUILD_FLAGS} "${EGO_PN}" || die
79 +}
80 +
81 +src_test() {
82 + ego_pn_check
83 + GOPATH="${WORKDIR}/${MY_P}:$(get_golibdir_gopath)" \
84 + go test -v -work -x "${EGO_PN}"
85 +}
86 +
87 +src_install() {
88 + dobin dnscrypt-proxy
89 +
90 + insinto /etc/dnscrypt-proxy
91 + newins "src/${EGO_PN}"/example-dnscrypt-proxy.toml dnscrypt-proxy.toml
92 + doins "src/${EGO_PN}"/example-{blacklist.txt,whitelist.txt}
93 + doins "src/${EGO_PN}"/example-{cloaking-rules.txt,forwarding-rules.txt}
94 +
95 + insinto /usr/share/dnscrypt-proxy
96 + doins -r "utils/generate-domains-blacklists/."
97 +
98 + newinitd "${FILESDIR}"/dnscrypt-proxy.initd dnscrypt-proxy
99 + newconfd "${FILESDIR}"/dnscrypt-proxy.confd dnscrypt-proxy
100 + systemd_newunit "${FILESDIR}"/dnscrypt-proxy.service dnscrypt-proxy.service
101 + systemd_newunit "${FILESDIR}"/dnscrypt-proxy.socket dnscrypt-proxy.socket
102 +
103 + einstalldocs
104 +}
105 +
106 +pkg_postinst() {
107 + fcaps_pkg_postinst
108 +
109 + if ! use filecaps; then
110 + ewarn "'filecaps' USE flag is disabled"
111 + ewarn "${PN} will fail to listen on port 53"
112 + ewarn "please do one the following:"
113 + ewarn "1) re-enable 'filecaps'"
114 + ewarn "2) change port to > 1024"
115 + ewarn "3) configure to run ${PN} as root (not recommended)"
116 + ewarn
117 + fi
118 +
119 + local v
120 + for v in ${REPLACING_VERSIONS}; do
121 + if [[ ${v} == 1.* ]] ; then
122 + elog "Version 2 is a complete rewrite of ${PN}"
123 + elog "please clean up old config/log files"
124 + elog
125 + fi
126 + if [[ ${v} == 2.* ]] ; then
127 + elog "As of version 2.0.12 of ${PN} runs as an 'dnscrypt-proxy' user/group"
128 + elog "you can remove obsolete 'dnscrypt' accounts from the system"
129 + elog
130 + fi
131 + done
132 +
133 + if systemd_is_booted || has_version sys-apps/systemd; then
134 + elog "Using systemd socket activation may cause issues with speed"
135 + elog "latency and reliability of ${PN} and is discouraged by upstream"
136 + elog "Existing installations advised to disable 'dnscrypt-proxy.socket'"
137 + elog "It is disabled by default for new installations"
138 + elog "check "$(systemd_get_systemunitdir)/${PN}.service" for details"
139 + elog
140 +
141 + fi
142 +
143 + elog "After starting the service you will need to update your"
144 + elog "/etc/resolv.conf and replace your current set of resolvers"
145 + elog "with:"
146 + elog
147 + elog "nameserver 127.0.0.1"
148 + elog
149 + elog "Also see https://github.com/jedisct1/${PN}/wiki"
150 +}