From 6b395ee9ae2466a01d8a33bc46353ec18637b040 Mon Sep 17 00:00:00 2001 From: David King Date: Mon, 4 Apr 2016 10:43:52 +0200 Subject: [PATCH] Install bindings for both Python 2 and 3 (#1323251) Additionally, rename the Python 2 subpackage python2-libproxy. Use the python_provides macro to ensure that the correct provides is used for the default Python runtime. --- libproxy.spec | 49 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/libproxy.spec b/libproxy.spec index 8bd5f2d..a81f073 100644 --- a/libproxy.spec +++ b/libproxy.spec @@ -4,7 +4,7 @@ Name: libproxy Version: 0.4.12 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A library handling all the details of proxy configuration Group: System Environment/Libraries @@ -22,7 +22,6 @@ Patch3: libproxy-0.4.12-fix-kde-slowdown.patch # Fix a Python bindings crash on 64-bit systems. Patch4: libproxy-0.4.12-fix-python-crash.patch -BuildRequires: python2-devel BuildRequires: libmodman-devel >= 2.0.1 BuildRequires: cmake >= 2.6.0 @@ -39,6 +38,9 @@ BuildRequires: pkgconfig(dbus-1) BuildRequires: pkgconfig(javascriptcoregtk-4.0) # kde BuildRequires: /usr/bin/kreadconfig5 +# Python +BuildRequires: python2-devel +BuildRequires: python3-devel %else # Obsoletes of disabled subpackages. Provides: %{name}-mozjs = %{version}-%{release} @@ -69,14 +71,28 @@ Requires: %{name}%{?_isa} = %{version}-%{release} The %{name}-bin package contains the proxy binary for %{name} %if ! 0%{?bootstrap} -%package python -Summary: Binding for %{name} and python +%package -n python2-%{name} +Summary: Binding for %{name} and python2 +Group: System Environment/Libraries +Requires: %{name} = %{version}-%{release} +# Remove compatibility in F26. +Provides: %{name}-python = %{version}-%{release} +Obsoletes: %{name}-python < 0.4.12-3 +BuildArch: noarch +%{?python_provide:%python_provide python2-%{name}} + +%description -n python2-%{name} +The python2 binding for %{name} + +%package -n python3-%{name} +Summary: Binding for %{name} and python3 Group: System Environment/Libraries Requires: %{name} = %{version}-%{release} BuildArch: noarch +%{?python_provide:%python_provide python3-%{name}} -%description python -The %{name}-python package contains the python binding for %{name} +%description -n python3-%{name} +The python3 binding for %{name} %package gnome Summary: Plugin for %{name} and gnome @@ -162,8 +178,11 @@ developing applications that use %{name}. -DWITH_PERL=OFF \ %if ! 0%{?bootstrap} -DWITH_GNOME3=ON \ + -DWITH_PYTHON=ON \ -DWITH_WEBKIT3=ON \ -DWITH_MOZJS=ON \ +%else + -DWITH_PYTHON=OFF \ %endif . make VERBOSE=1 %{?_smp_mflags} @@ -178,6 +197,13 @@ mkdir -p %{buildroot}%{_libdir}/%{name}/%{version}/modules # Man page. install -Dpm 0644 %{SOURCE1} %{buildroot}/%{_mandir}/man1/proxy.1 +# Install Python module for Python 3. +%if ! 0%{?bootstrap} +install -d %{buildroot}/%{python3_sitelib} +cp -p %{buildroot}/%{python2_sitelib}/%{name}.* \ + %{buildroot}/%{python3_sitelib}/ +%endif + %check make test @@ -199,8 +225,12 @@ make test %{_mandir}/man1/proxy.1* %if ! 0%{?bootstrap} -%files python -%{python_sitelib}/* +%files -n python2-%{name} +%{python2_sitelib}/%{name}.* + +%files -n python3-%{name} +%{python3_sitelib}/__pycache__/* +%{python3_sitelib}/%{name}.* %files gnome %{_libdir}/%{name}/%{version}/modules/config_gnome3.so @@ -230,6 +260,9 @@ make test %changelog +* Mon Apr 04 2016 David King - 0.4.12-3 +- Install bindings for both Python 2 and 3 (#1323251) + * Fri Mar 04 2016 David King - 0.4.12-2 - Fix a Python bindings crash on 64-bit systems (#1296817)