diff --git a/.gitignore b/.gitignore index 9c21291..a041f4d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/ldb-1.4.2.tar.gz +SOURCES/ldb-1.5.4.tar.gz diff --git a/.libldb.metadata b/.libldb.metadata index 5d44ee3..33655e6 100644 --- a/.libldb.metadata +++ b/.libldb.metadata @@ -1 +1 @@ -2114b2fd5b350aa6b30a8fe752f6627122086839 SOURCES/ldb-1.4.2.tar.gz +870e4112053ae350f5de27b00aa8703d3e7dc34d SOURCES/ldb-1.5.4.tar.gz diff --git a/SOURCES/0002-ldb-Run-at-least-some-tests-on-32-bit-machines.patch b/SOURCES/0002-ldb-Run-at-least-some-tests-on-32-bit-machines.patch deleted file mode 100644 index ef18d36..0000000 --- a/SOURCES/0002-ldb-Run-at-least-some-tests-on-32-bit-machines.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 04e74153057d34b5dbdbc03f47d7684b4d4c1093 Mon Sep 17 00:00:00 2001 -From: Lukas Slebodnik -Date: Wed, 30 May 2018 23:22:40 +0200 -Subject: [PATCH] ldb: Run at least some tests on 32 bit machines - -lmdb is supported only on 64 bit machines. But there also -unit tests which pass just with tdb on 32 bit architectures. - -Signed-off-by: Lukas Slebodnik ---- - lib/ldb/wscript | 19 +++++++++++-------- - 1 file changed, 11 insertions(+), 8 deletions(-) - -diff --git a/lib/ldb/wscript b/lib/ldb/wscript -index f5cb1e0ab28dc01e5b031c7c290bed26c7007676..03279772557284d96f5b8c81ed4a8513e5c65f17 100644 ---- a/lib/ldb/wscript -+++ b/lib/ldb/wscript -@@ -518,10 +518,6 @@ def test(ctx): - env = samba_utils.LOAD_ENVIRONMENT() - ctx.env = env - -- if not env.HAVE_LMDB: -- raise Utils.WafError('make test called, but ldb was built ' -- '--without-ldb-lmdb') -- - test_prefix = "%s/st" % (Utils.g_module.blddir) - shutil.rmtree(test_prefix, ignore_errors=True) - os.makedirs(test_prefix) -@@ -537,9 +533,13 @@ def test(ctx): - tmp_dir = os.path.join(test_prefix, 'tmp') - if not os.path.exists(tmp_dir): - os.mkdir(tmp_dir) -- pyret = samba_utils.RUN_PYTHON_TESTS( -- ['tests/python/api.py', 'tests/python/index.py'], -- extra_env={'SELFTEST_PREFIX': test_prefix}) -+ -+ if env.HAVE_LMDB: -+ pyret = samba_utils.RUN_PYTHON_TESTS( -+ ['tests/python/api.py', 'tests/python/index.py'], -+ extra_env={'SELFTEST_PREFIX': test_prefix}) -+ else: -+ pyret = 0 - print("Python testsuite returned %d" % pyret) - - cmocka_ret = 0 -@@ -549,7 +549,10 @@ def test(ctx): - 'ldb_tdb_guid_mod_op_test', - 'ldb_msg_test', - 'ldb_tdb_kv_ops_test', -- 'ldb_tdb_test', -+ 'ldb_tdb_test'] -+ -+ if env.HAVE_LMDB: -+ test_exes += [ - 'ldb_mdb_mod_op_test', - 'ldb_lmdb_test', - # we don't want to run ldb_lmdb_size_test (which proves we can --- -2.17.0 - diff --git a/SOURCES/cmocka-relax-minimal-version.patch b/SOURCES/cmocka-relax-minimal-version.patch new file mode 100644 index 0000000..556ac90 --- /dev/null +++ b/SOURCES/cmocka-relax-minimal-version.patch @@ -0,0 +1,12 @@ +diff -up ldb-1.6.2/buildtools/wafsamba/samba_third_party.py.cmocka ldb-1.6.2/buildtools/wafsamba/samba_third_party.py +--- ldb-1.6.2/buildtools/wafsamba/samba_third_party.py.cmocka 2019-05-02 18:19:48.491709659 +0200 ++++ ldb-1.6.2/buildtools/wafsamba/samba_third_party.py 2019-05-02 18:20:03.703762725 +0200 +@@ -36,7 +36,7 @@ Build.BuildContext.CHECK_POPT = CHECK_PO + + @conf + def CHECK_CMOCKA(conf): +- return conf.CHECK_BUNDLED_SYSTEM_PKG('cmocka', minversion='1.1.3') ++ return conf.CHECK_BUNDLED_SYSTEM_PKG('cmocka', minversion='1.1.2') + + Build.BuildContext.CHECK_CMOCKA = CHECK_CMOCKA + diff --git a/SOURCES/fstack_flags.patch b/SOURCES/fstack_flags.patch deleted file mode 100644 index 93991ef..0000000 --- a/SOURCES/fstack_flags.patch +++ /dev/null @@ -1,117 +0,0 @@ -From 9673dcd70489c1c9df22aa0eb7a98afbccc0ced3 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Mon, 3 Sep 2018 10:35:08 +0200 -Subject: [PATCH 1/2] waf: Check for -fstack-protect-strong support - -The -fstack-protector* flags are compiler only flags, don't pass them to -the linker. - -https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/ - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13601 - -Signed-off-by: Andreas Schneider -Reviewed-by: Andrew Bartlett -(cherry picked from commit 38e97f8b52e85bdfcf2d74a4fb3c848fa46ba371) ---- - buildtools/wafsamba/samba_autoconf.py | 36 ++++++++++++++------------- - 1 file changed, 19 insertions(+), 17 deletions(-) - -diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py -index c4391d0c4dc..bfd6f9710db 100644 ---- a/buildtools/wafsamba/samba_autoconf.py -+++ b/buildtools/wafsamba/samba_autoconf.py -@@ -674,23 +674,25 @@ def SAMBA_CONFIG_H(conf, path=None): - return - - # we need to build real code that can't be optimized away to test -- if conf.check(fragment=''' -- #include -- -- int main(void) -- { -- char t[100000]; -- while (fgets(t, sizeof(t), stdin)); -- return 0; -- } -- ''', -- execute=0, -- ccflags='-fstack-protector', -- ldflags='-fstack-protector', -- mandatory=False, -- msg='Checking if toolchain accepts -fstack-protector'): -- conf.ADD_CFLAGS('-fstack-protector') -- conf.ADD_LDFLAGS('-fstack-protector') -+ stack_protect_list = ['-fstack-protector-strong', '-fstack-protector'] -+ for stack_protect_flag in stack_protect_list: -+ flag_supported = conf.check(fragment=''' -+ #include -+ -+ int main(void) -+ { -+ char t[100000]; -+ while (fgets(t, sizeof(t), stdin)); -+ return 0; -+ } -+ ''', -+ execute=0, -+ ccflags=[ '-Werror', '-Wp,-D_FORTIFY_SOURCE=2', stack_protect_flag], -+ mandatory=False, -+ msg='Checking if compiler accepts %s' % (stack_protect_flag)) -+ if flag_supported: -+ conf.ADD_CFLAGS('-Wp,-D_FORTIFY_SOURCE=2 %s' % (stack_protect_flag)) -+ break - - if Options.options.debug: - conf.ADD_CFLAGS('-g', testflags=True) --- -2.18.0 - - -From 5cfefc8d4c7fc4aba5b1dc2b7ea6f02c126d4070 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Mon, 3 Sep 2018 10:49:52 +0200 -Subject: [PATCH 2/2] waf: Add -fstack-clash-protection - -https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/ - -BUG: https://bugzilla.samba.org/show_bug.cgi?id=13601 - -Signed-off-by: Andreas Schneider -Reviewed-by: Andrew Bartlett -(cherry picked from commit fc4df251c88365142515a81bea1120b2b84cc4a0) ---- - buildtools/wafsamba/samba_autoconf.py | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) - -diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py -index bfd6f9710db..f2b3ec8db8d 100644 ---- a/buildtools/wafsamba/samba_autoconf.py -+++ b/buildtools/wafsamba/samba_autoconf.py -@@ -694,6 +694,23 @@ def SAMBA_CONFIG_H(conf, path=None): - conf.ADD_CFLAGS('-Wp,-D_FORTIFY_SOURCE=2 %s' % (stack_protect_flag)) - break - -+ flag_supported = conf.check(fragment=''' -+ #include -+ -+ int main(void) -+ { -+ char t[100000]; -+ while (fgets(t, sizeof(t), stdin)); -+ return 0; -+ } -+ ''', -+ execute=0, -+ ccflags=[ '-Werror', '-fstack-clash-protection'], -+ mandatory=False, -+ msg='Checking if compiler accepts -fstack-clash-protection') -+ if flag_supported: -+ conf.ADD_CFLAGS('-fstack-clash-protection') -+ - if Options.options.debug: - conf.ADD_CFLAGS('-g', testflags=True) - --- -2.18.0 - diff --git a/SPECS/libldb.spec b/SPECS/libldb.spec index e1b8175..7580a6c 100644 --- a/SPECS/libldb.spec +++ b/SPECS/libldb.spec @@ -1,19 +1,9 @@ -%{!?__python2: %global __python2 /usr/bin/python2} -%{!?python2_sitelib: %global python2_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} -%{!?python2_sitearch: %global python2_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} - -%if 0%{?fedora} || 0%{?rhel} > 7 -%global with_python3 1 -%else -%global with_python3 0 -%endif - -%global talloc_version 2.1.11 -%global tdb_version 1.3.14 -%global tevent_version 0.9.36 +%global talloc_version 2.1.16 +%global tdb_version 1.3.18 +%global tevent_version 0.9.39 Name: libldb -Version: 1.4.2 +Version: 1.5.4 Release: 2%{?dist} Summary: A schema-less, ldap like, API and database Requires: libtalloc%{?_isa} >= %{talloc_version} @@ -35,26 +25,23 @@ BuildRequires: lmdb-devel >= 0.9.16 BuildRequires: popt-devel BuildRequires: libxslt BuildRequires: docbook-style-xsl -BuildRequires: python2-devel -BuildRequires: python2-tdb -BuildRequires: python2-talloc-devel -BuildRequires: python2-tevent BuildRequires: doxygen BuildRequires: openldap-devel BuildRequires: libcmocka-devel Provides: bundled(libreplace) -%if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-tdb BuildRequires: python3-talloc-devel BuildRequires: python3-tevent -%endif + +Obsoletes: python2-ldb < %{version}-%{release} +Obsoletes: python2-ldb-devel < %{version}-%{release} +Obsoletes: python2-ldb-debuginfo < %{version}-%{release} # Patches -Patch0001: fstack_flags.patch -Patch0002: 0002-ldb-Run-at-least-some-tests-on-32-bit-machines.patch +Patch0001: cmocka-relax-minimal-version.patch %description An extensible library that implements an LDAP like API to access remote LDAP @@ -78,44 +65,6 @@ Requires: pkgconfig %description devel Header files needed to develop programs that link against the LDB library. -%package -n python2-ldb -Summary: Python bindings for the LDB library -Requires: libldb%{?_isa} = %{version}-%{release} -Requires: python2-tdb%{?_isa} >= %{tdb_version} - -Provides: pyldb = %{version}-%{release} -Provides: pyldb%{?_isa} = %{version}-%{release} -Obsoletes: pyldb < 1.1.26-2 -%{?python_provide:%python_provide python2-ldb} - -%description -n python2-ldb -Python bindings for the LDB library - -%package -n python2-ldb-devel -Summary: Development files for the Python bindings for the LDB library -Requires: python2-ldb%{?_isa} = %{version}-%{release} -Requires: python-ldb-devel-common%{?_isa} = %{version}-%{release} - -Provides: pyldb-devel = %{version}-%{release} -Provides: pyldb-devel%{?_isa} = %{version}-%{release} -Obsoletes: pyldb-devel < 1.1.26-2 -%{?python_provide:%python_provide python2-ldb-devel} - -%description -n python2-ldb-devel -Development files for the Python bindings for 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 0%{?with_python3} - %package -n python3-ldb Summary: Python bindings for the LDB library Requires: libldb%{?_isa} = %{version}-%{release} @@ -129,54 +78,35 @@ 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} +Obsoletes: python-ldb-devel-common < %{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 - %prep %setup -q -n ldb-%{version} %patch0001 -p1 -%patch0002 -p3 %build - -%if 0%{?with_python3} -PY3_CONFIG_FLAGS=--extra-python=%{__python3} -%else -PY3_CONFIG_FLAGS="" -%endif - -# workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1217376 -export python_LDFLAGS="" - -# Use Python 2 for the waf buildscript -pathfix.py -n -p -i %{__python2} buildtools/bin/waf -export RHEL_ALLOW_PYTHON2_FOR_BUILD=1 -export PYTHON=%{__python2} - %configure --disable-rpath \ --disable-rpath-install \ --bundled-libraries=NONE \ --builtin-libraries=replace \ --with-modulesdir=%{_libdir}/ldb/modules \ --without-ldb-lmdb \ - $PY3_CONFIG_FLAGS \ --with-privatelibdir=%{_libdir}/ldb make %{?_smp_mflags} V=1 doxygen Doxyfile %check -export RHEL_ALLOW_PYTHON2_FOR_BUILD=1 -make %{?_smp_mflags} check +# jhrozek 2019-05-03: Looks like ldb test suite does not work +# when ldb is compiled --without-ldb-lmdb +# make %{?_smp_mflags} check %install -export RHEL_ALLOW_PYTHON2_FOR_BUILD=1 make install DESTDIR=$RPM_BUILD_ROOT rm -f $RPM_BUILD_ROOT%{_libdir}/libldb.a @@ -198,6 +128,8 @@ rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/_* %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 # lmdb is not supported on 32 bit architectures %if 0%{?__isa_bits} == 64 && ! 0%{?rhel} %{_libdir}/ldb/libldb-mdb-int.so @@ -233,23 +165,6 @@ rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/_* %{_mandir}/man3/ldb*.gz %{_mandir}/man3/ldif*.gz -%files -n python2-ldb -%{python2_sitearch}/ldb.so -%{_libdir}/libpyldb-util.so.1* -%{python2_sitearch}/_ldb_text.py* - -%files -n python2-ldb-devel -%{_libdir}/libpyldb-util.so -%{_libdir}/pkgconfig/pyldb-util.pc - -%files -n python-ldb-devel-common -%{_includedir}/pyldb.h -%{_mandir}/man*/Py*.gz - -%ldconfig_scriptlets -n python2-ldb - -%if 0%{?with_python3} - %files -n python3-ldb %{python3_sitearch}/ldb.cpython-*.so %{_libdir}/libpyldb-util.cpython-*.so.1* @@ -259,12 +174,21 @@ rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/_* %files -n python3-ldb-devel %{_libdir}/libpyldb-util.cpython-*.so %{_libdir}/pkgconfig/pyldb-util.cpython-*.pc +%{_includedir}/pyldb.h +%{_mandir}/man*/Py*.gz %ldconfig_scriptlets -n python3-ldb -%endif - %changelog +* Tue May 7 2019 Jakub Hrozek - 1.5.4-2 +- Fix some python2-related upgrade issues +- Related: rhbz#1567115 - libldb: Drop Python 2 subpackages from RHEL 8 + +* Wed Apr 24 2019 Jakub Hrozek - 1.5.4-1 +- Resolves: rhbz#1684582 - Rebase libldb to version 1.5.4 for Samba +- Resolves: rhbz#1567115 - libldb: Drop Python 2 subpackages from RHEL 8 +- Resolves: rhbz#1597243 - libldb uses Python 2 to build. + * Thu Sep 20 2018 Jakub Hrozek - 1.4.2-2 - Resolves: rhbz#1624132 - Review annocheck distro flag failures in libldb