From f542d96b3efc862401063c9c0ee0b006b69f17ae Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Sat, 24 Aug 2019 16:37:42 +0200 Subject: [PATCH] Remove python2 packages * resolves: rhbz#1737644 - libldb, libtalloc, libtevent, libtdb: Remove Python 2 subpackages from Fedora 31+ --- libldb.spec | 73 +++-------------------------------------------------- 1 file changed, 4 insertions(+), 69 deletions(-) diff --git a/libldb.spec b/libldb.spec index 91cd41b..649929d 100644 --- a/libldb.spec +++ b/libldb.spec @@ -1,7 +1,3 @@ -%{!?__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))")} - # lmdb is not supported on 32 bit architectures %if ((0%{?fedora} || 0%{?epel} > 6) && 0%{?__isa_bits} == 64) %global with_lmdb 1 @@ -13,20 +9,6 @@ %global with_python3 1 %endif -%if 0%{?fedora} || 0%{?rhel} < 8 -%global with_python2 1 -%endif - -%if (0%{?with_python2} == 1 && 0%{?with_python3} == 0) -# We need to sent env PYTHON for python2 only build -%global export_waf_python export PYTHON=%{__python2} -%endif - -%if (0%{?with_python2} == 1 && 0%{?with_python3} == 1) -# python3 is default and therefore python2 need to be set as extra-python -%global extra_python --extra-python=%{__python2} -%endif - %global talloc_version 2.1.16 %global tdb_version 1.3.18 %global tevent_version 0.9.39 @@ -57,12 +39,6 @@ BuildRequires: lmdb-devel >= 0.9.16 BuildRequires: popt-devel BuildRequires: libxslt BuildRequires: docbook-style-xsl -%if 0%{?with_python2} -BuildRequires: python2-devel -BuildRequires: python2-tdb -BuildRequires: python2-talloc-devel -BuildRequires: python2-tevent -%endif %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-tdb @@ -74,6 +50,10 @@ BuildRequires: openldap-devel BuildRequires: libcmocka-devel 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 @@ -96,34 +76,6 @@ Requires: libtevent-devel%{?_isa} >= %{tevent_version} %description devel Header files needed to develop programs that link against the LDB library. -%if 0%{?with_python2} -%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 -%endif - %package -n python-ldb-devel-common Summary: Common development files for the Python bindings for the LDB library @@ -164,13 +116,11 @@ Development files for the Python bindings for the LDB library # workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1217376 export python_LDFLAGS="" -%{?export_waf_python} %configure --disable-rpath \ --disable-rpath-install \ --bundled-libraries=NONE \ --builtin-libraries=replace \ --with-modulesdir=%{_libdir}/ldb/modules \ - %{?extra_python} \ %{?without_lmdb_flags} \ --with-privatelibdir=%{_libdir}/ldb @@ -178,11 +128,9 @@ make %{?_smp_mflags} V=1 doxygen Doxyfile %check -%{?export_waf_python} make %{?_smp_mflags} check %install -%{?export_waf_python} make install DESTDIR=$RPM_BUILD_ROOT # Install API docs @@ -238,19 +186,6 @@ rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/_* %{_includedir}/pyldb.h %{_mandir}/man*/Py*.gz -%if 0%{?with_python2} -%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 - -%ldconfig_scriptlets -n python2-ldb -%endif - %if 0%{?with_python3} %files -n python3-ldb %{python3_sitearch}/ldb.cpython-*.so