diff --git a/python-pyglet.spec b/python-pyglet.spec index 12a68bb..0d90669 100644 --- a/python-pyglet.spec +++ b/python-pyglet.spec @@ -1,4 +1,4 @@ -%global with_python3 1 +%global with_python2 1 %global srcname pyglet %global srcversion 1.3.1 @@ -21,12 +21,13 @@ Source0: %{versionedname}-repacked.tar.gz Source1: pyglet-get-tarball.sh BuildArch: noarch +%if %{with python2} BuildRequires: python2-devel BuildRequires: python2-setuptools -%if 0%{?with_python3} +%endif + BuildRequires: python3-devel BuildRequires: python3-setuptools -%endif %description This library provides an object-oriented programming interface for developing @@ -39,13 +40,14 @@ fully aware of multi-monitor setups. pyglet might be seen as an alternative to PyGame. +%if %{with python2} %package -n python2-%{srcname} Summary: A cross-platform windowing and multimedia library for Python 3 %{?python_provide:%python_provide python2-%{srcname}} Requires: python2 -Requires: python2-pillow%{?_isa} +Requires: python2-pillow Requires: python2-future # The libraries are imported dynamically using ctypes, so rpm can't find them. @@ -62,16 +64,16 @@ distribution and installation. It also handles multiple windows and fully aware of multi-monitor setups. pyglet might be seen as an alternative to PyGame. +%endif -%if 0%{?with_python3} %package -n python3-%{srcname} Summary: A cross-platform windowing and multimedia library for Python 3 %{?python_provide:%python_provide python3-%{srcname}} Requires: python3 -Requires: python3-pillow%{?_isa} +Requires: python3-pillow Requires: python3-future # The libraries are imported dynamically using ctypes, so rpm can't find them. @@ -89,8 +91,6 @@ fully aware of multi-monitor setups. pyglet might be seen as an alternative to PyGame. -%endif - %prep %setup -q -n %{versionedname} @@ -106,32 +106,22 @@ rm -r pyglet/extlibs/future # Also remove Windows newlines find . -name '*.py' | xargs sed --in-place -e's|#!/usr/bin/\(env \)\?python||;s/\r//' -%if 0%{?with_python3} -rm -rf %{py3dir} -cp -a . %{py3dir} -%endif - %build +%if %{with python2} %py2_build - -%if 0%{?with_python3} -pushd %{py3dir} -%py3_build -popd %endif +%py3_build %install +%if %{with python2} %py2_install - -%if 0%{?with_python3} -pushd %{py3dir} -%py3_install -popd %endif +%py3_install +%if %{with python2} %files -n python2-%{srcname} %license LICENSE %doc README @@ -139,8 +129,8 @@ popd %doc PKG-INFO %{python2_sitelib}/%{versionedname}-py2.7.egg-info %{python2_sitelib}/%{srcname} +%endif -%if 0%{?with_python3} %files -n python3-%{srcname} %license LICENSE %doc README @@ -148,12 +138,12 @@ popd %doc PKG-INFO %{python3_sitelib}/%{versionedname}-py%{python3_version}.egg-info %{python3_sitelib}/%{srcname} -%endif %changelog * Tue Feb 06 2018 Petr Viktorin - 1.3.1-1 - Update to upstream 1.3.1 bugfix release +- Always build for Python 3; conditionalize the Python 2 library * Fri Jan 26 2018 Petr Viktorin - 1.3.0-1 - Update to upstream 1.3.0