c5e7b7
%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
c5e7b7
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
c5e7b7
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
c5e7b7
%endif
c5e7b7
c5e7b7
%define talloc_version 2.1.2
c5e7b7
%define tdb_version 1.3.5
c5e7b7
%define tevent_version 0.9.24
c5e7b7
c5e7b7
Name: libldb
51bd00
Version: 1.3.4
c5e7b7
Release: 1%{?dist}
c5e7b7
Group: Development/Libraries
c5e7b7
Summary: A schema-less, ldap like, API and database
c5e7b7
Requires: libtalloc%{?_isa} >= %{talloc_version}
c5e7b7
Requires: libtdb%{?_isa} >= %{tdb_version}
c5e7b7
Requires: libtevent%{?_isa} >= %{tevent_version}
c5e7b7
License: LGPLv3+
c5e7b7
URL: http://ldb.samba.org/
c5e7b7
Source: http://samba.org/ftp/ldb/ldb-%{version}.tar.gz
c5e7b7
c5e7b7
BuildRequires: libtalloc-devel >= %{talloc_version}
c5e7b7
BuildRequires: libtdb-devel >= %{tdb_version}
c5e7b7
BuildRequires: libtevent-devel >= %{tevent_version}
c5e7b7
%{?fedora:BuildRequires: popt-devel}
c5e7b7
%if 0%{?rhel} <= 5
c5e7b7
BuildRequires: popt
c5e7b7
%endif
c5e7b7
%if 0%{?rhel} >= 6
c5e7b7
BuildRequires: popt-devel
c5e7b7
%endif
c5e7b7
BuildRequires: autoconf
c5e7b7
BuildRequires: libxslt
c5e7b7
BuildRequires: docbook-style-xsl
c5e7b7
BuildRequires: python-devel
c5e7b7
BuildRequires: python-tdb
c5e7b7
BuildRequires: pytalloc-devel
c5e7b7
BuildRequires: python-tevent
c5e7b7
BuildRequires: doxygen
c5e7b7
c5e7b7
Provides: bundled(libreplace)
c5e7b7
Provides: bundled(libtdb_compat)
c5e7b7
c5e7b7
# Patches
c5e7b7
c5e7b7
%description
c5e7b7
An extensible library that implements an LDAP like API to access remote LDAP
c5e7b7
servers, or use local tdb databases.
c5e7b7
c5e7b7
%package -n ldb-tools
c5e7b7
Group: Development/Libraries
c5e7b7
Summary: Tools to manage LDB files
c5e7b7
Requires: libldb%{?_isa} = %{version}-%{release}
c5e7b7
c5e7b7
%description -n ldb-tools
c5e7b7
Tools to manage LDB files
c5e7b7
c5e7b7
%package devel
c5e7b7
Group: Development/Libraries
c5e7b7
Summary: Developer tools for the LDB library
c5e7b7
Requires: libldb%{?_isa} = %{version}-%{release}
c5e7b7
Requires: libtdb-devel%{?_isa} >= %{tdb_version}
c5e7b7
Requires: libtalloc-devel%{?_isa} >= %{talloc_version}
c5e7b7
Requires: libtevent-devel%{?_isa} >= %{tevent_version}
c5e7b7
Requires: pkgconfig
c5e7b7
c5e7b7
%description devel
c5e7b7
Header files needed to develop programs that link against the LDB library.
c5e7b7
c5e7b7
%package -n pyldb
c5e7b7
Group: Development/Libraries
c5e7b7
Summary: Python bindings for the LDB library
c5e7b7
Requires: libldb%{?_isa} = %{version}-%{release}
c5e7b7
Requires: python-tdb%{?_isa} >= %{tdb_version}
c5e7b7
c5e7b7
%description -n pyldb
c5e7b7
Python bindings for the LDB library
c5e7b7
c5e7b7
%package -n pyldb-devel
c5e7b7
Group: Development/Libraries
c5e7b7
Summary: Development files for the Python bindings for the LDB library
c5e7b7
Requires: pyldb%{?_isa} = %{version}-%{release}
c5e7b7
c5e7b7
%description -n pyldb-devel
c5e7b7
Development files for the Python bindings for the LDB library
c5e7b7
c5e7b7
%prep
c5e7b7
%setup -q -n ldb-%{version}
c5e7b7
c5e7b7
%build
c5e7b7
c5e7b7
%configure --disable-rpath \
c5e7b7
           --disable-rpath-install \
