1
0
Alexei Sorokin
2018-06-19 13:07:58 +00:00
committed by Git OBS Bridge
parent e0a1d35392
commit 09734e4d70
2 changed files with 40 additions and 44 deletions

View File

@@ -1,8 +1,8 @@
-------------------------------------------------------------------
Sun Jun 17 18:47:02 UTC 2018 - sor.alexei@meowr.ru
- Disable building of the Python 2 module for openSUSE Leap 15.1
and newer.
- Disable building of the Python 2 module and conditionalise both
Python's like in the boost package.
- Rename python2-libtorrent-rasterbar back to
python-libtorrent-rasterbar on openSUSE Leap 42.3 and older.

View File

@@ -19,6 +19,8 @@
%define _name libtorrent
%define sover 9
%define _version 1_1_7
%bcond_with python2
%bcond_without python3
%bcond_with examples
%bcond_with tests
Name: libtorrent-rasterbar
@@ -34,16 +36,20 @@ Patch0: libtorrent-rasterbar-1.1.7-boost-1.67.patch
BuildRequires: gcc-c++
BuildRequires: pkgconfig
BuildRequires: pkgconfig(openssl)
%if 0%{?suse_version} <= 1500
BuildRequires: libboost_python-devel
%if %{with python2}
BuildRequires: python-devel
%endif
%if 0%{?suse_version} >= 1500
BuildRequires: libboost_chrono-devel
BuildRequires: libboost_python3-devel
BuildRequires: libboost_random-devel
BuildRequires: libboost_system-devel
%if %{with python2}
BuildRequires: libboost_python-devel
%endif
%if %{with python3}
BuildRequires: libboost_python3-devel
BuildRequires: python3-devel
%endif
%else
BuildRequires: boost-devel >= 1.54
# For quadmath.h we need gcc-fortran on openSUSE Leap 14.x and older.
@@ -79,30 +85,30 @@ The main goals of libtorrent-rasterbar are:
* To be memory efficient.
* To be very easy to use.
%if 0%{?suse_version} < 1500
%package -n python-%{name}
Summary: Python Bindings for libtorrent-rasterbar
Group: Development/Libraries/Python
Provides: python2-%{name} = %{version}-%{release}
Obsoletes: python2-%{name} < %{version}-%{release}
%description -n python-%{name}
Python Bindings for the libtorrent-rasterbar package.
%endif
%if 0%{?suse_version} == 1500
%if %{with python2}
%if 0%{?suse_version} >= 1500
%package -n python2-%{name}
%else
%package -n python-%{name}
%endif
Summary: Python Bindings for libtorrent-rasterbar
# python-libtorrent-rasterbar was last used in openSUSE Leap 42.2.
Group: Development/Libraries/Python
%if 0%{?suse_version} >= 1500
# python-libtorrent-rasterbar was last used in openSUSE Leap 42.2.
Provides: python-%{name} = %{version}-%{release}
Obsoletes: python-%{name} < %{version}-%{release}
%description -n python2-%{name}
%else
Provides: python2-%{name} = %{version}-%{release}
Obsoletes: python2-%{name} < %{version}-%{release}
%description -n python-%{name}
%endif
Python Bindings for the libtorrent-rasterbar package.
%endif
%if 0%{?suse_version} >= 1500
%if %{with python3}
%package -n python3-%{name}
Summary: Python Bindings for libtorrent-rasterbar
Group: Development/Libraries/Python
@@ -168,15 +174,7 @@ export LIBS="$LIBS -lboost_atomic"
%endif
%global _configure ../configure
%if 0%{?suse_version} > 1500
for py in python3; do
%else
%if 0%{?suse_version} == 1500
for py in python python3; do
%else
for py in python; do
%endif
%endif
for py in %{?with_python2:python} %{?with_python3:python3}; do
mkdir -p "build-$py"
pushd "build-$py"
export PYTHON="$py"
@@ -197,10 +195,10 @@ for py in python; do
done
%install
%if 0%{?suse_version} <= 1500
%if %{with python2}
%make_install -C build-python
%endif
%if 0%{?suse_version} >= 1500
%if %{with python3}
%make_install -C build-python3
%endif
@@ -218,10 +216,10 @@ rm -v %{buildroot}%{_bindir}/{client_test,connection_tester,enum_if} \
%if %{with tests}
%check
%if 0%{?suse_version} <= 1500
%if %{with python2}
make check %{?_smp_mflags} V=1 -C build-python
%endif
%if 0%{?suse_version} >= 1500
%if %{with python3}
make check %{?_smp_mflags} V=1 -C build-python3
%endif
%endif
@@ -246,19 +244,17 @@ make check %{?_smp_mflags} V=1 -C build-python3
%doc AUTHORS ChangeLog
%{_libdir}/%{name}.so.%{sover}*
%if 0%{?suse_version} < 1500
%files -n python-%{name}
%{python_sitearch}/%{_name}*.so
%{python_sitearch}/python_%{_name}-*
%endif
%if 0%{?suse_version} == 1500
%files -n python2-%{name}
%{python_sitearch}/%{_name}*.so
%{python_sitearch}/python_%{_name}-*
%endif
%if %{with python2}
%if 0%{?suse_version} >= 1500
%files -n python2-%{name}
%else
%files -n python-%{name}
%endif
%{python_sitearch}/%{_name}*.so
%{python_sitearch}/python_%{_name}-*
%endif
%if %{with python3}
%files -n python3-%{name}
%{python3_sitearch}/%{_name}*.so
%{python3_sitearch}/python_%{_name}-*