testing/nscd: new aport

This commit is contained in:
Michael Aldridge 2019-11-08 21:15:51 -08:00 committed by Leo
parent 9fcc748e66
commit afa07e42e0
4 changed files with 71 additions and 0 deletions

46
testing/nscd/APKBUILD Normal file
View File

@ -0,0 +1,46 @@
# Maintainer: Michael Aldridge <maldridge@voidlinux.org>
pkgname=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_dev="bison flex"
makedepends="$depends_dev"
install="$pkgname.pre-install $pkgname.post-deinstall"
subpackages="$pkgname-dev $pkgname-doc"
source="
${pkgname}-${pkgver}.tar.gz::https://github.com/pikhq/musl-nscd/archive/v${pkgver}.tar.gz
nscd.initd
"
builddir="$srcdir"/musl-$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 nscd-1.0.2.tar.gz
d66265b6e4f15d330282eb57a0e58860d49e24656a90bb7fe0360fdeecb0a0f0d411e9c21da16f0ceadace0523d994398d64e9dc60aaf3734c4d0aab3b8ae73f nscd.initd"

10
testing/nscd/nscd.initd Normal file
View File

@ -0,0 +1,10 @@
#!/sbin/openrc-run
name="$SVCNAME"
command="/usr/sbin/nscd"
command_args="${NSCD_OPTS:--d -p /var/run/$SVCNAME.pid}"
pidfile="/var/run/$SVCNAME.pid"
start_pre() {
mkdir -p /var/run/nscd
}

View File

@ -0,0 +1,9 @@
#!/bin/sh
# This user is only present on the system to run nscd and does not
# itself own any files. Great care must be taken to never delete a
# user or group that actively controls system resources.
deluser nscd 2>/dev/null
delgroup nscd 2>/dev/null
exit 0

View File

@ -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