summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-07-31 11:32:02 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-07-31 11:33:05 +0000
commite816ab85079bdaac9046d1ab6b17a284667855f2 (patch)
tree6d5afa51530f8ad0435eb188abcc3ff131c0c16f /testing
parentaacd0979ee470e2583a2cc745ebcefa05b5c06d6 (diff)
downloadaports-e816ab85079bdaac9046d1ab6b17a284667855f2.tar.bz2
aports-e816ab85079bdaac9046d1ab6b17a284667855f2.tar.xz
testing/nss-pam-ldapd: add user/group and init script
ref #2911
Diffstat (limited to 'testing')
-rw-r--r--testing/nss-pam-ldapd/APKBUILD17
-rw-r--r--testing/nss-pam-ldapd/nslcd.initd27
-rw-r--r--testing/nss-pam-ldapd/nss-pam-ldapd.pre-install9
3 files changed, 47 insertions, 6 deletions
diff --git a/testing/nss-pam-ldapd/APKBUILD b/testing/nss-pam-ldapd/APKBUILD
index 55b68f059..e92283128 100644
--- a/testing/nss-pam-ldapd/APKBUILD
+++ b/testing/nss-pam-ldapd/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer:
pkgname=nss-pam-ldapd
pkgver=0.9.3
-pkgrel=0
+pkgrel=1
pkgdesc="An nsswitch module which uses directory servers"
url="http://arthurdejong.org/nss-pam-ldapd/"
arch="all"
@@ -10,9 +10,10 @@ license="LGPLv2+"
depends=""
depends_dev="linux-pam-dev openldap-dev"
makedepends="$depends_dev"
-install=""
+install="nss-pam-ldapd.pre-install"
subpackages="$pkgname-doc"
-source="http://arthurdejong.org/nss-pam-ldapd/nss-pam-ldapd-$pkgver.tar.gz"
+source="http://arthurdejong.org/nss-pam-ldapd/nss-pam-ldapd-$pkgver.tar.gz
+ nslcd.initd"
_builddir="$srcdir"/nss-pam-ldapd-$pkgver
prepare() {
@@ -44,8 +45,12 @@ package() {
cd "$_builddir"
make DESTDIR="$pkgdir" install || return 1
rm -f "$pkgdir"/usr/lib/*.la
+ install -Dm755 "$srcdir"/nslcd.initd "$pkgdir"/etc/init.d/nslcd
}
-md5sums="89c433fa238c8d7b9420260768bbd03c nss-pam-ldapd-0.9.3.tar.gz"
-sha256sums="b42ad9fef4664b21845358c32e9c776c31858df2981b9e0e7bf686ce511884fa nss-pam-ldapd-0.9.3.tar.gz"
-sha512sums="8f2e68d5adf63d60f6f60fd2abbbde17a8cd9c7f082d7302ab1201168c624eeffe4d63c459172723cc20f120b3d2b091fe838c9d8857bc01aa8fcb3b3dd99825 nss-pam-ldapd-0.9.3.tar.gz"
+md5sums="89c433fa238c8d7b9420260768bbd03c nss-pam-ldapd-0.9.3.tar.gz
+af4621ebbe7a732987b38e8f301efeb8 nslcd.initd"
+sha256sums="b42ad9fef4664b21845358c32e9c776c31858df2981b9e0e7bf686ce511884fa nss-pam-ldapd-0.9.3.tar.gz
+a46a25da684b51725a820a855473d868cbe6620076f4531bdee8f445d4a194de nslcd.initd"
+sha512sums="8f2e68d5adf63d60f6f60fd2abbbde17a8cd9c7f082d7302ab1201168c624eeffe4d63c459172723cc20f120b3d2b091fe838c9d8857bc01aa8fcb3b3dd99825 nss-pam-ldapd-0.9.3.tar.gz
+c6184e2870dc7fb35d27955c27f2dbf884b5af881c476ff8581b4952bc5748b95d103d4799035904bd157e0d736864422a85eb6f4dca0ff992d7c9c227815e59 nslcd.initd"
diff --git a/testing/nss-pam-ldapd/nslcd.initd b/testing/nss-pam-ldapd/nslcd.initd
new file mode 100644
index 000000000..0fab4de9e
--- /dev/null
+++ b/testing/nss-pam-ldapd/nslcd.initd
@@ -0,0 +1,27 @@
+#!/sbin/runscript
+
+extra_commands="checkconfig"
+cfg="/etc/nslcd.conf"
+command=/usr/sbin/nslcd
+pidfile=/var/run/nslcd/nslcd.pid
+
+
+depend() {
+ need net
+ after firewall
+ use dns logger
+}
+
+checkconfig() {
+ if [ -f "$cfg" ] ; then
+ return 0
+ fi
+ eerror "Please create $cfg"
+ eerror "Example config: /usr/share/nss-ldapd/nslcd.conf"
+ return 1
+}
+
+start_pre() {
+ checkpath -q -d ${pidfile%/*} -o nslcd:nslcd
+ checkconfig || return $?
+}
diff --git a/testing/nss-pam-ldapd/nss-pam-ldapd.pre-install b/testing/nss-pam-ldapd/nss-pam-ldapd.pre-install
new file mode 100644
index 000000000..5d30b9ca1
--- /dev/null
+++ b/testing/nss-pam-ldapd/nss-pam-ldapd.pre-install
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+username=nslcd
+groupname=$username
+
+addgroup -S $username 2>/dev/null
+adduser -S -H -h /var/run/$username -s /sbin/nologin -D -G $groupname \
+ $username 2>/dev/null
+exit 0