File nss-ldapd.spec of Package nss-ldapd

#
# spec file for package nss-ldapd (Version 0.6.10)
#
# Copyright (c) 2009 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/
#

# norootforbuild


Name:           nss-ldapd
BuildRequires:  db-devel krb5-devel openldap2-devel
License:        LGPL v2.1 or later
Group:          Productivity/Networking/LDAP/Clients
AutoReqProv:    on
PreReq:         /bin/chmod
Conflicts:      nss_ldap
Version:        0.6.10
Release:        2
Summary:        NSS module and daemon for using LDAP as a naming service
Url:            http://arthurdejong.org/nss-ldapd/
Source:         nss-ldapd-%{version}.tar.bz2
Source1:        rc.nslcd
Source100:      nss-ldapd-0.6.8-rpmlintrc
Patch0:         nslcd-passwd-offbyone.dif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This package provides a Name Service Switch module that allows your
LDAP server to provide user account, group, host name, alias, netgroup,
and basically any other information that you would normally get from
/etc flat files or NIS. Nss-ldapd is a fork of the nss_ldap package by
PADL Software Pty Ltd.. implementing some structural design changes
that were needed to fix some issues of the original design.



Authors:
--------
    Luke Howard <lukeh@padl.com>
    West Consulting <info@west.nl>
    Arthur de Jong <arthur@arthurdejong.org>

%prep
%setup -q
cp -v %{S:1} .
%patch0 -p1

%build
%{?suse_update_config:%{suse_update_config -f}}
autoreconf
CFLAGS="$RPM_OPT_FLAGS" \
CPPFLAGS="-I/usr/include/sasl" \
./configure --prefix=/usr \
            --mandir=%{_mandir} \
	    --libdir=/%{_lib} \
	    --sysconfdir=/etc 
make

%install
mkdir -p $RPM_BUILD_ROOT/etc/init.d/
mkdir -p $RPM_BUILD_ROOT/usr/sbin/
install -m 755 rc.nslcd $RPM_BUILD_ROOT/etc/init.d/nslcd
ln -sf ../../etc/init.d/nslcd $RPM_BUILD_ROOT/usr/sbin/rcnslcd
make DESTDIR=$RPM_BUILD_ROOT install
mkdir -p $RPM_BUILD_ROOT/var/run/nslcd
install -m 644 man/nss-ldapd.conf.5 $RPM_BUILD_ROOT/usr/share/man/man5
install -m 644 man/nslcd.8 $RPM_BUILD_ROOT/usr/share/man/man8

%clean
rm -fr $RPM_BUILD_ROOT

%post
/sbin/ldconfig
# adjust permission of configfile upon update (bnc#487737)
if [ ${1:-0} -gt 1 ] ; then
    /bin/chmod 640 /etc/nss-ldapd.conf
fi

%preun
%stop_on_removal nslcd

%postun 
/sbin/ldconfig
%restart_on_update nslcd
%insserv_cleanup

%files
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog NEWS README
/%{_lib}/libnss_ldap.so.2
%doc %{_mandir}/man5/*
%doc %{_mandir}/man8/*
%config(noreplace) %attr(640,root,root) /etc/nss-ldapd.conf
%config /etc/init.d/nslcd
/usr/sbin/rcnslcd
%dir /var/run/nslcd
/usr/sbin/nslcd

%changelog
openSUSE Build Service is sponsored by