From 5fe91c832626d7e6db788a376a1cca0ce53c2352 Mon Sep 17 00:00:00 2001 From: Yixun Lan Date: Sat, 9 Apr 2022 08:40:46 +0800 Subject: [PATCH] net-dns/smartdns: initial version 36.1 added Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Yixun Lan --- net-dns/smartdns/Manifest | 1 + net-dns/smartdns/files/smartdns.confd | 5 ++++ net-dns/smartdns/files/smartdns.initd | 24 +++++++++++++++++++ net-dns/smartdns/metadata.xml | 8 +++++++ net-dns/smartdns/smartdns-36.1.ebuild | 33 +++++++++++++++++++++++++++ 5 files changed, 71 insertions(+) create mode 100644 net-dns/smartdns/Manifest create mode 100644 net-dns/smartdns/files/smartdns.confd create mode 100644 net-dns/smartdns/files/smartdns.initd create mode 100644 net-dns/smartdns/metadata.xml create mode 100644 net-dns/smartdns/smartdns-36.1.ebuild diff --git a/net-dns/smartdns/Manifest b/net-dns/smartdns/Manifest new file mode 100644 index 0000000000000..274c5dc55d5ed --- /dev/null +++ b/net-dns/smartdns/Manifest @@ -0,0 +1 @@ +DIST smartdns-36.1.tar.gz 499257 BLAKE2B c0bca0b8751afd67d7628d993f1093fb95c0864d153e65ebb31d0f9ccf76c7581f98a7fc16cf503cfa83f4d3e9b05e7c21818f34fa34ce770e9e0f0c3eced921 SHA512 88da539f12351bfef256e93d851a08247699ed2f08724abd5d0cc770a6b0475e0540d2aef6f43524edc48cccd9f58db3ad4c68561b26812bf8863b543748c549 diff --git a/net-dns/smartdns/files/smartdns.confd b/net-dns/smartdns/files/smartdns.confd new file mode 100644 index 0000000000000..f7ec5258db73c --- /dev/null +++ b/net-dns/smartdns/files/smartdns.confd @@ -0,0 +1,5 @@ +# Default settings for smartdns server. This file is sourced by /bin/sh from +# /etc/init.d/smartdns. + +# Options to pass to smartdns +SMART_DNS_OPTS= diff --git a/net-dns/smartdns/files/smartdns.initd b/net-dns/smartdns/files/smartdns.initd new file mode 100644 index 0000000000000..f6084c557daa3 --- /dev/null +++ b/net-dns/smartdns/files/smartdns.initd @@ -0,0 +1,24 @@ +#!/sbin/openrc-run +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need net +} + +start() { + ebegin "Starting smartdns daemon" + start-stop-daemon --start --exec /usr/sbin/smartdns \ + --pidfile /run/smartdns.pid \ + -- -p /run/smartdns.pid \ + ${SMART_DNS_OPTS} + eend $* +} + +stop() { + ebegin "Stopping smartdns daemon" + start-stop-daemon --stop --exec /usr/sbin/smartdns \ + --pidfile /run/smartdns.pid + eend $? +} + diff --git a/net-dns/smartdns/metadata.xml b/net-dns/smartdns/metadata.xml new file mode 100644 index 0000000000000..1ab427e8f0b6a --- /dev/null +++ b/net-dns/smartdns/metadata.xml @@ -0,0 +1,8 @@ + + + + + dlan@gentoo.org + Yixun Lan + + diff --git a/net-dns/smartdns/smartdns-36.1.ebuild b/net-dns/smartdns/smartdns-36.1.ebuild new file mode 100644 index 0000000000000..b3addca606311 --- /dev/null +++ b/net-dns/smartdns/smartdns-36.1.ebuild @@ -0,0 +1,33 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit systemd +DESCRIPTION="A local DNS server returns the fastest access results" +HOMEPAGE="https://github.com/pymumu/smartdns" +SRC_URI="https://github.com/pymumu/smartdns/archive/refs/tags/Release${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64" + +DEPEND="dev-libs/openssl:0=" +RDEPEND="${DEPEND}" +BDEPEND="" + +S="${WORKDIR}/${PN}-Release${PV}" + +src_prepare() { + default + sed -i -e "/install .*default /d" \ + -e "/install .*init.d /d" Makefile || die +} + +src_install() { + emake DESTDIR="${D}" \ + SYSTEMDSYSTEMUNITDIR="$(systemd_get_systemunitdir)" install + + newconfd "${FILESDIR}"/smartdns.confd smartdns + newinitd "${FILESDIR}"/smartdns.initd smartdns +}