Subject: [PATCH] testing/musl-nscd: new aport

From: opal hart <[email-masked]>
Date: Wed, 25 Sep 2019 21:34:33 +0000

---
 testing/musl-nscd/APKBUILD                 | 47 ++++++++++++++++++++++
 testing/musl-nscd/musl-nscd.initd          |  6 +++
 testing/musl-nscd/musl-nscd.post-deinstall |  6 +++
 testing/musl-nscd/musl-nscd.pre-install    |  6 +++
 4 files changed, 65 insertions(+)
 create mode 100644 testing/musl-nscd/APKBUILD
 create mode 100755 testing/musl-nscd/musl-nscd.initd
 create mode 100644 testing/musl-nscd/musl-nscd.post-deinstall
 create mode 100644 testing/musl-nscd/musl-nscd.pre-install

diff --git a/testing/musl-nscd/APKBUILD b/testing/musl-nscd/APKBUILD
new file mode 100644
index 0000000000..70da018ecb
--- /dev/null
+++ b/testing/musl-nscd/APKBUILD
@@ -0,0 +1,47 @@
+# Maintainer: Josiah Worcester <[email-masked]>
+pkgname=musl-nscd
+pkgver=1.0.2
+pkgrel=0
+pkgdesc="Implementation of nscd for nsswitch modules for musl"
+url="https://github.com/pikhq/musl-nscd"
+arch="all"
+license="MIT"
+depends=""
+depends_dev="bison flex"
+makedepends="$depends_dev"
+install="$pkgname.pre-install $pkgname.post-deinstall"
+subpackages="$pkgname-dev $pkgname-doc $pkgname-openrc"
+source="
+	${pkgname}-${pkgver}.tar.gz::https://github.com/pikhq/musl-nscd/archive/v${pkgver}.tar.gz
+	musl-nscd.initd
+	"
+
+builddir="$srcdir"/$pkgname-$pkgver
+build() {
+	cd "$builddir"
+	./configure \
+		--build=$CBUILD \
+		--host=$CHOST \
+		--prefix=/usr \
+		--sysconfdir=/etc \
+		--mandir=/usr/share/man \
+		--localstatedir=/var \
+	make
+}
+
+package() {
+	cd "$builddir"
+	make DESTDIR="$pkgdir" install
+
+	install -m644 -D include/nss.h \
+		"$pkgdir"/usr/include
+
+	install -m644 -D COPYRIGHT \
+		"$pkgdir"/usr/share/licenses/$pkgname/COPYRIGHT
+
+	install -m755 -D "$srcdir"/$pkgname.initd \
+		"$pkgdir"/etc/init.d/$pkgname
+}
+
+sha512sums="45cd73f1e0eee7b32c3dcdfa96c0a11379f6208389b87fee97016af0ecb19e9e7d2a2f10e0df6e5ed8a6ad4bbbef70c01cd31ac3631fb1bcce6e69bf48843a3d  musl-nscd-1.0.2.tar.gz
+be2bfc7ac417f81dabd77862fb78f60835bc2590e427f6947356421037f6fbab52514b6d728c03bcb2e9a6559a159468a70856b3cbfc078099d71919d9e8818a  musl-nscd.initd"
diff --git a/testing/musl-nscd/musl-nscd.initd b/testing/musl-nscd/musl-nscd.initd
new file mode 100755
index 0000000000..c47d2b71e7
--- /dev/null
+++ b/testing/musl-nscd/musl-nscd.initd
@@ -0,0 +1,6 @@
+#!/sbin/openrc-run
+
+name="$SVCNAME"
+pidfile="/var/run/$SVCNAME.pid"
+command="/usr/sbin/$SVCNAME"
+command_args="${NSCD_OPTS:-d -p ${pidfile}}"
diff --git a/testing/musl-nscd/musl-nscd.post-deinstall b/testing/musl-nscd/musl-nscd.post-deinstall
new file mode 100644
index 0000000000..f15715b7ab
--- /dev/null
+++ b/testing/musl-nscd/musl-nscd.post-deinstall
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+deluser nscd 2>/dev/null
+delgroup nscd 2>/dev/null
+
+exit 0
diff --git a/testing/musl-nscd/musl-nscd.pre-install b/testing/musl-nscd/musl-nscd.pre-install
new file mode 100644
index 0000000000..45e214e5ad
--- /dev/null
+++ b/testing/musl-nscd/musl-nscd.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup -S nscd 2>/dev/null
+adduser -S -D -H -s /bin/false -G nscd -g nscd nscd 2>/dev/null
+
+exit 0
-- 
2.23.0