Summary: OpenLDAP 2.2
Name: openldap
Version: 2.2.11
Release: 1
Copyright: See LICENSE for details.
Source0: %{name}-%{version}.tar.bz2
URL: http://www.openldap.org
Group: System Environment/Base
BuildRoot: /var/tmp/%{name}-%{version}-root
BuildPrereq: openssl-devel
BuildPrereq: db42-devel
Requires: openssl
Requires: db42
Requires: libtool-libs
%description
OpenLDAP
%package server
Summary: OpenLDAP 2.2 server
Group: System Environment/Daemons
Requires: openldap = %{version}-%{release}
%description server
OpenLDAP 2.2 server
%package devel
Summary: OpenLDAP 2.2 development files
Group: Development/Libraries
Requires: openldap = %{version}-%{release}
%description devel
OpenLDAP 2.2 development files
%prep
%setup
%build
./configure \
--prefix=/usr \
--libexecdir=/usr/sbin \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--localstatedir=/var/lib/ldap \
--enable-crypt \
--enable-modules \
--enable-bdb \
--with-bdb-modules=dynamic
make depend && make
%install
make DESTDIR="$RPM_BUILD_ROOT" install
mkdir -p "$RPM_BUILD_ROOT"/etc/rc.d/init.d
cat >"$RPM_BUILD_ROOT"/etc/rc.d/init.d/ldap <"$RPM_BUILD_ROOT"/usr/share/openldap/base.ldif </dev/null 2>&1
(grep ldap /etc/passwd || useradd -u 93 -g ldap -d /var/lib/ldap -s /bin/false -r ldap)>dev/null 2>&1
%post server
chkconfig ldap off
chkconfig --level 345 ldap on
%files
%defattr(0664,root,root,0755)
%attr(0755,root,root) /usr/bin/*
%attr(0755,root,root) /usr/lib/*.so*
%attr(0644,root,root) /etc/openldap/ldap.conf.default
%config(noreplace) %attr(0644,root,root) /etc/openldap/ldap.conf
%attr(0644,root,root) /usr/share/man/man1/*
%attr(0644,root,root) /usr/share/man/man5/ldap.conf.5.*
%attr(0644,root,root) /usr/share/man/man5/ldif.5.*
%attr(0644,root,root) /usr/share/openldap/ucdata/*
%dir %attr(0755,root,root) /etc/openldap
%dir %attr(0755,root,root) /usr/share/openldap
%dir %attr(0755,root,root) /usr/share/openldap/ucdata
%doc README LICENSE CHANGES COPYRIGHT
%doc doc/drafts
%doc doc/rfc
%files server
%defattr(0664,root,root,0755)
%attr(0755,root,root) /usr/sbin/*
%attr(0644,root,root) /etc/openldap/slapd.conf.default
%config(noreplace) %attr(0644,root,root) /etc/openldap/slapd.conf
%attr(0644,root,root) /etc/openldap/schema/*
%config(noreplace) %attr(0755,root,root) /etc/rc.d/init.d/ldap
%attr(0644,root,root) /usr/share/openldap/base.ldif
%attr(0644,root,root) /usr/share/man/man8/*
%attr(0644,root,root) /usr/share/man/man5/slapd*
%dir %attr(0755,root,root) /etc/openldap/schema
%dir %attr(0755,ldap,ldap) /var/lib/ldap
%dir %attr(0700,ldap,ldap) /var/lib/ldap/openldap-data
%dir %attr(0700,ldap,ldap) /var/lib/ldap/openldap-slurp
%files devel
%defattr(0664,root,root,0755)
%attr(0644,root,root) /usr/include/*
%attr(0755,root,root) /usr/lib/*.*a
%attr(0644,root,root) /usr/share/man/man3/*
%doc doc/devel/*