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
4c16553
%define tevent_version 0.9.10
4c16553
4c16553
Name: libldb
4c16553
Version: 0.9.22
4c16553
Release: 8%{?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}
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
Patch0001: 0001-Install-python-bindings-in-the-arch-specific-locatio.patch
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
4c16553
%package tools
4c16553
Group: Development/Libraries
4c16553
Summary: Tools to manage LDB files
4c16553
Requires: libldb = %{version}-%{release}
4c16553
4c16553
%description 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
%patch0001 -p1
4c16553
4c16553
%build
4c16553
./autogen.sh
4c16553
%configure --disable-rpath \
4c16553
           --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.*
4c16553
%{_libdir}/ldb/modules/ldb/*.so
4c16553
4c16553
%files tools
4c16553
%defattr(-,root,root,-)
4c16553
%{_bindir}/ldbadd
4c16553
%{_bindir}/ldbdel
4c16553
%{_bindir}/ldbedit
4c16553
%{_bindir}/ldbmodify
4c16553
%{_bindir}/ldbrename
4c16553
%{_bindir}/ldbsearch
4c16553
%{_libdir}/ldb/libldb-cmdline-ldb.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
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
4c16553
%{_libdir}/libpyldb-util.so.*
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
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