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