4c16553
%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
4c16553
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
4c16553
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
4c16553
%endif
4c16553
4c16553
%define talloc_version 2.0.5
4c16553
%define tdb_version 1.2.9
2815e7b
%define tevent_version 0.9.13
4c16553
4c16553
Name: libldb
fd922ff
Version: 1.0.0
aeece6d
Release: 4%{?dist}
4c16553
Group: Development/Libraries
4c16553
Summary: A schema-less, ldap like, API and database
4c16553
Requires: libtalloc >= %{talloc_version}
4c16553
Requires: libtdb >= %{tdb_version}
4c16553
Requires: libtevent >= %{tevent_version}
aeece6d
Conflicts: libtevent < %{tevent_version}
4c16553
License: LGPLv3+
4c16553
URL: http://ldb.samba.org/
4c16553
Source: http://samba.org/ftp/ldb/ldb-%{version}.tar.gz
4c16553
4c16553
BuildRequires: libtalloc-devel >= %{talloc_version}
4c16553
BuildRequires: libtdb-devel >= %{tdb_version}
4c16553
BuildRequires: libtevent-devel >= %{tevent_version}
4c16553
%{?fedora:BuildRequires: popt-devel}
4c16553
%if 0%{?rhel} <= 5
4c16553
BuildRequires: popt
4c16553
%endif
4c16553
%if 0%{?rhel} >= 6
4c16553
BuildRequires: popt-devel
4c16553
%endif
4c16553
BuildRequires: autoconf
4c16553
BuildRequires: libxslt
4c16553
BuildRequires: docbook-style-xsl
4c16553
BuildRequires: python-devel
4c16553
BuildRequires: python-tdb
4c16553
BuildRequires: pytalloc-devel
4c16553
4c16553
# Patches
4c16553
4c16553
%description
4c16553
An extensible library that implements an LDAP like API to access remote LDAP
4c16553
servers, or use local tdb databases.
4c16553
fd922ff
%package -n ldb-tools
4c16553
Group: Development/Libraries
4c16553
Summary: Tools to manage LDB files
4c16553
Requires: libldb = %{version}-%{release}
4c16553
fd922ff
%description -n ldb-tools
4c16553
Tools to manage LDB files
4c16553
4c16553
%package devel
4c16553
Group: Development/Libraries
4c16553
Summary: Developer tools for the LDB library
4c16553
Requires: libldb = %{version}-%{release}
4c16553
Requires: libtdb-devel >= %{tdb_version}
4c16553
Requires: libtalloc-devel >= %{talloc_version}
4c16553
Requires: libtevent-devel >= %{tevent_version}
4c16553
Requires: pkgconfig
4c16553
4c16553
%description devel
4c16553
Header files needed to develop programs that link against the LDB library.
4c16553
4c16553
%package -n pyldb
4c16553
Group: Development/Libraries
4c16553
Summary: Python bindings for the LDB library
4c16553
Requires: libldb = %{version}-%{release}
4c16553
Requires: python-tdb = %{tdb_version}
4c16553
4c16553
%description -n pyldb
4c16553
Python bindings for the LDB library
4c16553
4c16553
%package -n pyldb-devel
4c16553
Group: Development/Libraries
4c16553
Summary: Development files for the Python bindings for the LDB library
4c16553
Requires: pyldb = %{version}-%{release}
4c16553
4c16553
%description -n pyldb-devel
4c16553
Development files for the Python bindings for the LDB library
4c16553
4c16553
%prep
4c16553
%setup -q -n ldb-%{version}
4c16553
4c16553
%build
a414d69
%configure --disable-rpath \
a414d69
           --disable-rpath-install \
4c16553
           --bundled-libraries=NONE \
4c16553
           --with-modulesdir=%{_libdir}/ldb/modules \
4c16553
           --with-privatelibdir=%{_libdir}/ldb