c5e7b7
           --bundled-libraries=cmocka \
c5e7b7
           --builtin-libraries=replace \
c5e7b7
           --with-modulesdir=%{_libdir}/ldb/modules \
c5e7b7
           --with-privatelibdir=%{_libdir}/ldb
c5e7b7
c5e7b7
# Don't build with multiple processors
c5e7b7
# It breaks due to a threading issue in WAF
c5e7b7
make V=1
c5e7b7
doxygen Doxyfile
c5e7b7
c5e7b7
%install
c5e7b7
make install DESTDIR=%{buildroot}
c5e7b7
c5e7b7
rm -f %{buildroot}%{_libdir}/libldb.a
c5e7b7
rm -f %{buildroot}%{_libdir}/ldb/libcmocka-ldb.so
c5e7b7
c5e7b7
# Shared libraries need to be marked executable for
c5e7b7
# rpmbuild to strip them and include them in debuginfo
c5e7b7
find $RPM_BUILD_ROOT -name "*.so*" -exec chmod -c +x {} \;
c5e7b7
c5e7b7
# Install API docs
c5e7b7
cp -a apidocs/man/* $RPM_BUILD_ROOT/%{_mandir}
c5e7b7
c5e7b7
# LDB 1.1.8+ bug: remove manpage named after full
c5e7b7
# file path
c5e7b7
rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/_*
c5e7b7
c5e7b7
%clean
c5e7b7
rm -rf %{buildroot}
c5e7b7
c5e7b7
%post -p /sbin/ldconfig
c5e7b7
c5e7b7
%postun -p /sbin/ldconfig
c5e7b7
c5e7b7
%files
c5e7b7
%defattr(-,root,root,-)
c5e7b7
%dir %{_libdir}/ldb
c5e7b7
%{_libdir}/libldb.so.*
c5e7b7
%dir %{_libdir}/ldb/modules
c5e7b7
%dir %{_libdir}/ldb/modules/ldb
c5e7b7
%{_libdir}/ldb/modules/ldb/*.so
c5e7b7
c5e7b7
%files -n ldb-tools
c5e7b7
%defattr(-,root,root,-)
c5e7b7
%{_bindir}/ldbadd
c5e7b7
%{_bindir}/ldbdel
c5e7b7
%{_bindir}/ldbedit
c5e7b7
%{_bindir}/ldbmodify
c5e7b7
%{_bindir}/ldbrename
c5e7b7
%{_bindir}/ldbsearch
c5e7b7
%{_libdir}/ldb/libldb-cmdline.so
c5e7b7
%{_mandir}/man1/ldbadd.1.*
c5e7b7
%{_mandir}/man1/ldbdel.1.*
c5e7b7
%{_mandir}/man1/ldbedit.1.*
c5e7b7
%{_mandir}/man1/ldbmodify.1.*
c5e7b7
%{_mandir}/man1/ldbrename.1.*
c5e7b7
%{_mandir}/man1/ldbsearch.1.*
c5e7b7
c5e7b7
%files devel
c5e7b7
%defattr(-,root,root,-)
c5e7b7
%{_includedir}/ldb_module.h
c5e7b7
%{_includedir}/ldb_handlers.h
c5e7b7
%{_includedir}/ldb_errors.h
c5e7b7
%{_includedir}/ldb_version.h
c5e7b7
%{_includedir}/ldb.h
c5e7b7
%{_libdir}/libldb.so
c5e7b7
c5e7b7
%{_libdir}/pkgconfig/ldb.pc
c5e7b7
%{_mandir}/man3/ldb*.gz
c5e7b7
%{_mandir}/man3/ldif*.gz
c5e7b7
c5e7b7
%files -n pyldb
c5e7b7
%defattr(-,root,root,-)
c5e7b7
%{python_sitearch}/ldb.so
c5e7b7
%{_libdir}/libpyldb-util.so.1*
c5e7b7
%{python_sitearch}/_ldb_text.py*
c5e7b7
c5e7b7
%files -n pyldb-devel
c5e7b7
%defattr(-,root,root,-)
c5e7b7
%{_includedir}/pyldb.h
c5e7b7
%{_libdir}/libpyldb-util.so
c5e7b7
%{_libdir}/pkgconfig/pyldb-util.pc
c5e7b7
%{_mandir}/man*/Py*.gz
c5e7b7
c5e7b7
%post -n pyldb -p /sbin/ldconfig
c5e7b7
%postun -n pyldb -p /sbin/ldconfig
c5e7b7
c5e7b7
%changelog
51bd00
* Wed Jun 27 2018 Jakub Hrozek <jhrozek@redhat.com> - 1.3.4-1
51bd00
- Resolves: rhbz#1558497 - Rebase libldb to enable samba rebase
51bd00
51bd00
* Thu May  3 2018 Jakub Hrozek <jhrozek@redhat.com> - 1.3.3-1
51bd00
- Resolves: rhbz#1558497 - Rebase libldb to enable samba rebase
51bd00
51bd00
* Tue Apr 10 2018 Jakub Hrozek <jhrozek@redhat.com> - 1.3.2-1
51bd00
- Resolves: rhbz#1558497 - Rebase libldb to enable samba rebase
51bd00
c5e7b7
* Sun Oct 15 2017 Jakub Hrozek <jhrozek@redhat.com> - 1.2.2-1
c5e7b7
- Resolves: rhbz#1470056 - Rebase libldb to enable samba rebase to
c5e7b7
                           version 4.7.x
