File nss_ldap.spec of Package nss_ldap

#
# spec file for package nss_ldap
#
# Copyright (c) 2014 SUSE LINUX Products 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 http://bugs.opensuse.org/
#


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
%endif
#
Version:        265
Release:        0
Summary:        NSS LDAP Module
License:        LGPL-2.1+
Group:          Productivity/Networking/LDAP/Clients
Url:            http://www.padl.com/OSS/nss_ldap.html
Source:         nss_ldap-%{version}.tar.bz2
Source1:        README.SUSE
Source2:        baselibs.conf
Source3:        ldap.conf
Patch:          nss_ldap.dif
Patch1:         group-utf8.dif
Patch2:         nss_ldap-ldapconn-leak-bug418.dif
Patch3:         nss_ldap-getent-retry.dif
Patch4:         nss_ldap-getent-skip-invalid-uidgidnumber.dif
# Upstream issue with glibc-2.16 http://bugzilla.padl.com/show_bug.cgi?id=445
Patch5:         nss_ldap-265-glibc-2.16.patch
# Fix also issue with threads on glibc-2.16 http://bugzilla.padl.com/show_bug.cgi?id=446
Patch6:         nss_ldap-265-pthread.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
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).

%prep
%setup -q
%patch -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5
%patch6
cp -v %{S:1} .

%build
autoreconf
CFLAGS="$RPM_OPT_FLAGS" \
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 \
	    --x-libraries=/usr/X11R6/%{_lib}
make

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

%clean
rm -fr $RPM_BUILD_ROOT

%post
/sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/ldap.conf
%doc ANNOUNCE AUTHORS COPYING ChangeLog NEWS README README.SUSE nsswitch.ldap ldap.conf doc/README.paged
/%{_lib}/libnss_ldap.so.2
%doc %{_mandir}/man5/nss_ldap.5*

%changelog
openSUSE Build Service is sponsored by