Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-auth/nss_ldap/files/, sys-auth/nss_ldap/
Date: Thu, 26 Aug 2021 18:21:18
Message-Id: 1630002062.185c7bc43d6c85bfa46f3420493fbe3502071ad3.sam@gentoo
1 commit: 185c7bc43d6c85bfa46f3420493fbe3502071ad3
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Thu Aug 26 18:18:43 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 26 18:21:02 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=185c7bc4
7
8 sys-auth/nss_ldap: fix finding glibc version on no-multilib
9
10 Bit of a hack but the rest of it is rather fragile anyway.
11
12 The issue was that ${EPREFIX}/lib doesn't exist on
13 non-multilib systems.
14
15 Bug: https://bugs.gentoo.org/810058
16 Signed-off-by: Sam James <sam <AT> gentoo.org>
17
18 .../nss_ldap/files/nss_ldap-265-r10-libdir.patch | 31 +++++
19 sys-auth/nss_ldap/nss_ldap-265-r10.ebuild | 148 +++++++++++++++++++++
20 2 files changed, 179 insertions(+)
21
22 diff --git a/sys-auth/nss_ldap/files/nss_ldap-265-r10-libdir.patch b/sys-auth/nss_ldap/files/nss_ldap-265-r10-libdir.patch
23 new file mode 100644
24 index 00000000000..6fdf4cc6c08
25 --- /dev/null
26 +++ b/sys-auth/nss_ldap/files/nss_ldap-265-r10-libdir.patch
27 @@ -0,0 +1,31 @@
28 +--- a/Makefile.am
29 ++++ b/Makefile.am
30 +@@ -38,17 +38,13 @@
31 + DEFS = @DEFS@
32 + #INCLUDES = -I$(top_builddir) -I$(srcdir)
33 +
34 +-if GCC
35 +-MULTI_OS_DIRECTORY=$(shell $(CC) $(CFLAGS) -print-multi-os-directory)
36 +-else
37 + MULTI_OS_DIRECTORY=.
38 +-endif
39 +
40 + if GLIBC
41 +-LIBC_VERS = $(shell ls /lib/$(MULTI_OS_DIRECTORY)/libc-*.so | tail -n 1 | sed -e 's|.*libc-\(.*\)\.so|\1|')
42 ++LIBC_VERS = $(shell ls @GENTOO_PORTAGE_EPREFIX@/$(LIBDIR_UNPREFIXED)/$(MULTI_OS_DIRECTORY)/libc-*.so | tail -n 1 | sed -e 's|.*libc-\(.*\)\.so|\1|')
43 + NSS_LDAP_LIBC_VERSIONED = libnss_ldap-$(LIBC_VERS).so
44 +
45 +-NSS_VERS = $(shell ls /lib/$(MULTI_OS_DIRECTORY)/libnss_files.so.? | tail -n 1 | sed -e 's|.*libnss_files\.so\.\(.*\)|\1|')
46 ++NSS_VERS = $(shell ls @GENTOO_PORTAGE_EPREFIX@/$(LIBDIR_UNPREFIXED)/$(MULTI_OS_DIRECTORY)/libnss_files.so.? | tail -n 1 | sed -e 's|.*libnss_files\.so\.\(.*\)|\1|')
47 + NSS_LDAP_NSS_VERSIONED = libnss_ldap.so.$(NSS_VERS)
48 + endif
49 +
50 +@@ -83,8 +79,6 @@
51 + $(mkinstalldirs) $(DESTDIR)$(libdir)
52 + $(INSTALL_PROGRAM) -o $(INST_UID) -g $(INST_GID) nss_ldap.so $(DESTDIR)$(libdir)/$(NSS_LDAP_LIBC_VERSIONED)
53 + (cd $(DESTDIR)$(libdir); ln -sf $(NSS_LDAP_LIBC_VERSIONED) $(NSS_LDAP_NSS_VERSIONED))
54 +- $(mkinstalldirs) $(DESTDIR)/usr$(libdir)
55 +- (cd $(DESTDIR)/usr$(libdir); ln -sf ../..$(libdir)/$(NSS_LDAP_NSS_VERSIONED) .)
56 + else
57 + $(mkinstalldirs) $(DESTDIR)$(libdir)
58 + if HPUX
59
60 diff --git a/sys-auth/nss_ldap/nss_ldap-265-r10.ebuild b/sys-auth/nss_ldap/nss_ldap-265-r10.ebuild
61 new file mode 100644
62 index 00000000000..c066b1fceb5
63 --- /dev/null
64 +++ b/sys-auth/nss_ldap/nss_ldap-265-r10.ebuild
65 @@ -0,0 +1,148 @@
66 +# Copyright 1999-2021 Gentoo Authors
67 +# Distributed under the terms of the GNU General Public License v2
68 +
69 +EAPI=7
70 +
71 +inherit autotools fixheadtails multilib-minimal prefix
72 +
73 +DESCRIPTION="NSS LDAP Module"
74 +HOMEPAGE="http://www.padl.com/OSS/nss_ldap.html"
75 +SRC_URI="http://www.padl.com/download/${P}.tar.gz"
76 +
77 +SLOT="0"
78 +LICENSE="LGPL-2"
79 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux"
80 +IUSE="debug kerberos ssl sasl split-usr"
81 +
82 +DEPEND="
83 + >=net-nds/openldap-2.4.38-r1[${MULTILIB_USEDEP}]
84 + sasl? ( >=dev-libs/cyrus-sasl-2.1.26-r3[${MULTILIB_USEDEP}] )
85 + kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )
86 + ssl? ( >=dev-libs/openssl-1.0.1h-r2:0[${MULTILIB_USEDEP}] )
87 +"
88 +RDEPEND="
89 + ${DEPEND}
90 + !<net-fs/autofs-4.1.3
91 +"
92 +
93 +src_prepare() {
94 + default
95 +
96 + # Patch is for Prefix
97 + # eprefixify is safe on non-Prefix systems, so go unconditional
98 + # Note: comment this out or make it conditional on 'use prefix'
99 + # if needs rebasing. Don't remove.
100 + eapply "${FILESDIR}"/${P}-r9-libdir.patch
101 + eprefixify Makefile.am
102 +
103 + # bug 438692
104 + eapply -p0 "${FILESDIR}"/${P}-pthread.patch
105 +
106 + eapply -p0 "${FILESDIR}"/nsswitch.ldap.diff
107 +
108 + # Applied by upstream
109 + #eapply "${FILESDIR}"/${PN}-239-tls-security-bug.patch
110 +
111 + eapply -p0 "${FILESDIR}"/${PN}-249-sasl-compile.patch
112 +
113 + eapply "${FILESDIR}"/${PN}-265-reconnect-timeouts.patch
114 +
115 + # Applied by upstream
116 + #eapply "${FILESDIR}"/${PN}-254-nss_getgrent_skipmembers.patch
117 +
118 + eapply "${FILESDIR}"/${PN}-257-nss_max_group_depth.patch
119 +
120 + sed -i.orig \
121 + -e '/^ @(#)\$Id: ldap.conf,v/s,^,#,' \
122 + "${S}"/ldap.conf \
123 + || die
124 +
125 + # Fix head/tail stuff
126 + ht_fix_file "${S}"/Makefile.am "${S}"/Makefile.in "${S}"/depcomp
127 +
128 + # Fix build borkage
129 + local i
130 + for i in Makefile.{in,am}; do
131 + sed -i.orig \
132 + -e '/^install-exec-local: nss_ldap.so/s,nss_ldap.so,,g' \
133 + "${S}"/$i || die
134 + done
135 +
136 + eapply "${FILESDIR}"/${PN}-257.2-gssapi-headers.patch
137 +
138 + # Bug #214750, no automagic deps
139 + eapply "${FILESDIR}"/${PN}-264-disable-automagic.patch
140 +
141 + # Upstream forgets the version number sometimes
142 + #sed -i \
143 + # -e "/^AM_INIT_AUTOMAKE/s~2..~$PV~" \
144 + # "${S}"/configure.in || die
145 +
146 + # Include an SONAME
147 + eapply "${FILESDIR}"/${PN}-254-soname.patch
148 +
149 + # Fix broken oneshot connections
150 + eapply "${FILESDIR}/nss_ldap-265-missing-entries-oneshot.patch"
151 +
152 + sed -i \
153 + -e 's, vers_string , PERL5LIB="@top_srcdir@" @top_srcdir@/vers_string ,g' \
154 + "${S}"/Makefile.am || die
155 +
156 + eautoreconf
157 +}
158 +
159 +multilib_src_configure() {
160 + local myconf=(
161 + # --enable-schema-mapping
162 + --with-ldap-lib=openldap
163 + --with-ldap-conf-file="${EPREFIX}/etc/ldap.conf"
164 + --enable-paged-results
165 + --enable-rfc2307bis
166 + $(use_enable ssl)
167 + $(use_enable sasl)
168 + $(use_enable kerberos krb)
169 + )
170 +
171 + use debug && myconf+=( --enable-debugging )
172 + use kerberos && myconf+=( --enable-configurable-krb5-ccname-gssapi )
173 +
174 + # Neede to be careful with changing this
175 + # bug #581306
176 + multilib_is_native_abi && myconf+=( --libdir="${EPREFIX}/$(get_libdir)" )
177 +
178 + ECONF_SOURCE=${S} econf "${myconf[@]}"
179 +}
180 +
181 +multilib_src_install() {
182 + emake -j1 DESTDIR="${D}" \
183 + LIBDIR_UNPREFIXED="$(get_libdir)" \
184 + INST_UID=${PORTAGE_USER:-root} \
185 + INST_GID=${PORTAGE_GROUP:-root} \
186 + install
187 +}
188 +
189 +multilib_src_install_all() {
190 + use split-usr &&
191 + dosym ../../$(get_libdir)/libnss_ldap.so.2 /usr/$(get_libdir)/libnss_ldap.so.2
192 +
193 + insinto /etc
194 + doins ldap.conf
195 +
196 + # Append two blank lines and some skip entries
197 + echo >>"${ED}"/etc/ldap.conf || die
198 + echo >>"${ED}"/etc/ldap.conf || die
199 + sed -i "${ED}"/etc/ldap.conf \
200 + -e '$inss_initgroups_ignoreusers ldap,openldap,mysql,syslog,root,postgres' \
201 + || die
202 +
203 + dodoc ldap.conf ANNOUNCE NEWS ChangeLog AUTHORS \
204 + CVSVersionInfo.txt README nsswitch.ldap certutil
205 +
206 + docinto docs
207 + dodoc -r doc/.
208 +}
209 +
210 +pkg_postinst() {
211 + elog "If you use a ldaps:// string in the 'uri' setting of"
212 + elog "your /etc/ldap.conf, you must set 'ssl on'!"
213 +}