c5e7b7
c5e7b7
* Tue Feb 14 2017 Jakub Hrozek <jhrozek@redhat.com> - 1.1.29-1
c5e7b7
- Resolves: rhbz#1393810 - Rebase libldb to enable samba rebase to
c5e7b7
                           version 4.6.x
c5e7b7
c5e7b7
* Thu Jun  9 2016 Jakub Hrozek <jhrozek@redhat.com> - 1.1.26-1
c5e7b7
- Resolves: rhbz#1320253 - Rebase libldb to version 1.1.26
c5e7b7
c5e7b7
* Fri Apr  1 2016 Jakub Hrozek <jhrozek@redhat.com> - 1.1.25-1
c5e7b7
- Rebase libldb to 1.1.25
c5e7b7
- Remove upstreamed patches
c5e7b7
- Related: rhbz#1322691
c5e7b7
c5e7b7
* Mon Dec 14 2015 Jakub Hrozek <jhrozek@redhat.com> - 1.1.20-3
c5e7b7
- Resolves: rhbz#1290715 - CVE-2015-5330 libldb: samba: Remote memory read
c5e7b7
                           in Samba LDAP server [rhel-7.3]
c5e7b7
- Remove the patch from the previous commit, it doesn't fix a remotely
c5e7b7
  eploitable issue. Add patches from upstream #11636 instead.
c5e7b7
c5e7b7
* Mon Dec 14 2015 Jakub Hrozek <jhrozek@redhat.com> - 1.1.20-2
c5e7b7
- Resolves: rhbz#1290715 - CVE-2015-5330 libldb: samba: Remote memory read
c5e7b7
                           in Samba LDAP server [rhel-7.3]
