pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/dnscrypt-proxy2 dnscrypt-proxy2: Add rc script / d...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b5076b7e9987
branches:  trunk
changeset: 323872:b5076b7e9987
user:      nia <nia%pkgsrc.org@localhost>
date:      Mon Oct 01 15:05:48 2018 +0000

description:
dnscrypt-proxy2: Add rc script / default configuration file.

diffstat:

 net/dnscrypt-proxy2/Makefile                  |  11 +++++++++-
 net/dnscrypt-proxy2/PLIST                     |   3 +-
 net/dnscrypt-proxy2/files/dnscrypt_proxy.sh   |  29 +++++++++++++++++++++++++++
 net/dnscrypt-proxy2/files/dnscrypt_proxy.toml |  23 +++++++++++++++++++++
 4 files changed, 64 insertions(+), 2 deletions(-)

diffs (98 lines):

diff -r 7d4d579ba7d5 -r b5076b7e9987 net/dnscrypt-proxy2/Makefile
--- a/net/dnscrypt-proxy2/Makefile      Mon Oct 01 14:59:49 2018 +0000
+++ b/net/dnscrypt-proxy2/Makefile      Mon Oct 01 15:05:48 2018 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.2 2018/08/05 12:28:06 nia Exp $
+# $NetBSD: Makefile,v 1.3 2018/10/01 15:05:48 nia Exp $
 
 PKGNAME=       dnscrypt-proxy2-2.0.16
 DISTNAME=      dnscrypt-proxy-${PKGVERSION_NOREV}
+PKGREVISION=   1
 CATEGORIES=    net security
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=jedisct1/}
 GITHUB_PROJECT=        dnscrypt-proxy
@@ -18,8 +19,16 @@
 GO_SRCPATH=    github.com/jedisct1/dnscrypt-proxy/
 GO_DIST_BASE=  ${DISTNAME}
 
+EGDIR=         ${PREFIX}/share/examples/dnscrypt-proxy
+
+RCD_SCRIPTS=   dnscrypt_proxy
+CONF_FILES=    ${EGDIR}/dnscrypt_proxy.toml ${PKG_SYSCONFDIR}/dnscrypt_proxy.toml
+
+INSTALLATION_DIRS+=    ${EGDIR}
+
 do-install:
        ${RUN} cd ${WRKDIR}; [ ! -d bin ] || ${PAX} -rw bin ${DESTDIR}${PREFIX}
+       ${INSTALL_DATA} ${FILESDIR}/dnscrypt_proxy.toml ${DESTDIR}${EGDIR}/dnscrypt_proxy.toml
 
 .include "../../lang/go/go-package.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r 7d4d579ba7d5 -r b5076b7e9987 net/dnscrypt-proxy2/PLIST
--- a/net/dnscrypt-proxy2/PLIST Mon Oct 01 14:59:49 2018 +0000
+++ b/net/dnscrypt-proxy2/PLIST Mon Oct 01 15:05:48 2018 +0000
@@ -1,2 +1,3 @@
-@comment $NetBSD: PLIST,v 1.1 2018/07/15 16:10:32 bsiegert Exp $
+@comment $NetBSD: PLIST,v 1.2 2018/10/01 15:05:48 nia Exp $
 bin/dnscrypt-proxy
+share/examples/dnscrypt-proxy/dnscrypt_proxy.toml
diff -r 7d4d579ba7d5 -r b5076b7e9987 net/dnscrypt-proxy2/files/dnscrypt_proxy.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/dnscrypt-proxy2/files/dnscrypt_proxy.sh       Mon Oct 01 15:05:48 2018 +0000
@@ -0,0 +1,29 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: dnscrypt_proxy.sh,v 1.1 2018/10/01 15:05:48 nia Exp $
+#
+# PROVIDE: dnscrypt_proxy
+# REQUIRE: DAEMON
+
+. /etc/rc.subr
+
+name="dnscrypt_proxy"
+rcvar=${name}
+command="@PREFIX@/bin/dnscrypt-proxy"
+command_args="-syslog -config @PKG_SYSCONFDIR@/${name}.toml -pidfile @VARBASE@/run/${name}.pid &"
+required_files="@PKG_SYSCONFDIR@/${name}.toml"
+pidfile="@VARBASE@/run/${name}.pid"
+extra_commands="configtest"
+configtest_cmd="dnscrypt_proxy_configtest"
+
+dnscrypt_proxy_configtest()
+{
+       if [ ! -f ${required_files} ]; then
+               warn "${required_files} does not exist."
+               return 1;
+       fi
+       ${command} -check -config ${required_files}
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff -r 7d4d579ba7d5 -r b5076b7e9987 net/dnscrypt-proxy2/files/dnscrypt_proxy.toml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/dnscrypt-proxy2/files/dnscrypt_proxy.toml     Mon Oct 01 15:05:48 2018 +0000
@@ -0,0 +1,23 @@
+listen_addresses = ['127.0.0.1:53', '[::1]:53']
+
+ipv4_servers = true
+ipv6_servers = true
+
+require_nolog = true
+require_nofilter = true
+
+dnscrypt_servers = true
+doh_servers = false
+
+fallback_resolver = '1.1.1.1:53'
+ignore_system_dns = true
+
+use_syslog = true
+
+[sources]
+       [sources.'public-resolvers']
+       url = 'https://download.dnscrypt.info/resolvers-list/v2/public-resolvers.md'
+       cache_file = 'public-resolvers.md'
+       minisign_key = 'RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3'
+       refresh_delay = 72
+       prefix = ''



Home | Main Index | Thread Index | Old Index