summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--user/dnsmasq/APKBUILD39
-rw-r--r--user/dnsmasq/dnsmasq.confd4
-rw-r--r--user/dnsmasq/dnsmasq.initd29
-rw-r--r--user/dnsmasq/dnsmasq.pre-install7
4 files changed, 79 insertions, 0 deletions
diff --git a/user/dnsmasq/APKBUILD b/user/dnsmasq/APKBUILD
new file mode 100644
index 000000000..1d5756e95
--- /dev/null
+++ b/user/dnsmasq/APKBUILD
@@ -0,0 +1,39 @@
+# Contributor: A. Wilcox <awilfox@adelielinux.org>
+# Maintainer: A. Wilcox <awilfox@adelielinux.org>
+pkgname=dnsmasq
+pkgver=2.89
+pkgrel=0
+pkgdesc="Network infrastructure (DNS, DHCP, PXE) for small networks"
+url="https://dnsmasq.org/"
+arch="all"
+options="!check" # No test suite.
+license="GPL-2.0 OR GPL-3.0"
+depends=""
+makedepends="libidn2-dev nettle-dev"
+subpackages="$pkgname-doc $pkgname-lang $pkgname-openrc"
+install="$pkgname.pre-install"
+source="https://thekelleys.org.uk/$pkgname/$pkgname-$pkgver.tar.xz
+ dnsmasq.initd
+ dnsmasq.confd
+ "
+
+_conf="-DNO_CONNTRACK -DNO_DBUS -DHAVE_IDN -DHAVE_LIBIDN2 -DHAVE_DNSSEC -DNO_LUA"
+
+build() {
+ make PREFIX=/usr CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" COPTS="$_conf"\
+ all-i18n
+}
+
+package() {
+ make PREFIX=/usr CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" COPTS="$_conf"\
+ DESTDIR="$pkgdir" install-i18n
+}
+
+openrc() {
+ install -D -m755 "$srcdir"/dnsmasq.initd "$subpkgdir"/etc/init.d/dnsmasq
+ install -D -m755 "$srcdir"/dnsmasq.confd "$subpkgdir"/etc/conf.d/dnsmasq
+}
+
+sha512sums="4384ed5b673e10eaf6532e6eaeb5c0a6b817581433cc28c632bdcbadbfc050a0ab73bc5b73c98d708cd39515bb3f72168714b0aa5f16436cebdd18020648d428 dnsmasq-2.89.tar.xz
+72ae659a62c61495dc575fa590cbf1352c4bd4f374a6e0a56fce9c641c163b882d8b8097d27605d102e47df49eb68c456baf7b11009a7bb7db98e99429bd80a6 dnsmasq.initd
+9a401bfc408bf1638645c61b8ca734bea0a09ef79fb36648ec7ef21666257234254bbe6c73c82cc23aa1779ddcdda0e6baa2c041866f16dfb9c4e0ba9133eab8 dnsmasq.confd"
diff --git a/user/dnsmasq/dnsmasq.confd b/user/dnsmasq/dnsmasq.confd
new file mode 100644
index 000000000..0e9446307
--- /dev/null
+++ b/user/dnsmasq/dnsmasq.confd
@@ -0,0 +1,4 @@
+# /etc/conf.d/dnsmasq: config file for /etc/init.d/dnsmasq
+
+# See the dnsmasq(8) man page for possible options to put here.
+DNSMASQ_OPTS="--user=dnsmasq --group=dnsmasq"
diff --git a/user/dnsmasq/dnsmasq.initd b/user/dnsmasq/dnsmasq.initd
new file mode 100644
index 000000000..559cb1e89
--- /dev/null
+++ b/user/dnsmasq/dnsmasq.initd
@@ -0,0 +1,29 @@
+#!/sbin/openrc-run
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+extra_started_commands="reload rotate"
+
+pidfile="/var/run/dnsmasq.pid"
+command="/usr/sbin/dnsmasq"
+command_args="-x ${pidfile} ${DNSMASQ_OPTS}"
+retry="TERM/3/TERM/5"
+
+depend() {
+ provide dns
+ need localmount net
+ after bootmisc
+ use logger
+}
+
+reload() {
+ ebegin "Reloading ${RC_SVCNAME}"
+ start-stop-daemon --signal HUP --pidfile "${pidfile}"
+ eend $?
+}
+
+rotate() {
+ ebegin "Reopening ${RC_SVCNAME} log file"
+ start-stop-daemon --signal USR2 --pidfile "${pidfile}"
+ eend $?
+}
diff --git a/user/dnsmasq/dnsmasq.pre-install b/user/dnsmasq/dnsmasq.pre-install
new file mode 100644
index 000000000..38a723e57
--- /dev/null
+++ b/user/dnsmasq/dnsmasq.pre-install
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+groupadd -r dnsmasq -g 200 2>/dev/null
+useradd -c "dnsmasq daemon user" -s /sbin/nologin -g dnsmasq \
+ -M -d /var/empty -r -u 200 dnsmasq 2>/dev/null
+
+exit 0