c5e7b7
c5e7b7
* Wed Jun  3 2015 Jakub Hrozek <jhrozek@redhat.com> - 1.1.20-1
c5e7b7
- Related: rhbz#1226047 - Rebase libldb to at least 1.1.20 in RHEL-7.2
c5e7b7
c5e7b7
* Mon Nov 24 2014 Jakub Hrozek <jhrozek@redhat.com> - 1.1.17-2
c5e7b7
- Fix the minimal required tdb version
c5e7b7
- Related: rhbz#1133914 - Rebase libldb to version 1.1.17 or newer
c5e7b7
c5e7b7
* Thu Sep 04 2014 Jakub Hrozek <jhrozek@redhat.com> - 1.1.17-1
c5e7b7
- New upstream release 1.1.17
c5e7b7
- Resolves: rhbz#1133914 - Rebase libldb to version 1.1.17 or newer
c5e7b7
c5e7b7
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 1.1.16-4
c5e7b7
- Mass rebuild 2014-01-24
c5e7b7
c5e7b7
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.1.16-3
c5e7b7
- Mass rebuild 2013-12-27
c5e7b7
c5e7b7
* Mon Jul 08 2013 Jakub Hrozek <jhrozek@redhat.com> - 1.1.16-2
c5e7b7
- Make the Requires arch-specific
c5e7b7
c5e7b7
* Tue Jul 02 2013 - Andreas Schneider <asn@redhat.com> - 1.1.16-1
c5e7b7
- New upstream release 1.1.16
c5e7b7
c5e7b7
* Wed Jun 05 2013 Jakub Hrozek <jhrozek@redhat.com> - 1.1.15-3
c5e7b7
- Relax pytdb requirement
c5e7b7
c5e7b7
* Thu Feb 07 2013 Jakub Hrozek <jhrozek@redhat.com> - 1.1.15-2
c5e7b7
- The 1.1.15 rebase obsoletes the patch from 1.1.14-2
c5e7b7
c5e7b7
* Thu Feb 07 2013 Jakub Hrozek <jhrozek@redhat.com> - 1.1.15-1
c5e7b7
- New upstream release 1.1.15
c5e7b7
c5e7b7
* Wed Jan 30 2013 Jakub Hrozek <jhrozek@redhat.com> - 1.1.14-2
c5e7b7
- Add patch by Stephen Gallagher to include manual pages for
c5e7b7
  ldb_connect() and several other functions.
