public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-auth/nss-pam-ldapd/, sys-auth/nss-pam-ldapd/files/
@ 2019-10-08  0:35 Patrick McLean
  0 siblings, 0 replies; 6+ messages in thread
From: Patrick McLean @ 2019-10-08  0:35 UTC (permalink / raw
  To: gentoo-commits

commit:     ca4b1a57178c2a3acbc8eaaf67f0082a11996bc2
Author:     Patrick McLean <patrick.mclean <AT> sony <DOT> com>
AuthorDate: Tue Oct  8 00:35:38 2019 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Tue Oct  8 00:35:38 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ca4b1a57

sys-auth/nss-pam-ldapd: Fix pynslcd module path patch in 0.9.11

Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-2.3.76, Repoman-2.3.17
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>

 ...nss-pam-ldapd-0.9.11-pynslcd-module-paths.patch | 25 ++++++++++++++++++++++
 sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.11.ebuild |  2 +-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-pynslcd-module-paths.patch b/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-pynslcd-module-paths.patch
new file mode 100644
index 00000000000..75ad1015afc
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-pynslcd-module-paths.patch
@@ -0,0 +1,25 @@
+diff --git a/pynslcd/pynslcd.py b/pynslcd/pynslcd.py
+index 0691b61..df2ca4a 100755
+--- a/pynslcd/pynslcd.py
++++ b/pynslcd/pynslcd.py
+@@ -30,13 +30,13 @@ import threading
+ import daemon
+ import ldap
+ 
+-import cfg
+-import common
+-import constants
+-import invalidator
+-import mypidfile
+-import search
+-from tio import TIOStream
++import pynslcd.cfg
++import pynslcd.common
++import pynslcd.constants
++import pynslcd.invalidator
++import pynslcd.mypidfile
++import pynslcd.search
++from pynslcd.tio import TIOStream
+ 
+ 
+ # the name of the program

diff --git a/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.11.ebuild b/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.11.ebuild
index 0b63e2b3f24..2a5d6c9a68b 100644
--- a/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.11.ebuild
+++ b/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.11.ebuild
@@ -41,7 +41,7 @@ REQUIRED_USE="
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-0.9.4-disable-py3-only-linters.patch
-	"${FILESDIR}"/${PN}-0.9.8-pynslcd-module-paths.patch
+	"${FILESDIR}"/${PN}-0.9.11-pynslcd-module-paths.patch
 )
 
 pkg_setup() {


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-auth/nss-pam-ldapd/, sys-auth/nss-pam-ldapd/files/
@ 2020-01-16 17:13 Matthew Thode
  0 siblings, 0 replies; 6+ messages in thread
From: Matthew Thode @ 2020-01-16 17:13 UTC (permalink / raw
  To: gentoo-commits

commit:     83d109e72915e161c21be0d9abd28447ab0fa97c
Author:     Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 16 17:09:10 2020 +0000
Commit:     Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
CommitDate: Thu Jan 16 17:13:11 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=83d109e7

sys-auth/nss-pam-ldapd: fix /var/run path for systemd service

Fixes: https://bugs.gentoo.org/705380
Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Matthew Thode <prometheanfire <AT> gentoo.org>

 sys-auth/nss-pam-ldapd/files/nslcd-2.service       |  14 ++
 sys-auth/nss-pam-ldapd/files/nslcd-init-r3         |  28 ++++
 sys-auth/nss-pam-ldapd/files/pynslcd.initd-r2      |  28 ++++
 .../nss-pam-ldapd/nss-pam-ldapd-0.9.11-r2.ebuild   | 163 +++++++++++++++++++++
 4 files changed, 233 insertions(+)

diff --git a/sys-auth/nss-pam-ldapd/files/nslcd-2.service b/sys-auth/nss-pam-ldapd/files/nslcd-2.service
new file mode 100644
index 00000000000..b6b167aaed9
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/files/nslcd-2.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=/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/nslcd-init-r3 b/sys-auth/nss-pam-ldapd/files/nslcd-init-r3
new file mode 100644
index 00000000000..513ad9af3fe
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/files/nslcd-init-r3
@@ -0,0 +1,28 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+command=/usr/sbin/nslcd
+pidfile=/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/pynslcd.initd-r2 b/sys-auth/nss-pam-ldapd/files/pynslcd.initd-r2
new file mode 100644
index 00000000000..21762ae5fd2
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/files/pynslcd.initd-r2
@@ -0,0 +1,28 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+command=/usr/sbin/pynslcd
+pidfile=/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/nss-pam-ldapd-0.9.11-r2.ebuild b/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.11-r2.ebuild
new file mode 100644
index 00000000000..53e23ca1d64
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.11-r2.ebuild
@@ -0,0 +1,163 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=(python2_7 python3_6)
+inherit eutils prefix user python-r1 multilib multilib-minimal systemd s6
+
+DESCRIPTION="NSS module for name lookups using LDAP"
+HOMEPAGE="https://arthurdejong.org/nss-pam-ldapd/"
+SRC_URI="https://arthurdejong.org/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug kerberos +pam pynslcd sasl test +utils"
+RESTRICT="!test? ( test )"
+
+COMMON_DEP="
+	net-nds/openldap[${MULTILIB_USEDEP}]
+	sasl? ( dev-libs/cyrus-sasl[${MULTILIB_USEDEP}] )
+	kerberos? ( virtual/krb5[${MULTILIB_USEDEP}] )
+	sys-libs/pam[${MULTILIB_USEDEP}]
+	utils? ( ${PYTHON_DEPS} )
+	pynslcd? (
+		dev-python/python-ldap[${PYTHON_USEDEP}]
+		dev-python/python-daemon[${PYTHON_USEDEP}]
+	)
+	!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} pynslcd )"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-0.9.4-disable-py3-only-linters.patch
+	"${FILESDIR}"/${PN}-0.9.11-pynslcd-module-paths.patch
+)
+
+pkg_setup() {
+	enewgroup nslcd
+	enewuser nslcd -1 -1 -1 nslcd
+}
+
+src_prepare() {
+	cp pynslcd/pynslcd.py "${S}" || die "Copying pynslcd failed"
+
+	default
+	use utils && python_setup
+	touch pynslcd/__init__.py || die "Could not create __init__.py for pynslcd"
+}
+
+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 pynslcd)
+		$(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-r3 nslcd
+	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
+	if use pynslcd; then
+		rm -rf "${D}"/usr/share/pynslcd
+		python_moduleinto pynslcd
+		python_foreach_impl python_domodule pynslcd/*.py
+		python_scriptinto /usr/sbin
+		python_newscript pynslcd.py pynslcd
+		newinitd "${FILESDIR}"/pynslcd.initd-r2 pynslcd
+	fi
+
+	systemd_newtmpfilesd "${FILESDIR}"/nslcd-tmpfiles.conf nslcd.conf
+	systemd_newunit "${FILESDIR}"/nslcd-2.service nslcd.service
+}
+
+multilib_src_install() {
+	emake DESTDIR="${D}" install
+
+	if use pynslcd; then
+		python_moduleinto pynslcd
+		python_foreach_impl python_domodule pynslcd/*.py
+	fi
+}
+
+python_test() {
+	PYTHONPATH="${S}" emake check
+}
+
+multilib_src_test() {
+	pushd "${BUILD_DIR}"
+	ln -s ../pynslcd/constants.py utils/constants.py
+	python_foreach_impl python_test
+	popd
+}
+
+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
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-auth/nss-pam-ldapd/, sys-auth/nss-pam-ldapd/files/
@ 2020-03-16 17:58 Matthew Thode
  0 siblings, 0 replies; 6+ messages in thread
From: Matthew Thode @ 2020-03-16 17:58 UTC (permalink / raw
  To: gentoo-commits

commit:     8e84b8928036da30a91c2682d7910a23efb29132
Author:     Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 16 17:57:54 2020 +0000
Commit:     Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
CommitDate: Mon Mar 16 17:58:14 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e84b892

sys-auth/nss-pam-ldapd: moved some files around (no intalled changes)

Closes: https://bugs.gentoo.org/712806
Package-Manager: Portage-2.3.89, Repoman-2.3.20
Signed-off-by: Matthew Thode <prometheanfire <AT> gentoo.org>

 sys-auth/nss-pam-ldapd/files/{nslcd-init-r3 => nslcd.init}      | 2 +-
 sys-auth/nss-pam-ldapd/files/{nslcd-run-s6 => nslcd.s6}         | 0
 sys-auth/nss-pam-ldapd/files/{nslcd-2.service => nslcd.service} | 0
 sys-auth/nss-pam-ldapd/files/{pynslcd.initd-r2 => pynslcd.init} | 2 +-
 sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.11-r2.ebuild           | 8 ++++----
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/sys-auth/nss-pam-ldapd/files/nslcd-init-r3 b/sys-auth/nss-pam-ldapd/files/nslcd.init
similarity index 92%
rename from sys-auth/nss-pam-ldapd/files/nslcd-init-r3
rename to sys-auth/nss-pam-ldapd/files/nslcd.init
index 513ad9af3fe..959fb601f60 100644
--- a/sys-auth/nss-pam-ldapd/files/nslcd-init-r3
+++ b/sys-auth/nss-pam-ldapd/files/nslcd.init
@@ -1,5 +1,5 @@
 #!/sbin/openrc-run
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 command=/usr/sbin/nslcd

diff --git a/sys-auth/nss-pam-ldapd/files/nslcd-run-s6 b/sys-auth/nss-pam-ldapd/files/nslcd.s6
similarity index 100%
rename from sys-auth/nss-pam-ldapd/files/nslcd-run-s6
rename to sys-auth/nss-pam-ldapd/files/nslcd.s6

diff --git a/sys-auth/nss-pam-ldapd/files/nslcd-2.service b/sys-auth/nss-pam-ldapd/files/nslcd.service
similarity index 100%
rename from sys-auth/nss-pam-ldapd/files/nslcd-2.service
rename to sys-auth/nss-pam-ldapd/files/nslcd.service

diff --git a/sys-auth/nss-pam-ldapd/files/pynslcd.initd-r2 b/sys-auth/nss-pam-ldapd/files/pynslcd.init
similarity index 92%
rename from sys-auth/nss-pam-ldapd/files/pynslcd.initd-r2
rename to sys-auth/nss-pam-ldapd/files/pynslcd.init
index 21762ae5fd2..3165b02843f 100644
--- a/sys-auth/nss-pam-ldapd/files/pynslcd.initd-r2
+++ b/sys-auth/nss-pam-ldapd/files/pynslcd.init
@@ -1,5 +1,5 @@
 #!/sbin/openrc-run
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 command=/usr/sbin/pynslcd

diff --git a/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.11-r2.ebuild b/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.11-r2.ebuild
index f93312d95f0..f581f1f2fe4 100644
--- a/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.11-r2.ebuild
+++ b/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.11-r2.ebuild
@@ -91,8 +91,8 @@ multilib_src_configure() {
 multilib_src_install_all() {
 	local script
 
-	newinitd "${FILESDIR}"/nslcd-init-r3 nslcd
-	s6_install_service nslcd "${FILESDIR}"/nslcd-run-s6
+	newinitd "${FILESDIR}"/nslcd.init nslcd
+	s6_install_service nslcd "${FILESDIR}"/nslcd.s6
 
 	insinto /usr/share/nss-pam-ldapd
 	doins "${WORKDIR}/${P}/nslcd.conf"
@@ -113,11 +113,11 @@ multilib_src_install_all() {
 		python_foreach_impl python_domodule pynslcd/*.py
 		python_scriptinto /usr/sbin
 		python_newscript pynslcd.py pynslcd
-		newinitd "${FILESDIR}"/pynslcd.initd-r2 pynslcd
+		newinitd "${FILESDIR}"/pynslcd.init pynslcd
 	fi
 
 	systemd_newtmpfilesd "${FILESDIR}"/nslcd-tmpfiles.conf nslcd.conf
-	systemd_newunit "${FILESDIR}"/nslcd-2.service nslcd.service
+	systemd_newunit "${FILESDIR}"/nslcd.service nslcd.service
 }
 
 multilib_src_install() {


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-auth/nss-pam-ldapd/, sys-auth/nss-pam-ldapd/files/
@ 2020-09-05  0:07 Patrick McLean
  0 siblings, 0 replies; 6+ messages in thread
From: Patrick McLean @ 2020-09-05  0:07 UTC (permalink / raw
  To: gentoo-commits

commit:     8f75b8e5458a93664ab8993bc95e769aae0e0b7f
Author:     Patrick McLean <patrick.mclean <AT> sony <DOT> com>
AuthorDate: Sat Sep  5 00:04:46 2020 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Sat Sep  5 00:07:45 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f75b8e5

sys-auth/nss-pam-ldapd-0.9.11-r3: EAPI=7, py38 (bug #718520)

Closes: https://bugs.gentoo.org/718520
Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-3.0.5, Repoman-3.0.1
Signed-off-by: Patrick McLean <patrick.mclean <AT> sony.com>
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>

 .../nss-pam-ldapd-0.9.11-relative-imports.patch    | 452 +++++++++++++++++++++
 .../files/nss-pam-ldapd-0.9.11-tests.patch         |  34 ++
 .../files/nss-pam-ldapd-0.9.11-use-mkstemp.patch   |  25 ++
 .../nss-pam-ldapd/nss-pam-ldapd-0.9.11-r3.ebuild   | 167 ++++++++
 4 files changed, 678 insertions(+)

diff --git a/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-relative-imports.patch b/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-relative-imports.patch
new file mode 100644
index 00000000000..101d0c77450
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-relative-imports.patch
@@ -0,0 +1,452 @@
+diff --git a/pynslcd/Makefile.am b/pynslcd/Makefile.am
+index 383dd3c..39a3bfb 100644
+--- a/pynslcd/Makefile.am
++++ b/pynslcd/Makefile.am
+@@ -19,7 +19,7 @@
+ 
+ pynslcddir = $(datadir)/pynslcd
+ 
+-pynslcd_PYTHON = pynslcd.py attmap.py cache.py cfg.py common.py expr.py \
++pynslcd_PYTHON = main.py attmap.py cache.py cfg.py common.py expr.py \
+                  mypidfile.py invalidator.py search.py tio.py \
+                  config.py alias.py ether.py group.py host.py netgroup.py \
+                  network.py passwd.py protocol.py rpc.py service.py \
+@@ -38,6 +38,6 @@ constants.py: constants.py.in $(top_srcdir)/nslcd.h
+ # create a symbolic link for the pynslcd daemon and fix permissions
+ install-data-hook:
+ 	$(MKDIR_P) $(DESTDIR)$(sbindir)
+-	[ -L $(DESTDIR)$(sbindir)/pynslcd ] || $(LN_S) $(pynslcddir)/pynslcd.py $(DESTDIR)$(sbindir)/pynslcd
+-	chmod a+rx $(DESTDIR)$(pynslcddir)/pynslcd.py
+-	sed -i -e '1 s|^#!.*|#! $(PYTHON)|;1 s|^#! \([^/].*\)|#! /usr/bin/env \1|' $(DESTDIR)$(pynslcddir)/pynslcd.py
++	[ -L $(DESTDIR)$(sbindir)/pynslcd ] || $(LN_S) $(pynslcddir)/main.py $(DESTDIR)$(sbindir)/pynslcd
++	chmod a+rx $(DESTDIR)$(pynslcddir)/main.py
++	sed -i -e '1 s|^#!.*|#! $(PYTHON)|;1 s|^#! \([^/].*\)|#! /usr/bin/env \1|' $(DESTDIR)$(pynslcddir)/main.py
+diff --git a/pynslcd/alias.py b/pynslcd/alias.py
+index 8096309..614dd53 100644
+--- a/pynslcd/alias.py
++++ b/pynslcd/alias.py
+@@ -18,10 +18,10 @@
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ # 02110-1301 USA
+ 
+-import cache
+-import common
+-import constants
+-import search
++from pynslcd import cache
++from pynslcd import common
++from pynslcd import constants
++from pynslcd import search
+ 
+ 
+ attmap = common.Attributes(
+diff --git a/pynslcd/attmap.py b/pynslcd/attmap.py
+index 61862df..4d450f6 100644
+--- a/pynslcd/attmap.py
++++ b/pynslcd/attmap.py
+@@ -45,7 +45,7 @@ import re
+ import ldap.dn
+ from ldap.filter import escape_filter_chars
+ 
+-from expr import Expression
++from pynslcd.expr import Expression
+ 
+ 
+ # exported names
+diff --git a/pynslcd/cfg.py b/pynslcd/cfg.py
+index 877d442..14ae850 100644
+--- a/pynslcd/cfg.py
++++ b/pynslcd/cfg.py
+@@ -133,8 +133,8 @@ _tls_reqcert_options = {'never': ldap.OPT_X_TLS_NEVER,
+ 
+ def _get_maps():
+     # separate function as not to pollute the namespace and avoid import loops
+-    import alias, ether, group, host, netgroup, network, passwd  # noqa: E401
+-    import protocol, rpc, service, shadow  # noqa: E401
++    from pynslcd import alias, ether, group, host, netgroup, network, passwd  # noqa: E401
++    from pynslcd import protocol, rpc, service, shadow  # noqa: E401
+     import sys
+     return dict(
+         alias=alias, aliases=alias,
+@@ -293,7 +293,7 @@ def read(filename):  # noqa: C901 (many simple branches)
+         # pam_authz_search <FILTER>
+         m = re.match(r'pam_authz_search\s+(?P<value>\S.*)', line, re.IGNORECASE)
+         if m:
+-            from expr import Expression
++            from pynslcd.expr import Expression
+             pam_authz_searches.append(Expression(m.group('value')))
+             # TODO: check pam_authz_search expression to only contain
+             # username, service, ruser, rhost, tty, hostname, fqdn, dn or
+diff --git a/pynslcd/common.py b/pynslcd/common.py
+index a5b168d..568ac2f 100644
+--- a/pynslcd/common.py
++++ b/pynslcd/common.py
+@@ -23,9 +23,9 @@ import sys
+ 
+ import ldap
+ 
+-from attmap import Attributes  # noqa: F401 (used by other modules)
+-import cfg
+-import constants
++from pynslcd.attmap import Attributes  # noqa: F401 (used by other modules)
++from pynslcd import cfg
++from pynslcd import constants
+ 
+ 
+ def is_valid_name(name):
+diff --git a/pynslcd/config.py b/pynslcd/config.py
+index ee57db3..ba8badb 100644
+--- a/pynslcd/config.py
++++ b/pynslcd/config.py
+@@ -18,9 +18,9 @@
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ # 02110-1301 USA
+ 
+-import cfg
+-import common
+-import constants
++from pynslcd import cfg
++from pynslcd import common
++from pynslcd import constants
+ 
+ 
+ class ConfigGetRequest(common.Request):
+diff --git a/pynslcd/ether.py b/pynslcd/ether.py
+index 9462ef0..2edc5de 100644
+--- a/pynslcd/ether.py
++++ b/pynslcd/ether.py
+@@ -20,10 +20,10 @@
+ 
+ import struct
+ 
+-import cache
+-import common
+-import constants
+-import search
++from pynslcd import cache
++from pynslcd import common
++from pynslcd import constants
++from pynslcd import search
+ 
+ 
+ def ether_aton(ether):
+diff --git a/pynslcd/group.py b/pynslcd/group.py
+index 263e40c..422ee9e 100644
+--- a/pynslcd/group.py
++++ b/pynslcd/group.py
+@@ -23,12 +23,12 @@ import logging
+ import ldap
+ from ldap.filter import escape_filter_chars
+ 
+-import cache
+-import cfg
+-import common
+-import constants
+-import passwd
+-import search
++from pynslcd import cache
++from pynslcd import cfg
++from pynslcd import common
++from pynslcd import constants
++from pynslcd import passwd
++from pynslcd import search
+ 
+ 
+ def clean(lst):
+diff --git a/pynslcd/host.py b/pynslcd/host.py
+index c6639df..30259d6 100644
+--- a/pynslcd/host.py
++++ b/pynslcd/host.py
+@@ -18,10 +18,10 @@
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ # 02110-1301 USA
+ 
+-import cache
+-import common
+-import constants
+-import search
++from pynslcd import cache
++from pynslcd import common
++from pynslcd import constants
++from pynslcd import search
+ 
+ 
+ attmap = common.Attributes(
+diff --git a/pynslcd/invalidator.py b/pynslcd/invalidator.py
+index 6d2eefe..b54946e 100644
+--- a/pynslcd/invalidator.py
++++ b/pynslcd/invalidator.py
+@@ -23,7 +23,7 @@ import logging
+ import os
+ import subprocess
+ 
+-import cfg
++from pynslcd import cfg
+ 
+ 
+ # the file descriptor used for sending messages to the child process
+diff --git a/pynslcd/mypidfile.py b/pynslcd/mypidfile.py
+index 42935e2..dd7d59a 100644
+--- a/pynslcd/mypidfile.py
++++ b/pynslcd/mypidfile.py
+@@ -22,7 +22,7 @@ import errno
+ import fcntl
+ import os
+ 
+-import cfg
++from pynslcd import cfg
+ 
+ 
+ class MyPIDLockFile(object):
+diff --git a/pynslcd/netgroup.py b/pynslcd/netgroup.py
+index 47a4c6e..8d0fbb2 100644
+--- a/pynslcd/netgroup.py
++++ b/pynslcd/netgroup.py
+@@ -20,10 +20,10 @@
+ 
+ import re
+ 
+-import cache
+-import common
+-import constants
+-import search
++from pynslcd import cache
++from pynslcd import common
++from pynslcd import constants
++from pynslcd import search
+ 
+ 
+ _netgroup_triple_re = re.compile(
+diff --git a/pynslcd/network.py b/pynslcd/network.py
+index da587b9..3b94d06 100644
+--- a/pynslcd/network.py
++++ b/pynslcd/network.py
+@@ -18,10 +18,10 @@
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ # 02110-1301 USA
+ 
+-import cache
+-import common
+-import constants
+-import search
++from pynslcd import cache
++from pynslcd import common
++from pynslcd import constants
++from pynslcd import search
+ 
+ 
+ attmap = common.Attributes(
+diff --git a/pynslcd/pam.py b/pynslcd/pam.py
+index b372cdd..bb7add8 100644
+--- a/pynslcd/pam.py
++++ b/pynslcd/pam.py
+@@ -27,12 +27,12 @@ import ldap
+ from ldap.controls.ppolicy import PasswordPolicyControl, PasswordPolicyError
+ from ldap.filter import escape_filter_chars
+ 
+-import cfg
+-import common
+-import constants
+-import passwd
+-import search
+-import shadow
++from pynslcd import cfg
++from pynslcd import common
++from pynslcd import constants
++from pynslcd import passwd
++from pynslcd import search
++from pynslcd import shadow
+ 
+ 
+ random = random.SystemRandom()
+diff --git a/pynslcd/passwd.py b/pynslcd/passwd.py
+index 1274f21..51ae57e 100644
+--- a/pynslcd/passwd.py
++++ b/pynslcd/passwd.py
+@@ -20,11 +20,11 @@
+ 
+ import logging
+ 
+-import cache
+-import cfg
+-import common
+-import constants
+-import search
++from pynslcd import cache
++from pynslcd import cfg
++from pynslcd import common
++from pynslcd import constants
++from pynslcd import search
+ 
+ 
+ attmap = common.Attributes(
+diff --git a/pynslcd/protocol.py b/pynslcd/protocol.py
+index dc41c4b..396f337 100644
+--- a/pynslcd/protocol.py
++++ b/pynslcd/protocol.py
+@@ -18,10 +18,10 @@
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ # 02110-1301 USA
+ 
+-import cache
+-import common
+-import constants
+-import search
++from pynslcd import cache
++from pynslcd import common
++from pynslcd import constants
++from pynslcd import search
+ 
+ 
+ attmap = common.Attributes(
+diff --git a/pynslcd/pynslcd.py b/pynslcd/pynslcd.py
+index 0691b61..973ecd9 100755
+--- a/pynslcd/pynslcd.py
++++ b/pynslcd/pynslcd.py
+@@ -30,13 +30,13 @@ import threading
+ import daemon
+ import ldap
+ 
+-import cfg
+-import common
+-import constants
+-import invalidator
+-import mypidfile
+-import search
+-from tio import TIOStream
++import pynslcd.cfg as cfg
++import pynslcd.common as common
++import pynslcd.constants as constants
++import pynslcd.invalidator as invalidator
++import pynslcd.mypidfile as mypidfile
++import pynslcd.search as search
++from pynslcd.tio import TIOStream
+ 
+ 
+ # the name of the program
+@@ -188,20 +188,20 @@ def getpeercred(fd):
+ 
+ 
+ handlers = {}
+-handlers.update(common.get_handlers('config'))
+-handlers.update(common.get_handlers('alias'))
+-handlers.update(common.get_handlers('ether'))
+-handlers.update(common.get_handlers('group'))
+-handlers.update(common.get_handlers('host'))
+-handlers.update(common.get_handlers('netgroup'))
+-handlers.update(common.get_handlers('network'))
+-handlers.update(common.get_handlers('passwd'))
+-handlers.update(common.get_handlers('protocol'))
+-handlers.update(common.get_handlers('rpc'))
+-handlers.update(common.get_handlers('service'))
+-handlers.update(common.get_handlers('shadow'))
+-handlers.update(common.get_handlers('pam'))
+-handlers.update(common.get_handlers('usermod'))
++handlers.update(common.get_handlers('pynslcd.config'))
++handlers.update(common.get_handlers('pynslcd.alias'))
++handlers.update(common.get_handlers('pynslcd.ether'))
++handlers.update(common.get_handlers('pynslcd.group'))
++handlers.update(common.get_handlers('pynslcd.host'))
++handlers.update(common.get_handlers('pynslcd.netgroup'))
++handlers.update(common.get_handlers('pynslcd.network'))
++handlers.update(common.get_handlers('pynslcd.passwd'))
++handlers.update(common.get_handlers('pynslcd.protocol'))
++handlers.update(common.get_handlers('pynslcd.rpc'))
++handlers.update(common.get_handlers('pynslcd.service'))
++handlers.update(common.get_handlers('pynslcd.shadow'))
++handlers.update(common.get_handlers('pynslcd.pam'))
++handlers.update(common.get_handlers('pynslcd.usermod'))
+ 
+ 
+ def acceptconnection(nslcd_serversocket, session):
+diff --git a/pynslcd/rpc.py b/pynslcd/rpc.py
+index 49d9c7c..e1ea4f5 100644
+--- a/pynslcd/rpc.py
++++ b/pynslcd/rpc.py
+@@ -18,10 +18,10 @@
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ # 02110-1301 USA
+ 
+-import cache
+-import common
+-import constants
+-import search
++from pynslcd import cache
++from pynslcd import common
++from pynslcd import constants
++from pynslcd import search
+ 
+ 
+ attmap = common.Attributes(
+diff --git a/pynslcd/search.py b/pynslcd/search.py
+index 39850d2..f017451 100644
+--- a/pynslcd/search.py
++++ b/pynslcd/search.py
+@@ -24,7 +24,7 @@ import sys
+ import ldap
+ import ldap.ldapobject
+ 
+-import cfg
++from pynslcd import cfg
+ 
+ 
+ # global indicator that there was some error connection to an LDAP server
+diff --git a/pynslcd/service.py b/pynslcd/service.py
+index b0c53e3..96c2aaf 100644
+--- a/pynslcd/service.py
++++ b/pynslcd/service.py
+@@ -20,10 +20,10 @@
+ 
+ import datetime
+ 
+-import cache
+-import common
+-import constants
+-import search
++from pynslcd import cache
++from pynslcd import common
++from pynslcd import constants
++from pynslcd import search
+ 
+ 
+ attmap = common.Attributes(
+diff --git a/pynslcd/shadow.py b/pynslcd/shadow.py
+index 59e1af6..3ed695b 100644
+--- a/pynslcd/shadow.py
++++ b/pynslcd/shadow.py
+@@ -20,11 +20,11 @@
+ 
+ import logging
+ 
+-import cache
+-import cfg
+-import common
+-import constants
+-import search
++from pynslcd import cache
++from pynslcd import cfg
++from pynslcd import common
++from pynslcd import constants
++from pynslcd import search
+ 
+ 
+ attmap = common.Attributes(
+diff --git a/pynslcd/usermod.py b/pynslcd/usermod.py
+index 4e37ded..ffd651b 100644
+--- a/pynslcd/usermod.py
++++ b/pynslcd/usermod.py
+@@ -26,10 +26,10 @@ import os.path
+ 
+ import ldap
+ 
+-import cfg
+-import constants
+-import pam
+-import passwd
++from pynslcd import cfg
++from pynslcd import constants
++from pynslcd import pam
++from pynslcd import passwd
+ 
+ 
+ def list_shells():

diff --git a/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-tests.patch b/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-tests.patch
new file mode 100644
index 00000000000..5e13854b6cd
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-tests.patch
@@ -0,0 +1,34 @@
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 1bbbcc2..4adf062 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -23,7 +23,7 @@ TESTS = test_dict test_set test_tio test_expr test_getpeercred test_cfg \
+         test_pamcmds.sh test_manpages.sh test_clock \
+         test_tio_timeout
+ if HAVE_PYTHON
+-  TESTS += test_pycompile.sh test_pylint.sh
++  TESTS += test_pycompile.sh
+ endif
+ if ENABLE_PYNSLCD
+   TESTS += test_pynslcd_cache.py test_doctest.sh
+@@ -48,7 +48,6 @@ EXTRA_DIST = README nslcd-test.conf usernames.txt testenv.sh test_myldap.sh \
+              test_nsscmds.sh test_ldapcmds.sh test_pamcmds.sh \
+              test_pamcmds.expect test_manpages.sh \
+              test_pycompile.sh test_doctest.sh \
+-             test_pylint.sh pylint.rc \
+              test_flake8.sh flake8.ini \
+              test_pynslcd_cache.py \
+              setup_slapd.sh config.ldif test.ldif
+diff --git a/tests/test_doctest.sh b/tests/test_doctest.sh
+index 5b3a13d..26c73e7 100755
+--- a/tests/test_doctest.sh
++++ b/tests/test_doctest.sh
+@@ -38,7 +38,7 @@ find_python() {
+     fi
+   done
+ }
+-interpreters=`find_python | sort -u`
++interpreters=${PYTHON}
+ 
+ # if Python is missing, ignore
+ if [ -z "$interpreters" ]

diff --git a/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-use-mkstemp.patch b/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-use-mkstemp.patch
new file mode 100644
index 00000000000..1803067f402
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-use-mkstemp.patch
@@ -0,0 +1,25 @@
+diff --git a/pynslcd/cache.py b/pynslcd/cache.py
+index 0be3a71..b463d2e 100644
+--- a/pynslcd/cache.py
++++ b/pynslcd/cache.py
+@@ -22,6 +22,7 @@ import datetime
+ import os
+ import sqlite3
+ import sys
++import tempfile
+ 
+ 
+ # TODO: probably create a config table
+@@ -192,10 +193,8 @@ _connection = None
+ def _get_connection():
+     global _connection
+     if _connection is None:
+-        filename = '/tmp/pynslcd_cache.sqlite'
+-        dirname = os.path.dirname(filename)
+-        if not os.path.isdir(dirname):
+-            os.mkdir(dirname)
++        tmpfd, filename = tempfile.mkstemp(suffix=".sqlite", prefix="pynslcd_cache")
++        os.close(tmpfd)
+         connection = sqlite3.connect(
+             filename, detect_types=sqlite3.PARSE_DECLTYPES,
+             check_same_thread=False)

diff --git a/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.11-r3.ebuild b/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.11-r3.ebuild
new file mode 100644
index 00000000000..bc76968a718
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.11-r3.ebuild
@@ -0,0 +1,167 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=(python3_{6..8})
+inherit eutils prefix python-r1 autotools multilib multilib-minimal systemd s6
+
+DESCRIPTION="NSS module for name lookups using LDAP"
+HOMEPAGE="https://arthurdejong.org/nss-pam-ldapd/"
+SRC_URI="https://arthurdejong.org/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug kerberos +pam pynslcd sasl test +utils"
+RESTRICT="!test? ( test )"
+
+COMMON_DEP="
+	acct-group/nslcd
+	acct-user/nslcd
+	net-nds/openldap[${MULTILIB_USEDEP}]
+	sasl? ( dev-libs/cyrus-sasl[${MULTILIB_USEDEP}] )
+	kerberos? ( virtual/krb5[${MULTILIB_USEDEP}] )
+	sys-libs/pam[${MULTILIB_USEDEP}]
+	utils? ( ${PYTHON_DEPS} )
+	pynslcd? (
+		dev-python/python-ldap[${PYTHON_USEDEP}]
+		dev-python/python-daemon[${PYTHON_USEDEP}]
+	)
+	!sys-auth/nss_ldap
+	!sys-auth/pam_ldap
+"
+RDEPEND="${COMMON_DEP}"
+DEPEND="${COMMON_DEP}
+	test? (
+		${PYTHON_DEPS}
+		dev-python/pylint[${PYTHON_USEDEP}]
+	)
+"
+BDEPEND="
+	${PYTHON_DEPS}
+	sys-devel/automake
+"
+
+REQUIRED_USE="
+	utils? ( ${PYTHON_REQUIRED_USE} )
+	test? ( ${PYTHON_REQUIRED_USE} pynslcd )
+"
+
+PATCHES=(
+	"${FILESDIR}/nss-pam-ldapd-0.9.4-disable-py3-only-linters.patch"
+	"${FILESDIR}/nss-pam-ldapd-0.9.11-use-mkstemp.patch"
+	"${FILESDIR}/nss-pam-ldapd-0.9.11-relative-imports.patch"
+	"${FILESDIR}/nss-pam-ldapd-0.9.11-tests.patch"
+)
+
+src_prepare() {
+	default
+	use utils && python_setup
+	touch pynslcd/__init__.py || die "Could not create __init__.py for pynslcd"
+	mv pynslcd/pynslcd.py pynslcd/main.py || die
+
+	eautoreconf
+}
+
+multilib_src_configure() {
+	local -a 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 pynslcd)
+		$(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_test() {
+	pushd "${BUILD_DIR}" >/dev/null || die
+	ln -s ../pynslcd/constants.py utils/constants.py || die
+	python_foreach_impl python_test
+	popd >/dev/null || die
+}
+
+python_test() {
+	emake check
+}
+
+multilib_src_install_all() {
+	local script
+
+	newinitd "${FILESDIR}"/nslcd.init nslcd
+	s6_install_service nslcd "${FILESDIR}"/nslcd.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
+	if use pynslcd; then
+		rm -rf "${D}"/usr/share/pynslcd
+		python_moduleinto pynslcd
+		python_foreach_impl python_domodule pynslcd/*.py
+		python_scriptinto /usr/sbin
+		python_foreach_impl python_newscript pynslcd/main.py pynslcd
+		newinitd "${FILESDIR}"/pynslcd.init pynslcd
+	fi
+
+	systemd_newtmpfilesd "${FILESDIR}"/nslcd-tmpfiles.conf nslcd.conf
+	systemd_newunit "${FILESDIR}"/nslcd.service nslcd.service
+}
+
+multilib_src_install() {
+	emake DESTDIR="${D}" install
+
+	if use pynslcd; then
+		python_moduleinto pynslcd
+		python_foreach_impl python_domodule pynslcd/*.py
+	fi
+}
+
+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
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-auth/nss-pam-ldapd/, sys-auth/nss-pam-ldapd/files/
@ 2021-05-24 21:03 Patrick McLean
  0 siblings, 0 replies; 6+ messages in thread
From: Patrick McLean @ 2021-05-24 21:03 UTC (permalink / raw
  To: gentoo-commits

commit:     0fc950fe84f88ef9d72d705f067f534546423225
Author:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Mon May 24 21:03:12 2021 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Mon May 24 21:03:40 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0fc950fe

sys-auth/nss-pam-ldapd-0.9.11-r3: Add py39

Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>

 .../files/nss-pam-ldapd-0.9.11-tests-py39.patch    | 26 ++++++++++++++++++++++
 .../nss-pam-ldapd/nss-pam-ldapd-0.9.11-r3.ebuild   |  6 +++--
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-tests-py39.patch b/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-tests-py39.patch
new file mode 100644
index 00000000000..6761de73d6c
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.11-tests-py39.patch
@@ -0,0 +1,26 @@
+diff --git a/tests/test_doctest.sh b/tests/test_doctest.sh
+index 5b3a13d..82749a2 100755
+--- a/tests/test_doctest.sh
++++ b/tests/test_doctest.sh
+@@ -53,7 +53,7 @@ do
+   if ${python} -c 'import ldap'
+   then
+     echo "Running pynslcd doctests with $python..."
+-    PYTHONPATH="${top_builddir}/pynslcd" ${python} -m doctest -v "${top_srcdir}/pynslcd"/*.py
++    PYTHONPATH="${top_builddir}/pynslcd:${top_builddir}" ${python} -m doctest -v "${top_srcdir}/pynslcd"/*.py
+   fi
+   echo "Running pynslcd doctests with $python..."
+   PYTHONPATH="${top_builddir}/utils" ${python} -m doctest -v "${top_srcdir}/utils"/*.py
+diff --git a/tests/test_pynslcd_cache.py b/tests/test_pynslcd_cache.py
+index 8d3d02a..e7b19c0 100755
+--- a/tests/test_pynslcd_cache.py
++++ b/tests/test_pynslcd_cache.py
+@@ -27,6 +27,8 @@ import unittest
+ # fix the Python path
+ sys.path.insert(1, os.path.abspath(os.path.join(sys.path[0], '..', 'pynslcd')))
+ sys.path.insert(2, os.path.abspath(os.path.join('..', 'pynslcd')))
++sys.path.insert(3, os.path.abspath(os.path.join('..')))
++print(sys.path)
+ 
+ 
+ # TODO: think about case-sensitivity of cache searches (have tests for that)

diff --git a/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.11-r3.ebuild b/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.11-r3.ebuild
index 3d6590078bc..3f748952208 100644
--- a/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.11-r3.ebuild
+++ b/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.11-r3.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-PYTHON_COMPAT=(python3_{7..8})
+PYTHON_COMPAT=(python3_{7..9})
 inherit prefix python-r1 autotools multilib multilib-minimal systemd s6 tmpfiles
 
 DESCRIPTION="NSS module for name lookups using LDAP"
@@ -53,6 +53,7 @@ PATCHES=(
 	"${FILESDIR}/nss-pam-ldapd-0.9.11-use-mkstemp.patch"
 	"${FILESDIR}/nss-pam-ldapd-0.9.11-relative-imports.patch"
 	"${FILESDIR}/nss-pam-ldapd-0.9.11-tests.patch"
+	"${FILESDIR}/nss-pam-ldapd-0.9.11-tests-py39.patch"
 )
 
 src_prepare() {
@@ -100,7 +101,8 @@ multilib_src_test() {
 }
 
 python_test() {
-	emake check
+	cp -l "${S}"/pynslcd/*.py pynslcd/ || die "Could not copy python files for tests"
+	nonfatal emake check || die "tests failed with ${EPYTHON}"
 }
 
 multilib_src_install_all() {


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-auth/nss-pam-ldapd/, sys-auth/nss-pam-ldapd/files/
@ 2023-03-20  5:36 Sam James
  0 siblings, 0 replies; 6+ messages in thread
From: Sam James @ 2023-03-20  5:36 UTC (permalink / raw
  To: gentoo-commits

commit:     090dc863c60b149b5942951fb2326472c6e70281
Author:     Cristian Othón Martínez Vera <cfuga <AT> cfuga <DOT> mx>
AuthorDate: Thu Mar 16 22:42:35 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Mar 20 05:29:33 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=090dc863

sys-auth/nss-pam-ldapd: fix musl build

* add sys-libs/musl-nscd as dependency for musl, to fix ```unknown type name nss_status_t``` error
* patch for missing NETDB_INTERNAL

Closes: https://bugs.gentoo.org/713612
Closes: https://bugs.gentoo.org/716272
Signed-off-by: Cristian Othón Martínez Vera <cfuga <AT> cfuga.mx>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/nss-pam-ldapd-0.9.12-netdb-defines.patch |  26 ++++
 .../nss-pam-ldapd/nss-pam-ldapd-0.9.12-r3.ebuild   | 163 +++++++++++++++++++++
 2 files changed, 189 insertions(+)

diff --git a/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.12-netdb-defines.patch b/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.12-netdb-defines.patch
new file mode 100644
index 000000000000..2036da4fd7b1
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/files/nss-pam-ldapd-0.9.12-netdb-defines.patch
@@ -0,0 +1,26 @@
+Bug: https://bugs.gentoo.org/716272
+
+--- a/nss/hosts.c
++++ b/nss/hosts.c
+@@ -49,6 +49,9 @@
+   *h_errnop = NO_RECOVERY;                                                  \
+   return NSS_STATUS_UNAVAIL;
+ 
++#ifndef NETDB_INTERNAL
++#define NETDB_INTERNAL -1
++#endif
+ #undef ERROR_OUT_BUFERROR
+ #define ERROR_OUT_BUFERROR(fp)                                              \
+   *errnop = ERANGE;                                                         \
+--- a/nss/networks.c
++++ b/nss/networks.c
+@@ -49,6 +49,9 @@
+   *h_errnop = NO_RECOVERY;                                                  \
+   return NSS_STATUS_UNAVAIL;
+ 
++#ifndef NETDB_INTERNAL
++#define NETDB_INTERNAL -1
++#endif
+ #undef ERROR_OUT_BUFERROR
+ #define ERROR_OUT_BUFERROR(fp)                                              \
+   *errnop = ERANGE;                                                         \

diff --git a/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.12-r3.ebuild b/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.12-r3.ebuild
new file mode 100644
index 000000000000..2f0098518878
--- /dev/null
+++ b/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.12-r3.ebuild
@@ -0,0 +1,163 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..11} )
+inherit autotools python-r1 s6 systemd tmpfiles multilib-minimal
+
+DESCRIPTION="NSS module for name lookups using LDAP"
+HOMEPAGE="https://arthurdejong.org/nss-pam-ldapd/"
+SRC_URI="https://arthurdejong.org/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ia64 ~sparc ~x86"
+IUSE="debug kerberos +pam pynslcd sasl test +utils"
+REQUIRED_USE="
+	utils? ( ${PYTHON_REQUIRED_USE} )
+	test? ( ${PYTHON_REQUIRED_USE} pynslcd )
+"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+	acct-group/nslcd
+	acct-user/nslcd
+	net-nds/openldap:=[${MULTILIB_USEDEP}]
+	sasl? ( dev-libs/cyrus-sasl[${MULTILIB_USEDEP}] )
+	kerberos? ( virtual/krb5[${MULTILIB_USEDEP}] )
+	sys-libs/pam[${MULTILIB_USEDEP}]
+	utils? ( ${PYTHON_DEPS} )
+	pynslcd? (
+		dev-python/python-ldap[${PYTHON_USEDEP}]
+		dev-python/python-daemon[${PYTHON_USEDEP}]
+	)
+	elibc_musl? ( sys-libs/musl-nscd )
+	!sys-auth/nss_ldap
+	!sys-auth/pam_ldap
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	${PYTHON_DEPS}
+	test? ( dev-python/pylint[${PYTHON_USEDEP}] )
+"
+
+PATCHES=(
+	"${FILESDIR}"/nss-pam-ldapd-0.9.4-disable-py3-only-linters.patch
+	"${FILESDIR}"/nss-pam-ldapd-0.9.11-use-mkstemp.patch
+	"${FILESDIR}"/nss-pam-ldapd-0.9.11-relative-imports.patch
+	"${FILESDIR}"/nss-pam-ldapd-0.9.11-tests.patch
+	"${FILESDIR}"/nss-pam-ldapd-0.9.11-tests-py39.patch
+	"${FILESDIR}"/nss-pam-ldapd-0.9.12-netdb-defines.patch
+)
+
+pkg_setup() {
+	[[ ${MERGE_TYPE} != binary ]] && python_setup
+}
+
+src_prepare() {
+	default
+
+	touch pynslcd/__init__.py || die "Could not create __init__.py for pynslcd"
+	mv pynslcd/pynslcd.py pynslcd/main.py || die
+
+	eautoreconf
+}
+
+multilib_src_configure() {
+	local myconf=(
+		--disable-utils
+		--enable-warnings
+		--with-ldap-lib=openldap
+		--with-ldap-conf-file="${EPREFIX}"/etc/nslcd.conf
+		--with-nslcd-pidfile=/run/nslcd/nslcd.pid
+		--with-nslcd-socket=/run/nslcd/socket
+		--with-nss-flavour=glibc
+		$(use_enable pynslcd)
+		$(use_enable debug)
+		$(use_enable kerberos)
+		$(use_enable pam)
+		$(use_enable sasl)
+
+		# nss libraries always go in /lib on Gentoo
+		--with-pam-seclib-dir="${EPREFIX}"/$(get_libdir)/security
+		--libdir="${EPREFIX}"/$(get_libdir)
+	)
+	ECONF_SOURCE="${S}" econf "${myconf[@]}"
+}
+
+multilib_src_test() {
+	python_test() {
+		cp -l "${S}"/pynslcd/*.py pynslcd/ || die "Could not copy python files for tests"
+		nonfatal emake check || die "tests failed with ${EPYTHON}"
+	}
+
+	pushd "${BUILD_DIR}" >/dev/null || die
+	ln -s ../pynslcd/constants.py utils/constants.py || die
+	python_foreach_impl python_test
+	popd >/dev/null || die
+}
+
+multilib_src_install() {
+	emake DESTDIR="${D}" install
+
+	if use pynslcd; then
+		python_moduleinto pynslcd
+		python_foreach_impl python_domodule pynslcd/*.py
+	fi
+}
+
+multilib_src_install_all() {
+	einstalldocs
+
+	newinitd "${FILESDIR}"/nslcd.init nslcd
+	s6_install_service nslcd "${FILESDIR}"/nslcd.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
+
+		local script
+		for script in chsh getent; do
+			python_foreach_impl python_newscript utils/${script}.py ${script}.ldap
+		done
+	fi
+	if use pynslcd; then
+		rm -rf "${ED}"/usr/share/pynslcd || die
+		python_moduleinto pynslcd
+		python_foreach_impl python_domodule pynslcd/*.py
+		python_scriptinto /usr/sbin
+		python_foreach_impl python_newscript pynslcd/main.py pynslcd
+		newinitd "${FILESDIR}"/pynslcd.init pynslcd
+	fi
+
+	newtmpfiles "${FILESDIR}"/nslcd-tmpfiles.conf nslcd.conf
+	systemd_newunit "${FILESDIR}"/nslcd.service nslcd.service
+}
+
+pkg_postinst() {
+	tmpfiles_process nslcd.conf
+
+	elog "For this to work you must configure /etc/nslcd.conf"
+	elog "This configuration is similar to pam_ldap's /etc/ldap.conf"
+	elog
+	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"
+	elog
+	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"
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-03-20  5:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-20  5:36 [gentoo-commits] repo/gentoo:master commit in: sys-auth/nss-pam-ldapd/, sys-auth/nss-pam-ldapd/files/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2021-05-24 21:03 Patrick McLean
2020-09-05  0:07 Patrick McLean
2020-03-16 17:58 Matthew Thode
2020-01-16 17:13 Matthew Thode
2019-10-08  0:35 Patrick McLean

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox