diff --git a/ldb-2.5.0.tar.gz b/ldb-2.5.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..671c3c4191e3bf63d2200a6d913153b768af65ac Binary files /dev/null and b/ldb-2.5.0.tar.gz differ diff --git a/libldb.spec b/libldb.spec new file mode 100644 index 0000000000000000000000000000000000000000..5b0650ea52a90eb9c601fa92325a219ccd988b3b --- /dev/null +++ b/libldb.spec @@ -0,0 +1,210 @@ +%define anolis_release 1 +%ifarch aarch64 x86_64 +%bcond_without lmdb +%else +%bcond_with lmdb +#endif arch +%endif + +%bcond_with lmdb +%bcond_without python3 + +%global talloc_version 2.3.3 +%global tdb_version 1.4.6 +%global tevent_version 0.11.0 + +Name: libldb +Version: 2.5.0 +Release: 1%{anolis_release}%{?dist} +Summary: A schema-less, ldap like, API and database +Requires: libtalloc%{?_isa} >= %{talloc_version} +Requires: libtdb%{?_isa} >= %{tdb_version} +Requires: libtevent%{?_isa} >= %{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 +%if %{with python3} +BuildRequires: python3-devel +BuildRequires: python3-tdb +BuildRequires: python3-talloc-devel +BuildRequires: python3-tevent +#endif with python +%endif +BuildRequires: doxygen +BuildRequires: openldap-devel +BuildRequires: libcmocka-devel +BuildRequires: gnupg2 +BuildRequires: make + +Provides: bundled(libreplace) +Obsoletes: python2-ldb < 2.0.5-1 +Obsoletes: python2-ldb-devel < 2.0.5-1 +Obsoletes: pyldb < 1.1.26-2 + + +%description +An extensible library that implements an LDAP like API to access remote LDAP +servers, or use local tdb databases. + +%package -n ldb-tools +Summary: Tools to manage LDB files +Requires: libldb%{?_isa} = %{version}-%{release} + +%description -n ldb-tools +Tools to manage LDB files + +%package devel +Summary: Developer tools for the LDB library +Requires: libldb%{?_isa} = %{version}-%{release} +Requires: libtdb-devel%{?_isa} >= %{tdb_version} +Requires: libtalloc-devel%{?_isa} >= %{talloc_version} +Requires: libtevent-devel%{?_isa} >= %{tevent_version} + +%description devel +Header files needed to develop programs that link against the LDB library. + +%package -n python-ldb-devel-common +Summary: Common development files for the Python bindings for the LDB library + +Provides: pyldb-devel%{?_isa} = %{version}-%{release} +%{?python_provide:%python_provide python2-ldb-devel} + +%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. + +%if %{with python3} +%package -n python3-ldb +Summary: Python bindings for the LDB library +Requires: libldb%{?_isa} = %{version}-%{release} +Requires: python3-tdb%{?_isa} >= %{tdb_version} + +%{?python_provide:%python_provide python3-ldb} + +%description -n python3-ldb +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%{?_isa} = %{version}-%{release} +Requires: python-ldb-devel-common%{?_isa} = %{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 + +%prep +%autosetup -n ldb-%{version} -p1 + +%build +# workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1217376 +export python_LDFLAGS="" + +%configure --disable-rpath \ + --disable-rpath-install \ + --bundled-libraries=NONE \ + --builtin-libraries=replace \ + --with-modulesdir=%{_libdir}/ldb/modules \ +%if %{without lmdb} + --without-ldb-lmdb \ +%endif + --with-privatelibdir=%{_libdir}/ldb + +%make_build +doxygen Doxyfile + +%if %{with lmdb} +%check +make %{?_smp_mflags} 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/_* + +%ldconfig_scriptlets + +%files +%dir %{_libdir}/ldb +%{_libdir}/libldb.so.* +%{_libdir}/ldb/libldb-key-value.so +%{_libdir}/ldb/libldb-tdb-err-map.so +%{_libdir}/ldb/libldb-tdb-int.so +%if %{with lmdb} +%{_libdir}/ldb/libldb-mdb-int.so +%endif +%dir %{_libdir}/ldb/modules +%dir %{_libdir}/ldb/modules/ldb +%{_libdir}/ldb/modules/ldb/*.so + +%files -n ldb-tools +%{_bindir}/ldbadd +%{_bindir}/ldbdel +%{_bindir}/ldbedit +%{_bindir}/ldbmodify +%{_bindir}/ldbrename +%{_bindir}/ldbsearch +%{_libdir}/ldb/libldb-cmdline.so +%{_mandir}/man1/ldbadd.1.* +%{_mandir}/man1/ldbdel.1.* +%{_mandir}/man1/ldbedit.1.* +%{_mandir}/man1/ldbmodify.1.* +%{_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*.gz +%{_mandir}/man3/ldif*.gz + +%files -n python-ldb-devel-common +%{_includedir}/pyldb.h +%{_mandir}/man*/Py*.gz + +%if %{with python3} +%files -n python3-ldb +%{python3_sitearch}/ldb.cpython-*.so +%{_libdir}/libpyldb-util.cpython-*.so.2* +%{python3_sitearch}/_ldb_text.py +%{python3_sitearch}/__pycache__/_ldb_text.cpython-*.py* + +%files -n python3-ldb-devel +%{_libdir}/libpyldb-util.cpython-*.so +%{_libdir}/pkgconfig/pyldb-util.cpython-*.pc + +%ldconfig_scriptlets -n python3-ldb +#endif with python +%endif + +%changelog +* Wed Mar 09 2022 pangqing - 2.5.0-1 +- Init for anolisOS 23 +