c5e7b7
c5e7b7
* Sat Dec 01 2012 Jakub Hrozek <jhrozek@redhat.com> - 1.1.14-1
c5e7b7
- New upstream release 1.1.14
c5e7b7
c5e7b7
* Wed Oct 03 2012 Jakub Hrozek <jhrozek@redhat.com> - 1.1.13-1
c5e7b7
- New upstream release 1.1.13
c5e7b7
c5e7b7
* Mon Sep 03 2012 Jakub Hrozek <jhrozek@redhat.com> - 1.1.12-1
c5e7b7
- New upstream release 1.1.12
c5e7b7
c5e7b7
* Tue Aug 28 2012 Jakub Hrozek <jhrozek@redhat.com> - 1.1.11-1
c5e7b7
- New upstream release 1.1.11
c5e7b7
c5e7b7
* Mon Aug 10 2012 Jakub Hrozek <jhrozek@redhat.com> - 1.1.10-1
c5e7b7
- New upstream release 1.1.10
c5e7b7
c5e7b7
* Thu Aug 02 2012 Stephen Gallagher <sgallagh@redhat.com> - 1.1.9-1
c5e7b7
- New upstream release 1.1.9
c5e7b7
- Required for Samba 4 Beta 5
c5e7b7
- Ensure rename target does not exist before deleting old record
c5e7b7
- Add parameter to avoid NULL format string flagged by -Werror=format
c5e7b7
c5e7b7
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.8-2
c5e7b7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
c5e7b7
c5e7b7
* Tue Jul 10 2012 Stephen Gallagher <sgallagh@redhat.com> - 1.1.8-1
c5e7b7
- New upstream release 1.1.8
c5e7b7
- Required for latest Samba 4 beta
c5e7b7
- Fixes for pyldb
c5e7b7
- Revert to using tdb1 by default
c5e7b7
- Drop support for tdb_compat
c5e7b7
- CCAN is no longer built as a static library
c5e7b7
c5e7b7
* Tue May 22 2012 Stephen Gallagher <sgallagh@redhat.com> - 1.1.6-1
c5e7b7
- New upstream release 1.1.6
c5e7b7
- Drop upstream patches
c5e7b7
- Required for upcoming Samba 4 beta
c5e7b7
- Explicitly build with tdb1 support
c5e7b7
c5e7b7
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.4-2
c5e7b7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
c5e7b7
c5e7b7
* Fri Dec 09 2011 Stephen Gallagher <sgallagh@redhat.com> - 1.1.4-1.1
c5e7b7
- Do not build with multiple CPUs
c5e7b7
c5e7b7
* Tue Dec 06 2011 Stephen Gallagher <sgallagh@redhat.com> - 1.1.4-1
c5e7b7
- New upstream release
c5e7b7
- Add ldb_module_error() routine
c5e7b7
- Fedora: work around unreliable configure check for pytevent
c5e7b7
- Drop patch to ignore --disable-silent-rules (included in tarball)
c5e7b7
c5e7b7
* Thu Dec 01 2011 Stephen Gallagher <sgallagh@redhat.com> - 1.1.3-4
c5e7b7
- Add patch to ignore --disable-silent-rules
c5e7b7
c5e7b7
* Wed Nov 23 2011 Stephen Gallagher <sgallagh@redhat.com> - 1.1.3-3
c5e7b7
- Add explicit mention of the bundled libreplace
c5e7b7
- https://fedorahosted.org/fpc/ticket/120
c5e7b7
- Add explicit mention of bundled libtdb_compat and libccan
c5e7b7
- https://fedorahosted.org/fpc/ticket/119
c5e7b7
c5e7b7
* Mon Nov 21 2011 Stephen Gallagher <sgallagh@redhat.com> - 1.1.3-2
c5e7b7
- Build and install API documentation
c5e7b7
- Build tdb_compat and ccan statically. They have no upstream releases to
c5e7b7
  link against yet and their API is in flux. It is unsafe to make them
c5e7b7
  public and shared at this time.
c5e7b7
c5e7b7
* Wed Nov 09 2011 Stephen Gallagher <sgallagh@redhat.com> - 1.1.3-1
c5e7b7
- New upstream release
c5e7b7
- Required for building newer samba4 packages
c5e7b7
c5e7b7
* Tue Aug  2 2011 Simo Sorce <ssorce@redhat.com> - 1.1.0-1
c5e7b7
- Update to 1.1.0
c5e7b7
  (dependency for samba4 alpha16 snapshot)
c5e7b7
c5e7b7
* Tue Feb 22 2011 Simo Sorce <ssorce@redhat.com> - 1.0.2-1
c5e7b7
- Update to 1.0.2
c5e7b7
  (dependency for samba4 alpha15 snapshot)
c5e7b7
c5e7b7
* Fri Feb 11 2011 Stephen Gallagher <sgallagh@redhat.com> - 1.0.0-2
c5e7b7
- Disable rpath
c5e7b7
c5e7b7
* Fri Feb 11 2011 Stephen Gallagher <sgallagh@redhat.com> - 1.0.0-1
c5e7b7
- New upstream release 1.0.0
c5e7b7
- SOname bump to account for module loading changes
c5e7b7
- Rename libldb-tools to ldb-tools to make upgrades easier
c5e7b7
c5e7b7
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.22-9
c5e7b7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
c5e7b7
c5e7b7
* Fri Feb 04 2011 Stephen Gallagher <sgallagh@redhat.com> - 0.9.22-8
c5e7b7
- Fixes from package review
c5e7b7
- Change Requires: on tools subpackage to be the exact version/release
c5e7b7
- Remove unnecessary BuildRoot directive
c5e7b7
c5e7b7
* Mon Jan 17 2011 Stephen Gallagher <sgallagh@redhat.com> - 0.9.22-7
c5e7b7
- Update to 0.9.22 (first independent release of libldb upstream)
c5e7b7