Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-auth/nss-pam-ldapd/
Date: Sun, 01 Jan 2023 18:25:00
Message-Id: 1672597487.2a32fc2c682df44bea4cb0661c719765ee081a40.soap@gentoo
1 commit: 2a32fc2c682df44bea4cb0661c719765ee081a40
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 1 18:24:47 2023 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 1 18:24:47 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a32fc2c
7
8 sys-auth/nss-pam-ldapd: update EAPI 7 -> 8
9
10 Signed-off-by: David Seifert <soap <AT> gentoo.org>
11
12 ...12-r1.ebuild => nss-pam-ldapd-0.9.12-r2.ebuild} | 100 ++++++++++-----------
13 1 file changed, 45 insertions(+), 55 deletions(-)
14
15 diff --git a/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.12-r1.ebuild b/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.12-r2.ebuild
16 similarity index 72%
17 rename from sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.12-r1.ebuild
18 rename to sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.12-r2.ebuild
19 index 88f0e013b023..187613b5f998 100644
20 --- a/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.12-r1.ebuild
21 +++ b/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.9.12-r2.ebuild
22 @@ -1,10 +1,10 @@
23 -# Copyright 1999-2022 Gentoo Authors
24 +# Copyright 1999-2023 Gentoo Authors
25 # Distributed under the terms of the GNU General Public License v2
26
27 -EAPI=7
28 +EAPI=8
29
30 -PYTHON_COMPAT=( python3_{8..10} )
31 -inherit prefix python-r1 autotools multilib multilib-minimal systemd s6 tmpfiles
32 +PYTHON_COMPAT=( python3_{8..11} )
33 +inherit autotools python-r1 s6 systemd tmpfiles multilib-minimal
34
35 DESCRIPTION="NSS module for name lookups using LDAP"
36 HOMEPAGE="https://arthurdejong.org/nss-pam-ldapd/"
37 @@ -14,9 +14,13 @@ LICENSE="LGPL-2.1"
38 SLOT="0"
39 KEYWORDS="amd64 x86"
40 IUSE="debug kerberos +pam pynslcd sasl test +utils"
41 +REQUIRED_USE="
42 + utils? ( ${PYTHON_REQUIRED_USE} )
43 + test? ( ${PYTHON_REQUIRED_USE} pynslcd )
44 +"
45 RESTRICT="!test? ( test )"
46
47 -COMMON_DEP="
48 +RDEPEND="
49 acct-group/nslcd
50 acct-user/nslcd
51 net-nds/openldap:=[${MULTILIB_USEDEP}]
52 @@ -31,34 +35,27 @@ COMMON_DEP="
53 !sys-auth/nss_ldap
54 !sys-auth/pam_ldap
55 "
56 -RDEPEND="${COMMON_DEP}"
57 -DEPEND="${COMMON_DEP}
58 - test? (
59 - ${PYTHON_DEPS}
60 - dev-python/pylint[${PYTHON_USEDEP}]
61 - )
62 -"
63 +DEPEND="${RDEPEND}"
64 BDEPEND="
65 ${PYTHON_DEPS}
66 - sys-devel/automake
67 -"
68 -
69 -REQUIRED_USE="
70 - utils? ( ${PYTHON_REQUIRED_USE} )
71 - test? ( ${PYTHON_REQUIRED_USE} pynslcd )
72 + test? ( dev-python/pylint[${PYTHON_USEDEP}] )
73 "
74
75 PATCHES=(
76 - "${FILESDIR}/nss-pam-ldapd-0.9.4-disable-py3-only-linters.patch"
77 - "${FILESDIR}/nss-pam-ldapd-0.9.11-use-mkstemp.patch"
78 - "${FILESDIR}/nss-pam-ldapd-0.9.11-relative-imports.patch"
79 - "${FILESDIR}/nss-pam-ldapd-0.9.11-tests.patch"
80 - "${FILESDIR}/nss-pam-ldapd-0.9.11-tests-py39.patch"
81 + "${FILESDIR}"/nss-pam-ldapd-0.9.4-disable-py3-only-linters.patch
82 + "${FILESDIR}"/nss-pam-ldapd-0.9.11-use-mkstemp.patch
83 + "${FILESDIR}"/nss-pam-ldapd-0.9.11-relative-imports.patch
84 + "${FILESDIR}"/nss-pam-ldapd-0.9.11-tests.patch
85 + "${FILESDIR}"/nss-pam-ldapd-0.9.11-tests-py39.patch
86 )
87
88 +pkg_setup() {
89 + [[ ${MERGE_TYPE} != binary ]] && python_setup
90 +}
91 +
92 src_prepare() {
93 default
94 - use utils && python_setup
95 +
96 touch pynslcd/__init__.py || die "Could not create __init__.py for pynslcd"
97 mv pynslcd/pynslcd.py pynslcd/main.py || die
98
99 @@ -66,11 +63,11 @@ src_prepare() {
100 }
101
102 multilib_src_configure() {
103 - local -a myconf=(
104 + local myconf=(
105 --disable-utils
106 --enable-warnings
107 --with-ldap-lib=openldap
108 - --with-ldap-conf-file=/etc/nslcd.conf
109 + --with-ldap-conf-file="${EPREFIX}"/etc/nslcd.conf
110 --with-nslcd-pidfile=/run/nslcd/nslcd.pid
111 --with-nslcd-socket=/run/nslcd/socket
112 --with-nss-flavour=glibc
113 @@ -79,40 +76,43 @@ multilib_src_configure() {
114 $(use_enable kerberos)
115 $(use_enable pam)
116 $(use_enable sasl)
117 - )
118 -
119 - # nss libraries always go in /lib on Gentoo
120 - if multilib_is_native_abi ; then
121 - myconf+=("--with-pam-seclib-dir=${EPREFIX}/$(get_libdir)/security")
122 - myconf+=("--libdir=${EPREFIX}/$(get_libdir)")
123 - else
124 - myconf+=("--with-pam-seclib-dir=/$(get_libdir)/security")
125 - myconf+=("--libdir=/$(get_libdir)")
126 - fi
127
128 + # nss libraries always go in /lib on Gentoo
129 + --with-pam-seclib-dir="${EPREFIX}"/$(get_libdir)/security
130 + --libdir="${EPREFIX}"/$(get_libdir)
131 + )
132 ECONF_SOURCE="${S}" econf "${myconf[@]}"
133 }
134
135 multilib_src_test() {
136 + python_test() {
137 + cp -l "${S}"/pynslcd/*.py pynslcd/ || die "Could not copy python files for tests"
138 + nonfatal emake check || die "tests failed with ${EPYTHON}"
139 + }
140 +
141 pushd "${BUILD_DIR}" >/dev/null || die
142 ln -s ../pynslcd/constants.py utils/constants.py || die
143 python_foreach_impl python_test
144 popd >/dev/null || die
145 }
146
147 -python_test() {
148 - cp -l "${S}"/pynslcd/*.py pynslcd/ || die "Could not copy python files for tests"
149 - nonfatal emake check || die "tests failed with ${EPYTHON}"
150 +multilib_src_install() {
151 + emake DESTDIR="${D}" install
152 +
153 + if use pynslcd; then
154 + python_moduleinto pynslcd
155 + python_foreach_impl python_domodule pynslcd/*.py
156 + fi
157 }
158
159 multilib_src_install_all() {
160 - local script
161 + einstalldocs
162
163 newinitd "${FILESDIR}"/nslcd.init nslcd
164 s6_install_service nslcd "${FILESDIR}"/nslcd.s6
165
166 insinto /usr/share/nss-pam-ldapd
167 - doins "${WORKDIR}/${P}/nslcd.conf"
168 + doins "${WORKDIR}"/${P}/nslcd.conf
169
170 fperms o-r /etc/nslcd.conf
171
172 @@ -120,12 +120,13 @@ multilib_src_install_all() {
173 python_moduleinto nslcd
174 python_foreach_impl python_domodule utils/*.py
175
176 + local script
177 for script in chsh getent; do
178 python_foreach_impl python_newscript utils/${script}.py ${script}.ldap
179 done
180 fi
181 if use pynslcd; then
182 - rm -rf "${D}"/usr/share/pynslcd
183 + rm -rf "${ED}"/usr/share/pynslcd || die
184 python_moduleinto pynslcd
185 python_foreach_impl python_domodule pynslcd/*.py
186 python_scriptinto /usr/sbin
187 @@ -137,26 +138,16 @@ multilib_src_install_all() {
188 systemd_newunit "${FILESDIR}"/nslcd.service nslcd.service
189 }
190
191 -multilib_src_install() {
192 - emake DESTDIR="${D}" install
193 -
194 - if use pynslcd; then
195 - python_moduleinto pynslcd
196 - python_foreach_impl python_domodule pynslcd/*.py
197 - fi
198 -}
199 -
200 pkg_postinst() {
201 tmpfiles_process nslcd.conf
202
203 - echo
204 elog "For this to work you must configure /etc/nslcd.conf"
205 elog "This configuration is similar to pam_ldap's /etc/ldap.conf"
206 - echo
207 + elog
208 elog "In order to use nss-pam-ldapd, nslcd needs to be running. You can"
209 elog "start it like this:"
210 elog " # /etc/init.d/nslcd start"
211 - echo
212 + elog
213 elog "You can add it to the default runlevel like so:"
214 elog " # rc-update add nslcd default"
215 elog
216 @@ -167,5 +158,4 @@ pkg_postinst() {
217 elog
218 elog "If you are upgrading, keep in mind that /etc/nss-ldapd.conf"
219 elog " is now named /etc/nslcd.conf"
220 - echo
221 }