4c16553
4c16553
make V=1 %{?_smp_mflags}
4c16553
4c16553
%install
4c16553
make install DESTDIR=%{buildroot}
4c16553
4c16553
rm -f %{buildroot}%{_libdir}/libldb.a
4c16553
4c16553
# Remove _tevent.so (it's managed by python-tevent)
4c16553
rm -f %{buildroot}/%{python_sitearch}/_tevent.so
4c16553
4c16553
# Shared libraries need to be marked executable for
4c16553
# rpmbuild to strip them and include them in debuginfo
4c16553
find $RPM_BUILD_ROOT -name "*.so*" -exec chmod -c +x {} \;
4c16553
4c16553
%clean
4c16553
rm -rf %{buildroot}
4c16553
4c16553
%post -p /sbin/ldconfig
4c16553
4c16553
%postun -p /sbin/ldconfig
4c16553
4c16553
%files
4c16553
%defattr(-,root,root,-)
4c16553
%dir %{_libdir}/ldb
4c16553
%{_libdir}/libldb.so.*
fd922ff
%dir %{_libdir}/ldb/modules
fd922ff
%dir %{_libdir}/ldb/modules/ldb
4c16553
%{_libdir}/ldb/modules/ldb/*.so
4c16553
fd922ff
%files -n ldb-tools
4c16553
%defattr(-,root,root,-)
4c16553
%{_bindir}/ldbadd
4c16553
%{_bindir}/ldbdel
4c16553
%{_bindir}/ldbedit
4c16553
%{_bindir}/ldbmodify
4c16553
%{_bindir}/ldbrename
4c16553
%{_bindir}/ldbsearch
fd922ff
%{_libdir}/ldb/libldb-cmdline.so
4c16553
%{_mandir}/man1/ldbadd.1.*
4c16553
%{_mandir}/man1/ldbdel.1.*
4c16553
%{_mandir}/man1/ldbedit.1.*
4c16553
%{_mandir}/man1/ldbmodify.1.*
4c16553
%{_mandir}/man1/ldbrename.1.*
4c16553
%{_mandir}/man1/ldbsearch.1.*
4c16553
4c16553
%files devel
4c16553
%defattr(-,root,root,-)
4c16553
%{_includedir}/ldb_module.h
4c16553
%{_includedir}/ldb_handlers.h
4c16553
%{_includedir}/ldb_errors.h
fd922ff
%{_includedir}/ldb_version.h
4c16553
%{_includedir}/ldb.h
4c16553
%{_libdir}/libldb.so
4c16553
4c16553
%{_libdir}/pkgconfig/ldb.pc
4c16553
%{_mandir}/man3/ldb.3.gz
4c16553
4c16553
%files -n pyldb
4c16553
%defattr(-,root,root,-)
4c16553
%{python_sitearch}/ldb.so
fd922ff
%{_libdir}/libpyldb-util.so.1*
4c16553
4c16553
%files -n pyldb-devel
4c16553
%defattr(-,root,root,-)
4c16553
%{_includedir}/pyldb.h
4c16553
%{_libdir}/libpyldb-util.so
4c16553
%{_libdir}/pkgconfig/pyldb-util.pc
4c16553
4c16553
%post -n pyldb -p /sbin/ldconfig
4c16553
%postun -n pyldb -p /sbin/ldconfig
4c16553
4c16553
%changelog
aeece6d
* Mon Sep 02 2011 Stephen Gallagher <sgallagh@redhat.com> - 1.0.0-4
aeece6d
- Add Conflicts: on old libtevent to force update at the same time
aeece6d
2815e7b
* Mon Aug 29 2011 Stephen Gallagher <sgallagh@redhat.com> - 1.0.0-3
2815e7b
- Rebuild against fixed libtevent version
2815e7b
a414d69
* Fri Feb 11 2011 Stephen Gallagher <sgallagh@redhat.com> - 1.0.0-2
a414d69
- Disable rpath
a414d69
fd922ff
* Fri Feb 11 2011 Stephen Gallagher <sgallagh@redhat.com> - 1.0.0-1
fd922ff
- New upstream release 1.0.0
fd922ff
- SOname bump to account for module loading changes
fd922ff
- Rename libldb-tools to ldb-tools to make upgrades easier
fd922ff
1ba86b5
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.22-9
1ba86b5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
1ba86b5
4c16553
* Fri Feb 04 2011 Stephen Gallagher <sgallagh@redhat.com> - 0.9.22-8
4c16553
- Fixes from package review
4c16553
- Change Requires: on tools subpackage to be the exact version/release
4c16553
- Remove unnecessary BuildRoot directive
4c16553
4c16553
* Mon Jan 17 2011 Stephen Gallagher <sgallagh@redhat.com> - 0.9.22-7
4c16553
- Update to 0.9.22 (first independent release of libldb upstream)
4c16553