Make python2 optional
This commit is contained in:
parent
c627f945ea
commit
9427f0d5bc
35
libldb.spec
35
libldb.spec
@ -4,8 +4,10 @@
|
|||||||
|
|
||||||
%if 0%{?fedora} || 0%{?rhel} > 7
|
%if 0%{?fedora} || 0%{?rhel} > 7
|
||||||
%global with_python3 1
|
%global with_python3 1
|
||||||
%else
|
%endif
|
||||||
%global with_python3 0
|
|
||||||
|
%if 0%{?fedora} || 0%{?rhel} < 8
|
||||||
|
%global with_python2 1
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%global talloc_version 2.1.15
|
%global talloc_version 2.1.15
|
||||||
@ -31,22 +33,23 @@ BuildRequires: lmdb-devel >= 0.9.16
|
|||||||
BuildRequires: popt-devel
|
BuildRequires: popt-devel
|
||||||
BuildRequires: libxslt
|
BuildRequires: libxslt
|
||||||
BuildRequires: docbook-style-xsl
|
BuildRequires: docbook-style-xsl
|
||||||
|
%if 0%{?with_python2}
|
||||||
BuildRequires: python2-devel
|
BuildRequires: python2-devel
|
||||||
BuildRequires: python2-tdb
|
BuildRequires: python2-tdb
|
||||||
BuildRequires: python2-talloc-devel
|
BuildRequires: python2-talloc-devel
|
||||||
BuildRequires: python2-tevent
|
BuildRequires: python2-tevent
|
||||||
BuildRequires: doxygen
|
%endif
|
||||||
BuildRequires: openldap-devel
|
|
||||||
BuildRequires: libcmocka-devel
|
|
||||||
|
|
||||||
Provides: bundled(libreplace)
|
|
||||||
|
|
||||||
%if 0%{?with_python3}
|
%if 0%{?with_python3}
|
||||||
BuildRequires: python3-devel
|
BuildRequires: python3-devel
|
||||||
BuildRequires: python3-tdb
|
BuildRequires: python3-tdb
|
||||||
BuildRequires: python3-talloc-devel
|
BuildRequires: python3-talloc-devel
|
||||||
BuildRequires: python3-tevent
|
BuildRequires: python3-tevent
|
||||||
%endif
|
%endif
|
||||||
|
BuildRequires: doxygen
|
||||||
|
BuildRequires: openldap-devel
|
||||||
|
BuildRequires: libcmocka-devel
|
||||||
|
|
||||||
|
Provides: bundled(libreplace)
|
||||||
|
|
||||||
# Patches
|
# Patches
|
||||||
Patch0001: 0002-ldb-Run-at-least-some-tests-on-32-bit-machines.patch
|
Patch0001: 0002-ldb-Run-at-least-some-tests-on-32-bit-machines.patch
|
||||||
@ -73,6 +76,7 @@ Requires: pkgconfig
|
|||||||
%description devel
|
%description devel
|
||||||
Header files needed to develop programs that link against the LDB library.
|
Header files needed to develop programs that link against the LDB library.
|
||||||
|
|
||||||
|
%if 0%{?with_python2}
|
||||||
%package -n python2-ldb
|
%package -n python2-ldb
|
||||||
Summary: Python bindings for the LDB library
|
Summary: Python bindings for the LDB library
|
||||||
Requires: libldb%{?_isa} = %{version}-%{release}
|
Requires: libldb%{?_isa} = %{version}-%{release}
|
||||||
@ -98,6 +102,7 @@ Obsoletes: pyldb-devel < 1.1.26-2
|
|||||||
|
|
||||||
%description -n python2-ldb-devel
|
%description -n python2-ldb-devel
|
||||||
Development files for the Python bindings for the LDB library
|
Development files for the Python bindings for the LDB library
|
||||||
|
%endif
|
||||||
|
|
||||||
%package -n python-ldb-devel-common
|
%package -n python-ldb-devel-common
|
||||||
Summary: Common development files for the Python bindings for the LDB library
|
Summary: Common development files for the Python bindings for the LDB library
|
||||||
@ -110,7 +115,6 @@ 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 0%{?with_python3}
|
%if 0%{?with_python3}
|
||||||
|
|
||||||
%package -n python3-ldb
|
%package -n python3-ldb
|
||||||
Summary: Python bindings for the LDB library
|
Summary: Python bindings for the LDB library
|
||||||
Requires: libldb%{?_isa} = %{version}-%{release}
|
Requires: libldb%{?_isa} = %{version}-%{release}
|
||||||
@ -130,7 +134,6 @@ Requires: python-ldb-devel-common%{?_isa} = %{version}-%{release}
|
|||||||
|
|
||||||
%description -n python3-ldb-devel
|
%description -n python3-ldb-devel
|
||||||
Development files for the Python bindings for the LDB library
|
Development files for the Python bindings for the LDB library
|
||||||
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
@ -221,6 +224,11 @@ rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/_*
|
|||||||
%{_mandir}/man3/ldb*.gz
|
%{_mandir}/man3/ldb*.gz
|
||||||
%{_mandir}/man3/ldif*.gz
|
%{_mandir}/man3/ldif*.gz
|
||||||
|
|
||||||
|
%files -n python-ldb-devel-common
|
||||||
|
%{_includedir}/pyldb.h
|
||||||
|
%{_mandir}/man*/Py*.gz
|
||||||
|
|
||||||
|
%if 0%{?with_python2}
|
||||||
%files -n python2-ldb
|
%files -n python2-ldb
|
||||||
%{python2_sitearch}/ldb.so
|
%{python2_sitearch}/ldb.so
|
||||||
%{_libdir}/libpyldb-util.so.1*
|
%{_libdir}/libpyldb-util.so.1*
|
||||||
@ -230,14 +238,10 @@ rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/_*
|
|||||||
%{_libdir}/libpyldb-util.so
|
%{_libdir}/libpyldb-util.so
|
||||||
%{_libdir}/pkgconfig/pyldb-util.pc
|
%{_libdir}/pkgconfig/pyldb-util.pc
|
||||||
|
|
||||||
%files -n python-ldb-devel-common
|
|
||||||
%{_includedir}/pyldb.h
|
|
||||||
%{_mandir}/man*/Py*.gz
|
|
||||||
|
|
||||||
%ldconfig_scriptlets -n python2-ldb
|
%ldconfig_scriptlets -n python2-ldb
|
||||||
|
%endif
|
||||||
|
|
||||||
%if 0%{?with_python3}
|
%if 0%{?with_python3}
|
||||||
|
|
||||||
%files -n python3-ldb
|
%files -n python3-ldb
|
||||||
%{python3_sitearch}/ldb.cpython-*.so
|
%{python3_sitearch}/ldb.cpython-*.so
|
||||||
%{_libdir}/libpyldb-util.cpython-*.so.1*
|
%{_libdir}/libpyldb-util.cpython-*.so.1*
|
||||||
@ -249,7 +253,6 @@ rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/_*
|
|||||||
%{_libdir}/pkgconfig/pyldb-util.cpython-*.pc
|
%{_libdir}/pkgconfig/pyldb-util.cpython-*.pc
|
||||||
|
|
||||||
%ldconfig_scriptlets -n python3-ldb
|
%ldconfig_scriptlets -n python3-ldb
|
||||||
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
Reference in New Issue
Block a user