summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjc_gargma <jc_gargma@iserlohn-fortress.net>2018-07-14 11:25:14 -0700
committerjc_gargma <jc_gargma@iserlohn-fortress.net>2018-07-14 11:25:14 -0700
commit875447c7b6641be2ed25bb240334530d47ae1140 (patch)
tree5c0ebefcce1b72ba22ac7c03ef7630f4aae7df41
downloaddnscrypt-proxy-openrc-875447c7b6641be2ed25bb240334530d47ae1140.tar.xz
Initial commit
-rw-r--r--PKGBUILD40
-rw-r--r--dnscrypt-proxy.confd3
-rw-r--r--dnscrypt-proxy.initd19
3 files changed, 62 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 0000000..b9363e1
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,40 @@
+# Maintainer: artoo <artoo@artixlinux.org>
+
+_url="https://raw.githubusercontent.com/gentoo/gentoo/master"
+
+pkgname=dnscrypt-proxy-openrc
+pkgver=20180712
+pkgrel=2
+pkgdesc="OpenRC dnscrypt-proxy init script"
+arch=('any')
+url="https://github.com/artix-linux/packages"
+license=('GPL2')
+groups=('openrc-system')
+depends=('openrc' 'dnscrypt-proxy')
+backup=('etc/init.d/dnscrypt-proxy')
+source=("dnscrypt-proxy.initd"
+ "dnscrypt-proxy.confd")
+sha256sums=('3ba3a792b1bcdf89fe84926ef8e82f7a40c3f6d66213e7d214b531ea3de89f1a'
+ '047286c75b664ebc88c0b71fd7d39b2b2acfac742538158de712cdfdfdc9024b')
+
+pkgver() {
+ date +%Y%m%d
+}
+
+_inst_initd(){
+ install -Dm755 ${srcdir}/$1.initd ${pkgdir}/etc/init.d/$1
+
+ sed -e 's|/var/run|/run|g' \
+ -e 's|#!/sbin/openrc-run|#!/usr/bin/openrc-run|g' \
+ -e 's|/usr/sbin|/usr/bin|g' \
+ -i ${pkgdir}/etc/init.d/$1
+}
+
+_inst_confd(){
+ install -Dm755 ${srcdir}/$1.confd ${pkgdir}/etc/conf.d/$1
+}
+
+package() {
+ _inst_initd 'dnscrypt-proxy'
+ _inst_confd 'dnscrypt-proxy'
+}
diff --git a/dnscrypt-proxy.confd b/dnscrypt-proxy.confd
new file mode 100644
index 0000000..8abf427
--- /dev/null
+++ b/dnscrypt-proxy.confd
@@ -0,0 +1,3 @@
+DNSCRYPT_OPTS="--config /etc/dnscrypt-proxy/dnscrypt-proxy.toml"
+DNSCRYPT_USER="dnscrypt"
+DNSCRYPT_GROUP="dnscrypt"
diff --git a/dnscrypt-proxy.initd b/dnscrypt-proxy.initd
new file mode 100644
index 0000000..b958a14
--- /dev/null
+++ b/dnscrypt-proxy.initd
@@ -0,0 +1,19 @@
+!/usr/bin/openrc-run
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+command="/usr/bin/dnscrypt-proxy"
+command_args="${DNSCRYPT_OPTS:---config /etc/dnscrypt-proxy/dnscrypt-proxy.toml}"
+command_user="${DNSCRYPT_USER:-dnscrypt}:${DNSCRYPT_GROUP:-dnscrypt}"
+pidfile="/run/${SVCNAME}.pid"
+start_stop_daemon_args="--background --make-pidfile"
+
+depend() {
+ use net logger
+ provide dns
+}
+
+start_pre() {
+ checkpath -q -d -m 0775 -o "${command_user}" /var/cache/"${SVCNAME}"
+ checkpath -q -d -m 0775 -o "${command_user}" /var/log/"${SVCNAME}"
+}