File nss_ldap.spec of Package nss_ldap.3124

# spec file for package nss_ldap
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           nss_ldap
BuildRequires:  automake
BuildRequires:  db-devel
BuildRequires:  krb5-devel
BuildRequires:  openldap2-devel
PreReq:         sed coreutils /usr/bin/grep /bin/mktemp
# bug437293
%ifarch ppc64
Obsoletes:      nss_ldap-64bit
Version:        265
Release:        0
Summary:        NSS LDAP Module
License:        LGPL-2.1+
Group:          Productivity/Networking/LDAP/Clients
Source:         nss_ldap-%{version}.tar.bz2
Source1:        README.SUSE
Source2:        baselibs.conf
Source3:        ldap.conf
Patch:          0000-nss_ldap.dif
Patch1:         0001-group-utf8.dif
Patch2:         0002-nss_ldap-ldapconn-leak-bug418.dif
Patch3:         0003-nss_ldap-getent-retry.dif
Patch4:         0004-nss_ldap-getent-skip-invalid-uidgidnumber.dif
# Upstream issue with glibc-2.16
Patch5:         0005-nss_ldap-265-glibc-2.16.patch
# Fix also issue with threads on glibc-2.16
Patch6:         0006-nss_ldap-265-pthread.patch
# SIGPIPE handling atfork
Patch7:         0007-bnc#842120.dif
# reverse ipv6 host lookups fail when ldap is used
Patch8:         0008-bnc#866763.dif
Patch9:         0009-fix-for-BUG-412-don-t-close-nested-contexts.patch
Patch10:        0010-initialize-context-in-_nss_ldap_getbyname.patch
Patch11:        0011-When-invoked-via-glibc-the-input-buffer-is-enlarged.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Nss_ldap is a glibc NSS module that allows X.500 and LDAP directory
servers to be used as a primary source of aliases, ethers, groups,
hosts, networks, protocol, users, RPCs, services, and shadow passwords
(instead of or in addition to using flat files or NIS).

%setup -q
%patch -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
cp -v %{S:1} .

CPPFLAGS="-I/usr/include/sasl -DINET6" \
./configure --prefix=/usr \
            --mandir=%{_mandir} \
	    --enable-rfc2307bis \
	    --enable-schema-mapping \
	    --enable-xad \
	    --enable-paged-results \
            --enable-configurable-krb5-ccname-gssapi \
	    --libdir=%{_libdir} \
	    --sysconfdir=/etc \

mkdir -p $RPM_BUILD_ROOT/%{_lib}
mkdir -p $RPM_BUILD_ROOT%{_libdir}
install -m 755 $RPM_BUILD_ROOT/%{_lib}/
install -d 755 $RPM_BUILD_ROOT/%{_sysconfdir}/
install -m 644 %{S:3} $RPM_BUILD_ROOT/%{_sysconfdir}/
make DESTDIR=$RPM_BUILD_ROOT install-man


# If we have a /etc/ldap.conf.rpmsave, and no /etc/ldap.conf,
# backup the rpmsave file and use that later instead of our
# own version. This fixes the problem that the file was moved
# from pwdutils to nss_ldap and else the changes would go lost.
if [ ! -e /etc/ldap.conf -a -f /etc/ldap.conf.rpmsave ]; then
   cp -p /etc/ldap.conf.rpmsave /etc/...ldap.conf.pwdutils

# If we backuped ldap.conf, move now the backup in place
test -f /etc/...ldap.conf.pwdutils && mv /etc/...ldap.conf.pwdutils /etc/ldap.conf ||:

%postun -p /sbin/ldconfig

%config(noreplace) %{_sysconfdir}/ldap.conf
%doc ANNOUNCE AUTHORS COPYING ChangeLog NEWS README README.SUSE nsswitch.ldap ldap.conf doc/README.paged
%doc %{_mandir}/man5/nss_ldap.5*

openSUSE Build Service is sponsored by