dev-util/cargo-about: add 0.6.6, drop 0.6.4
[gentoo-zh.git] / net-dns / dnsmasq-china-list / dnsmasq-china-list-9999.ebuild
blobecefac823457d4d6a034b86e344a203144bfc7e4
1 # Copyright 2022-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit git-r3
8 DESCRIPTION="Chinese-specific configuration to improve your favorite DNS server."
9 HOMEPAGE="https://github.com/felixonmars/dnsmasq-china-list"
11 EGIT_REPO_URI="https://github.com/felixonmars/dnsmasq-china-list.git"
12 EGIT_MIN_CLONE_TYPE=shallow
14 LICENSE="WTFPL-2"
15 SLOT="0"
16 IUSE="+dnsmasq smartdns dnscrypt-proxy"
18 RDEPEND="
19         ${DEPEND}
20         dnsmasq? ( net-dns/dnsmasq )
21         smartdns? ( net-dns/smartdns )
22         dnscrypt-proxy? ( net-dns/dnscrypt-proxy )
25 src_compile() {
26         if use smartdns; then
27                 make smartdns SERVER=china
28                 rm bogus-nxdomain.china.smartdns.conf
29         fi
30         if use dnscrypt-proxy; then
31                 # dnscrypt-proxy won't cache the forwarded domain
32                 # recommend to use systemd-resolved extra stub listener
33                 # for caching china domains
34                 make SERVER="127.0.0.1:5335" dnscrypt-proxy
35         fi
38 src_install() {
39         if use dnsmasq; then
40                 insinto /etc/dnsmasq.d/
41                 dobin dnsmasq-update-china-list
42                 doins *.china.conf
43         fi
44         if use smartdns; then
45                 insinto /etc/smartdns/
46                 doins *.china.smartdns.conf
47         fi
48         if use dnscrypt-proxy; then
49                 insinto /etc/dnscrypt-proxy/
50                 newins dnscrypt-proxy-forwarding-rules.txt forwarding-rules.txt
51         fi
54 pkg_postinst() {
55         ewarn "If you want systemd-resolved to act as a cache for dnscrypt-proxy domestic domains"
56         ewarn "edit /etc/systemd/resolved.conf.d/dnscrypt-proxy.conf:"
57         ewarn "[Resolve]"
58         ewarn "DNS="
59         ewarn "DNSStubListener=no"
60         ewarn "DNSStubListenerExtra=udp:127.0.0.1:5335"