diff --git a/libldb.spec b/libldb.spec index 1cf487598c8b080814793286e23ca374566790d0..27f684920fe1c80faa82159318ec114011ed685a 100644 --- a/libldb.spec +++ b/libldb.spec @@ -1,79 +1,66 @@ -%define anolis_release 1 -%ifarch aarch64 x86_64 -%bcond_without lmdb -%else -%bcond_with lmdb -#endif arch -%endif +%define anolis_release 2 -%bcond_with lmdb +%bcond_without lmdb %bcond_without python3 -%global talloc_version 2.3.3 %global tdb_version 1.4.8 %global tevent_version 0.14.1 +%global talloc_version 2.3.3 -Name: libldb -Version: 2.7.2 -Release: %{anolis_release}%{?dist} -Summary: A schema-less, ldap like, API and database -Requires: libtalloc >= %{talloc_version} -Requires: libtdb >= %{tdb_version} -Requires: libtevent >= %{tevent_version} -License: LGPLv3+ -URL: http://ldb.samba.org/ -Source0: https://www.samba.org/ftp/ldb/ldb-%{version}.tar.gz - -BuildRequires: gcc -BuildRequires: libtalloc-devel >= %{talloc_version} -BuildRequires: libtdb-devel >= %{tdb_version} -BuildRequires: libtevent-devel >= %{tevent_version} -%if %{with lmdb} -BuildRequires: lmdb-devel >= 0.9.16 -%endif -BuildRequires: popt-devel -BuildRequires: libxslt -BuildRequires: docbook-style-xsl +Name: libldb +Version: 2.7.2 +Release: %{anolis_release}%{?dist} +License: LGPLv3+ +Summary: LDAP-like embedded database +URL: http://ldb.samba.org/ +Source0: https://www.samba.org/ftp/ldb/ldb-%{version}.tar.gz + +BuildRequires: make gcc gnupg2 +BuildRequires: docbook-style-xsl libxslt doxygen pkgconfig(popt) +BuildRequires: pkgconfig(talloc) >= %{talloc_version} pkgconfig(tdb) >= %{tdb_version} +BuildRequires: pkgconfig(ldap) pkgconfig(cmocka) pkgconfig(tevent) >= %{tevent_version} %if %{with python3} -BuildRequires: python3-devel -BuildRequires: python3-tdb -BuildRequires: python3-talloc-devel -BuildRequires: python3-tevent -#endif with python +BuildRequires: python3-tevent pkgconfig(python3) python3-talloc-devel python3-tdb +%endif +%if %{with lmdb} +BuildRequires: pkgconfig(lmdb) >= 0.9.16 %endif -BuildRequires: doxygen -BuildRequires: openldap-devel -BuildRequires: libcmocka-devel -BuildRequires: gnupg2 -BuildRequires: make -Provides: bundled(libreplace) +Requires: libtdb >= %{tdb_version} libtevent >= %{tevent_version} libtalloc >= %{talloc_version} + +Obsoletes: pyldb < 1.1.26-2 Obsoletes: python2-ldb < 2.0.5-1 Obsoletes: python2-ldb-devel < 2.0.5-1 -Obsoletes: pyldb < 1.1.26-2 - +Provides: bundled(libreplace) %description -An extensible library that implements an LDAP like API to access remote LDAP -servers, or use local tdb databases. +ldb is a LDAP-like embedded database. It is not at all LDAP standards compliant, +so if you want a standards compliant database then please see the excellent OpenLDAP project. -%package -n ldb-tools -Summary: Tools to manage LDB files -Requires: libldb = %{version}-%{release} +What ldb does is provide a fast database with an LDAP-like API designed to be used within an +application. In some ways it can be seen as a intermediate solution between key-value pair +databases and a real LDAP database. -%description -n ldb-tools -Tools to manage LDB files +ldb is the database engine used in Samba4. %package devel Summary: Developer tools for the LDB library -Requires: libldb = %{version}-%{release} -Requires: libtdb-devel >= %{tdb_version} -Requires: libtalloc-devel >= %{talloc_version} -Requires: libtevent-devel >= %{tevent_version} +Requires: pkgconfig(tevent) >= %{tevent_version} %{name} = %{version}-%{release} +Requires: pkgconfig(tdb) >= %{tdb_version} pkgconfig(talloc) >= %{talloc_version} %description devel Header files needed to develop programs that link against the LDB library. +%package -n ldb-tools +Summary: Tools to manage LDB files +Requires: %{name} = %{version}-%{release} + +%description -n ldb-tools +A package that contains utilities for working with ldb, an LDAP-like embedded +database built on top of TDB. It provides a fast database with an LDAP-like +API designed to be used within an application. In some ways it can be seen as +an intermediate solution between key-value pair databases and a real LDAP database + %package -n python-ldb-devel-common Summary: Common development files for the Python bindings for the LDB library @@ -82,12 +69,12 @@ Provides: pyldb-devel = %{version}-%{release} %description -n python-ldb-devel-common Development files for the Python bindings for the LDB library. -This package includes files that aren't specific to a Python version. +This package includes files that aren't specific to a Python version'. %if %{with python3} %package -n python3-ldb Summary: Python bindings for the LDB library -Requires: libldb = %{version}-%{release} +Requires: %{name} = %{version}-%{release} Requires: python3-tdb >= %{tdb_version} %{?python_provide:%python_provide python3-ldb} @@ -97,22 +84,28 @@ Python bindings for the LDB library %package -n python3-ldb-devel Summary: Development files for the Python bindings for the LDB library -Requires: python3-ldb = %{version}-%{release} Requires: python-ldb-devel-common = %{version}-%{release} +Requires: python3-ldb = %{version}-%{release} %{?python_provide:%python_provide python3-ldb-devel} %description -n python3-ldb-devel Development files for the Python bindings for the LDB library -#endif with python %endif +%package doc +Summary: Documentation files for %{name} +Requires: %{name} = %{EVR} +BuildArch: noarch + +%description doc +The %{name}-doc package contains documentation files for %{name}. + %prep -%autosetup -n ldb-%{version} -p1 +%autosetup -p1 -n ldb-%{version} %build export python_LDFLAGS="" - %configure --disable-rpath \ --disable-rpath-install \ --bundled-libraries=NONE \ @@ -126,21 +119,17 @@ export python_LDFLAGS="" %make_build doxygen Doxyfile -%if %{with lmdb} %check +%if %{with lmdb} %make_build check -#endif with lmdb %endif %install %make_install # Install API docs -cp -a apidocs/man/* $RPM_BUILD_ROOT/%{_mandir} - -# bug: remove manpage named after full file path -# not needed with el8+ and fc28+ -rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/_* +cp -a apidocs/man/* %{buildroot}/%{_mandir} +rm -f %{buildroot}/%{_mandir}/man3/_* %generate_compatibility_deps @@ -155,24 +144,34 @@ rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/_* %{abidir}/libldb-key-value.dump %{abidir}/libldb-tdb-err-map.dump %{abidir}/libldb-tdb-int.dump +%if %{with lmdb} +%{_libdir}/ldb/libldb-mdb-int.so +%{abidir}/libldb-mdb-int.dump +%endif +%dir %{_libdir}/ldb/modules +%dir %{_libdir}/ldb/modules/ldb +%{_libdir}/ldb/modules/ldb/*.so +%{abidir}/mdb.dump %{abidir}/asq.dump %{abidir}/ldap.dump %{abidir}/ldb.dump -%{abidir}/libldb-cmdline.dump -%{abidir}/mdb.dump %{abidir}/paged_searches.dump %{abidir}/rdn_name.dump %{abidir}/sample.dump %{abidir}/server_sort.dump %{abidir}/skel.dump %{abidir}/tdb.dump -%if %{with lmdb} -%{_libdir}/ldb/libldb-mdb-int.so -%{abidir}/libldb-mdb-int.dump -%endif -%dir %{_libdir}/ldb/modules -%dir %{_libdir}/ldb/modules/ldb -%{_libdir}/ldb/modules/ldb/*.so + +%files devel +%{_includedir}/ldb_module.h +%{_includedir}/ldb_handlers.h +%{_includedir}/ldb_errors.h +%{_includedir}/ldb_version.h +%{_includedir}/ldb.h +%{_libdir}/libldb.so +%{_libdir}/pkgconfig/ldb.pc +%{_mandir}/man3/ldb* +%{_mandir}/man3/ldif* %files -n ldb-tools %{_bindir}/ldbadd @@ -182,6 +181,7 @@ rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/_* %{_bindir}/ldbrename %{_bindir}/ldbsearch %{_libdir}/ldb/libldb-cmdline.so +%{abidir}/libldb-cmdline.dump %{_mandir}/man1/ldbadd.1.* %{_mandir}/man1/ldbdel.1.* %{_mandir}/man1/ldbedit.1.* @@ -189,18 +189,6 @@ rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/_* %{_mandir}/man1/ldbrename.1.* %{_mandir}/man1/ldbsearch.1.* -%files devel -%{_includedir}/ldb_module.h -%{_includedir}/ldb_handlers.h -%{_includedir}/ldb_errors.h -%{_includedir}/ldb_version.h -%{_includedir}/ldb.h -%{_libdir}/libldb.so - -%{_libdir}/pkgconfig/ldb.pc -%{_mandir}/man3/ldb* -%{_mandir}/man3/ldif* - %files -n python-ldb-devel-common %{_includedir}/pyldb.h %{_mandir}/man*/Py* @@ -217,11 +205,15 @@ rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/_* %files -n python3-ldb-devel %{_libdir}/libpyldb-util.cpython-*.so %{_libdir}/pkgconfig/pyldb-util.cpython-*.pc - -#endif with python %endif +%files doc +%doc README_gcov.txt + %changelog +* Thu Apr 13 2023 yuanhui - 2.7.2-2 +- Optimize the spec file + * Thu Mar 30 2023 Funda Wang - 2.7.2-1 - New version 2.7.2