From f3cafd190f4b4632ccac19b6fde6e8f948eeb34e Mon Sep 17 00:00:00 2001 From: Quentin Retornaz Date: Wed, 25 Apr 2018 21:56:18 +0200 Subject: net-dns/getdns: add systemd unit files Signed-off-by: Anthony G. Basile --- net-dns/getdns/files/stubby.systemd | 12 ++++++ net-dns/getdns/files/stubby.tmpfilesd | 2 + net-dns/getdns/getdns-1.4.1-r1.ebuild | 73 +++++++++++++++++++++++++++++++++++ net-dns/getdns/getdns-1.4.1.ebuild | 71 ---------------------------------- 4 files changed, 87 insertions(+), 71 deletions(-) create mode 100644 net-dns/getdns/files/stubby.systemd create mode 100644 net-dns/getdns/files/stubby.tmpfilesd create mode 100644 net-dns/getdns/getdns-1.4.1-r1.ebuild delete mode 100644 net-dns/getdns/getdns-1.4.1.ebuild (limited to 'net-dns') diff --git a/net-dns/getdns/files/stubby.systemd b/net-dns/getdns/files/stubby.systemd new file mode 100644 index 000000000000..b85b8e90b036 --- /dev/null +++ b/net-dns/getdns/files/stubby.systemd @@ -0,0 +1,12 @@ +[Unit] +Description=stubby DNS resolver + +[Service] +WorkingDirectory=/run/stubby +ExecStart=/usr/bin/stubby +AmbientCapabilities=CAP_NET_BIND_SERVICE +CapabilityBoundingSet=CAP_NET_BIND_SERVICE +User=stubby + +[Install] +WantedBy=multi-user.target diff --git a/net-dns/getdns/files/stubby.tmpfilesd b/net-dns/getdns/files/stubby.tmpfilesd new file mode 100644 index 000000000000..bf70492743ad --- /dev/null +++ b/net-dns/getdns/files/stubby.tmpfilesd @@ -0,0 +1,2 @@ +# tmpfiles.d (5) for use with stubby.service +d /run/stubby 0750 root stubby - - diff --git a/net-dns/getdns/getdns-1.4.1-r1.ebuild b/net-dns/getdns/getdns-1.4.1-r1.ebuild new file mode 100644 index 000000000000..db4a0afb74a6 --- /dev/null +++ b/net-dns/getdns/getdns-1.4.1-r1.ebuild @@ -0,0 +1,73 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit user fcaps systemd + +DESCRIPTION="Modern asynchronous DNS API" +HOMEPAGE="https://getdnsapi.net/" +SRC_URI="https://getdnsapi.net/releases/${P//./-}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="stubby +getdns_query +getdns_server_mon libressl +idn +unbound libevent libev libuv +threads static-libs" + +DEPEND=" + dev-libs/libbsd:= + dev-libs/libyaml:= + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) + idn? ( net-dns/libidn2:= ) + unbound? ( >=net-dns/unbound-1.4.16:= ) + libevent? ( dev-libs/libevent:= ) + libev? ( dev-libs/libev:= ) + libuv? ( dev-libs/libuv:= ) +" +RDEPEND=" + ${DEPEND} + stubby? ( sys-libs/libcap:= ) +" + +src_configure() { + econf \ + --runstatedir=/var/run \ + --with-piddir=/var/run/stubby \ + $(use_with stubby) \ + $(use_with getdns_query) \ + $(use_with getdns_server_mon) \ + $(use_with idn libidn2) \ + --without-libidn \ + $(use_with unbound libunbound) \ + $(use_with libevent) \ + $(use_with libev) \ + $(use_with libuv) \ + $(use_with threads libpthread) + $(use_enable static-libs static) +} + +src_install() { + default + if use stubby; then + newinitd "${FILESDIR}"/stubby.initd stubby + newconfd "${FILESDIR}"/stubby.confd stubby + systemd_newunit "${FILESDIR}"/stubby.systemd stubby.service + systemd_newtmpfilesd "${FILESDIR}"/stubby.tmpfilesd stubby.conf + fi +} + +pkg_postinst() { + if use stubby; then + enewgroup stubby + enewuser stubby -1 -1 -1 stubby + fcaps cap_net_bind_service=ei /usr/bin/stubby + fi + + if has_version