summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-auth/nss-pam-ldapd')
-rw-r--r--sys-auth/nss-pam-ldapd/Manifest2
-rw-r--r--sys-auth/nss-pam-ldapd/files/nslcd-init37
-rw-r--r--sys-auth/nss-pam-ldapd/files/nslcd-init-r137
-rw-r--r--sys-auth/nss-pam-ldapd/files/nslcd-init-r229
-rw-r--r--sys-auth/nss-pam-ldapd/files/nslcd-init-s60
-rw-r--r--sys-auth/nss-pam-ldapd/files/nslcd-run-s63
-rw-r--r--sys-auth/nss-pam-ldapd/files/nslcd-tmpfiles.conf1
-rw-r--r--sys-auth/nss-pam-ldapd/files/nslcd.rc35
-rw-r--r--sys-auth/nss-pam-ldapd/files/nslcd.service14
-rw-r--r--sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.4-disable-py3-only-linters.patch13
-rw-r--r--sys-auth/nss-pam-ldapd/metadata.xml26
-rw-r--r--sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.8.14-r2.ebuild87
-rw-r--r--sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.6.ebuild129
13 files changed, 413 insertions, 0 deletions
diff --git a/sys-auth/nss-pam-ldapd/Manifest b/sys-auth/nss-pam-ldapd/Manifest
new file mode 100644
index 000000000000..97885bbcf581
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/Manifest
@@ -0,0 +1,2 @@
+DIST nss-pam-ldapd-0.8.14.tar.gz 508949 SHA256 a29ceb9b7eda386ca38f16115ffec61425462cca6b5e560c44c3d51edc03a63f SHA512 70abb1836b5b3304e583fd3b71f11fee7586e181b26f4630779ec1d90b856da6e4fcc76327c51b20a158aa36708dd12ceb5f543a33c826881f2ad3e092f542c9 WHIRLPOOL 5d30088d73e464bf380dd5e7d34f8c5200680712693c97ee1f1df1880b4680236d9168ac7ec08b161ae463236c0feddc2171442a956c872113caa6e2b07a6bb8
+DIST nss-pam-ldapd-0.9.6.tar.gz 754681 SHA256 101d5a7fa10549cc77be48d07f2b8141f59182f10f2cc0fea93efd13c3a5a6f2 SHA512 213bc55554290042623ef4cce071045bab569a824aef7d960e3aa9c2f64f0c4928c5c28a4b5d9225fd35ea5026bb11f710d9c620f790e9d82c73d89b272e972a WHIRLPOOL 8902d48a6e889e697f7ddf9bd7d481493a0e2e302223317647f24fd3cd10b176cf66287553b8eafc2b996d0c073055afeb42b4f29d93e8f05f3967bb0aeaee16
diff --git a/sys-auth/nss-pam-ldapd/files/nslcd-init b/sys-auth/nss-pam-ldapd/files/nslcd-init
new file mode 100644
index 000000000000..5774fe70cab0
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/files/nslcd-init
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+extra_commands="checkconfig"
+cfg="/etc/nslcd.conf"
+
+depend() {
+ need net
+ use dns logger
+}
+
+checkconfig() {
+ if [ ! -f "$cfg" ] ; then
+ eerror "Please create $cfg"
+ eerror "Example config: /usr/share/nss-ldapd/nslcd.conf"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkpath -q -d /var/run/nslcd -o nslcd:nslcd
+ checkconfig || return $?
+
+ ebegin "Starting nslcd"
+ start-stop-daemon --start --pidfile /var/run/nslcd/nslcd.pid \
+ --exec /usr/sbin/nslcd
+ eend $? "Failed to start nslcd"
+}
+
+stop() {
+ ebegin "Stopping nslcd"
+ start-stop-daemon --stop --pidfile /var/run/nslcd/nslcd.pid
+ eend $? "Failed to stop nslcd"
+}
diff --git a/sys-auth/nss-pam-ldapd/files/nslcd-init-r1 b/sys-auth/nss-pam-ldapd/files/nslcd-init-r1
new file mode 100644
index 000000000000..238a008063f7
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/files/nslcd-init-r1
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+extra_commands="checkconfig"
+cfg="/etc/nslcd.conf"
+
+depend() {
+ need net
+ use dns logger
+}
+
+checkconfig() {
+ if [ ! -f "$cfg" ] ; then
+ eerror "Please create $cfg"
+ eerror "Example config: /usr/share/nss-ldapd/nslcd.conf"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkpath -q -d /run/nslcd -o nslcd:nslcd
+ checkconfig || return $?
+
+ ebegin "Starting nslcd"
+ start-stop-daemon --start --pidfile /var/run/nslcd/nslcd.pid \
+ --exec /usr/sbin/nslcd
+ eend $? "Failed to start nslcd"
+}
+
+stop() {
+ ebegin "Stopping nslcd"
+ start-stop-daemon --stop --pidfile /var/run/nslcd/nslcd.pid
+ eend $? "Failed to stop nslcd"
+}
diff --git a/sys-auth/nss-pam-ldapd/files/nslcd-init-r2 b/sys-auth/nss-pam-ldapd/files/nslcd-init-r2
new file mode 100644
index 000000000000..6c203be7343f
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/files/nslcd-init-r2
@@ -0,0 +1,29 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+command=/usr/sbin/nslcd
+pidfile=/var/run/nslcd/nslcd.pid
+extra_commands="checkconfig"
+cfg="/etc/nslcd.conf"
+
+depend() {
+ need net
+ use dns logger
+}
+
+checkconfig() {
+ if [ ! -f "$cfg" ] ; then
+ eerror "Please create $cfg"
+ eerror "Example config: /usr/share/nss-ldapd/nslcd.conf"
+ return 1
+ fi
+ return 0
+}
+
+start_pre() {
+ checkpath -q -d /run/nslcd -o nslcd:nslcd
+ checkconfig
+ return $?
+}
diff --git a/sys-auth/nss-pam-ldapd/files/nslcd-init-s6 b/sys-auth/nss-pam-ldapd/files/nslcd-init-s6
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/files/nslcd-init-s6
diff --git a/sys-auth/nss-pam-ldapd/files/nslcd-run-s6 b/sys-auth/nss-pam-ldapd/files/nslcd-run-s6
new file mode 100644
index 000000000000..264da009ba11
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/files/nslcd-run-s6
@@ -0,0 +1,3 @@
+#!/bin/sh
+exec 2>&1
+exec /usr/sbin/nslcd -n
diff --git a/sys-auth/nss-pam-ldapd/files/nslcd-tmpfiles.conf b/sys-auth/nss-pam-ldapd/files/nslcd-tmpfiles.conf
new file mode 100644
index 000000000000..ac4ee0ad8649
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/files/nslcd-tmpfiles.conf
@@ -0,0 +1 @@
+d /run/nslcd 0755 nslcd nslcd -
diff --git a/sys-auth/nss-pam-ldapd/files/nslcd.rc b/sys-auth/nss-pam-ldapd/files/nslcd.rc
new file mode 100644
index 000000000000..916f78f8d8b1
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/files/nslcd.rc
@@ -0,0 +1,35 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+opts="checkconfig"
+
+depend() {
+ need net
+ use dns logger
+}
+
+checkconfig() {
+ if [ ! -f /etc/nss-ldapd.conf ] ; then
+ eerror "Please create /etc/nss-ldapd.conf"
+ eerror "Example config: /usr/share/nss-ldapd/nss-ldapd.conf"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return $?
+
+ ebegin "Starting nslcd"
+ start-stop-daemon --start --pidfile /var/run/nslcd/nslcd.pid \
+ --exec /usr/sbin/nslcd
+ eend $? "Failed to start nslcd"
+}
+
+stop() {
+ ebegin "Stopping nslcd"
+ start-stop-daemon --stop --pidfile /var/run/nslcd/nslcd.pid
+ eend $? "Failed to stop nslcd"
+}
diff --git a/sys-auth/nss-pam-ldapd/files/nslcd.service b/sys-auth/nss-pam-ldapd/files/nslcd.service
new file mode 100644
index 000000000000..030cc2c90eb1
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/files/nslcd.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=NSS and PAM LDAP client daemon
+After=network-online.target
+Wants=network-online.target nss-lookup.target syslog.service
+Before=nss-user-lookup.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/nslcd/nslcd.pid
+ExecStart=/usr/sbin/nslcd
+
+[Install]
+WantedBy=multi-user.target
+RequiredBy=nss-user-lookup.target
diff --git a/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.4-disable-py3-only-linters.patch b/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.4-disable-py3-only-linters.patch
new file mode 100644
index 000000000000..06dcc2513a39
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.4-disable-py3-only-linters.patch
@@ -0,0 +1,13 @@
+diff --git a/tests/pylint.rc b/tests/pylint.rc
+index 7f0bc13..b66d018 100644
+--- a/tests/pylint.rc
++++ b/tests/pylint.rc
+@@ -19,7 +19,7 @@ enable=
+ # can either give multiple identifier separated by comma (,) or put this option
+ # multiple time (only on the command line, not in the configuration file where
+ # it should appear only once).
+-disable=E1101
++disable=E1101,E1608,E1606,E1601
+
+
+ [REPORTS]
diff --git a/sys-auth/nss-pam-ldapd/metadata.xml b/sys-auth/nss-pam-ldapd/metadata.xml
new file mode 100644
index 000000000000..458c550d203e
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/metadata.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>prometheanfire@gentoo.org</email>
+ <name>Matthew Thode</name>
+ </maintainer>
+ <maintainer>
+ <email>chutzpah@gentoo.org</email>
+ <name>Patrick McLean</name>
+ </maintainer>
+ <use>
+ <flag name="utils">Install the command-line utilities</flag>
+ </use>
+ <longdescription lang="en">
+ Provides a Name Service Switch (NSS) module that allows your LDAP
+ server to provide user account, group, host name, alias, netgroup, and
+ basically any other information that you would normally get from /etc
+ flat files or NIS. It also provides a Pluggable Authentication Module
+ (PAM) to do authentication to an LDAP server.
+
+ This is implemented using thin NSS and PAM modules which delegate to a
+ dedicated service (nslcd) that queries the LDAP server with persistent
+ connections, authentication, attribute translation, etc.
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.8.14-r2.ebuild b/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.8.14-r2.ebuild
new file mode 100644
index 000000000000..16a99df8cd63
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.8.14-r2.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit multilib-minimal user
+
+DESCRIPTION="NSS module for name lookups using LDAP"
+HOMEPAGE="http://arthurdejong.org/nss-pam-ldapd/"
+SRC_URI="http://arthurdejong.org/nss-pam-ldapd/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="debug kerberos sasl +pam"
+
+DEPEND="
+ net-nds/openldap
+ sasl? ( dev-libs/cyrus-sasl )
+ kerberos? ( virtual/krb5 )
+ pam? ( virtual/pam )
+ !sys-auth/nss_ldap
+ !sys-auth/pam_ldap"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ enewgroup nslcd
+ enewuser nslcd -1 -1 -1 nslcd
+}
+
+multilib_src_configure() {
+ # nss libraries always go in /lib on Gentoo
+ myconf="
+ --enable-warnings
+ --with-ldap-lib=openldap
+ --with-ldap-conf-file=/etc/nslcd.conf
+ --with-nslcd-pidfile=/run/nslcd/nslcd.pid
+ --with-nslcd-socket=/run/nslcd/socket
+ --with-pam-seclib-dir=/$(get_libdir)/security
+ --libdir=/$(get_libdir)
+ $(use_enable debug)
+ $(use_enable kerberos)
+ $(use_enable pam)
+ $(use_enable sasl)"
+
+ if use x86-fbsd; then
+ myconf+=" --with-nss-flavour=freebsd"
+ else
+ myconf+=" --with-nss-flavour=glibc"
+ fi
+
+ ECONF_SOURCE="${S}" econf ${myconf}
+}
+
+multilib_src_install() {
+ default
+
+ # for socket and pid file (not needed bug 452992)
+ #keepdir /run/nslcd
+
+ # init script
+ newinitd "${FILESDIR}"/nslcd-init-r1 nslcd
+
+ # make an example copy
+ insinto /usr/share/nss-pam-ldapd
+ doins "${WORKDIR}/${P}/nslcd.conf"
+
+ fperms o-r /etc/nslcd.conf
+}
+
+pkg_postinst() {
+ echo
+ elog "For this to work you must configure /etc/nslcd.conf"
+ elog "This configuration is similar to pam_ldap's /etc/ldap.conf"
+ echo
+ elog "In order to use nss-pam-ldapd, nslcd needs to be running. You can"
+ elog "start it like this:"
+ elog " # /etc/init.d/nslcd start"
+ echo
+ elog "You can add it to the default runlevel like so:"
+ elog " # rc-update add nslcd default"
+ elog
+ elog "If you are upgrading, keep in mind that /etc/nss-ldapd.conf"
+ elog " is now named /etc/nslcd.conf"
+ echo
+}
diff --git a/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.6.ebuild b/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.6.ebuild
new file mode 100644
index 000000000000..3c530e45635f
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.6.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=(python2_7)
+inherit eutils prefix user python-r1 multilib multilib-minimal systemd s6
+
+DESCRIPTION="NSS module for name lookups using LDAP"
+HOMEPAGE="http://arthurdejong.org/nss-pam-ldapd/"
+SRC_URI="http://arthurdejong.org/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS=""
+IUSE="debug kerberos +pam sasl test +utils"
+
+COMMON_DEP="
+ net-nds/openldap[${MULTILIB_USEDEP}]
+ sasl? ( dev-libs/cyrus-sasl[${MULTILIB_USEDEP}] )
+ kerberos? ( virtual/krb5[${MULTILIB_USEDEP}] )
+ pam? ( virtual/pam[${MULTILIB_USEDEP}] )
+ utils? ( ${PYTHON_DEPS} )
+ !sys-auth/nss_ldap
+ !sys-auth/pam_ldap"
+RDEPEND="${COMMON_DEP}"
+DEPEND="${COMMON_DEP}
+ test? (
+ ${PYTHON_DEPS}
+ dev-python/pylint[${PYTHON_USEDEP}]
+ )
+ sys-devel/automake"
+
+REQUIRED_USE="
+ utils? ( ${PYTHON_REQUIRED_USE} )
+ test? ( ${PYTHON_REQUIRED_USE} )"
+
+pkg_setup() {
+ enewgroup nslcd
+ enewuser nslcd -1 -1 -1 nslcd
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-0.9.4-disable-py3-only-linters.patch
+ epatch_user
+ use utils && python_setup
+}
+
+multilib_src_configure() {
+ local -a myconf
+
+ myconf=(
+ --disable-utils
+ --enable-warnings
+ --with-ldap-lib=openldap
+ --with-ldap-conf-file=/etc/nslcd.conf
+ --with-nslcd-pidfile=/run/nslcd/nslcd.pid
+ --with-nslcd-socket=/run/nslcd/socket
+ $(usex x86-fbsd '--with-nss-flavour=' '--with-nss-flavour=' 'freebsd' 'glibc')
+ $(use_enable debug)
+ $(use_enable kerberos)
+ $(use_enable pam)
+ $(use_enable sasl)
+ )
+
+ # nss libraries always go in /lib on Gentoo
+ if multilib_is_native_abi ; then
+ myconf+=("--with-pam-seclib-dir=${EPREFIX}/$(get_libdir)/security")
+ myconf+=("--libdir=${EPREFIX}/$(get_libdir)")
+ else
+ myconf+=("--with-pam-seclib-dir=/$(get_libdir)/security")
+ myconf+=("--libdir=/$(get_libdir)")
+ fi
+
+ ECONF_SOURCE="${S}" econf "${myconf[@]}"
+}
+
+multilib_src_install_all() {
+ local script
+
+ newinitd "${FILESDIR}"/nslcd-init-r1 nslcd
+ newinitd "${FILESDIR}"/nslcd-init-r2 nslcd
+ newinitd "${FILESDIR}"/nslcd-init-s6 nslcd-s6
+ s6_install_service nslcd "${FILESDIR}"/nslcd-run-s6
+
+ insinto /usr/share/nss-pam-ldapd
+ doins "${WORKDIR}/${P}/nslcd.conf"
+
+ fperms o-r /etc/nslcd.conf
+
+ if use utils; then
+ python_moduleinto nslcd
+ python_foreach_impl && python_domodule utils/*.py
+
+ for script in chsh getent; do
+ python_foreach_impl python_newscript utils/${script}.py ${script}.ldap
+ done
+ fi
+
+ systemd_newtmpfilesd "${FILESDIR}"/nslcd-tmpfiles.conf nslcd.conf
+ systemd_dounit "${FILESDIR}"/nslcd.service
+}
+
+multilib_src_test() {
+ python_foreach_impl emake check
+}
+
+pkg_postinst() {
+ echo
+ elog "For this to work you must configure /etc/nslcd.conf"
+ elog "This configuration is similar to pam_ldap's /etc/ldap.conf"
+ echo
+ elog "In order to use nss-pam-ldapd, nslcd needs to be running. You can"
+ elog "start it like this:"
+ elog " # /etc/init.d/nslcd start"
+ echo
+ elog "You can add it to the default runlevel like so:"
+ elog " # rc-update add nslcd default"
+ elog
+ elog "If you have >=sys-apps/openrc-0.16.3, you can also use s6"
+ elog "to supervise this service."
+ elog "To do this, emerge sys-apps/s6 then add nslcd-s6"
+ elog "default runlevel instead of nslcd."
+ elog
+ elog "If you are upgrading, keep in mind that /etc/nss-ldapd.conf"
+ elog " is now named /etc/nslcd.conf"
+ echo
+}