From d2f579c10769e0b455dfa29b47f28666799a6145fa4751e004eb7cf7889d031c Mon Sep 17 00:00:00 2001 From: Todd R Date: Sun, 6 Aug 2017 02:33:19 +0000 Subject: [PATCH] Accepting request 514743 from home:TheBlackCat:branches:devel:languages:python - Implement single-spec version OBS-URL: https://build.opensuse.org/request/show/514743 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyglet?expand=0&rev=9 --- python-pyglet.changes | 5 +++++ python-pyglet.spec | 43 ++++++++++++++++++++----------------------- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/python-pyglet.changes b/python-pyglet.changes index 6b7ba97..92b6b3d 100644 --- a/python-pyglet.changes +++ b/python-pyglet.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Aug 6 02:32:29 UTC 2017 - toddrme2178@gmail.com + +- Implement single-spec version + ------------------------------------------------------------------- Mon Jul 31 21:13:01 UTC 2017 - kkirill@opensuse.org diff --git a/python-pyglet.spec b/python-pyglet.spec index 0e182c1..aeb755a 100644 --- a/python-pyglet.spec +++ b/python-pyglet.spec @@ -16,8 +16,7 @@ # -%define oname pyglet - +%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pyglet Version: 1.2.4 Release: 0 @@ -25,7 +24,7 @@ Summary: Cross-platform windowing and multimedia library License: BSD-3-Clause Group: Development/Languages/Python Url: https://bitbucket.org/pyglet/pyglet -Source0: http://pypi.python.org/packages/source/p/%{oname}/%{oname}-%{version}.tar.gz +Source0: https://files.pythonhosted.org/packages/source/p/pyglet/pyglet-%{version}.tar.gz Source1: %{name}-rpmlintrc # PATCH-FIX-OPENSUSE pyglet-1.2.4-fix-image-import.patch -- fix "import Image" Patch0: pyglet-1.2.4-fix-image-import.patch @@ -33,21 +32,21 @@ Patch0: pyglet-1.2.4-fix-image-import.patch Patch1: pyglet-1.2.4-add-wmclass.patch # PATCH-FIX-UPSTREAM pyglet-1.2.4-fix-examples.patch -- fix intrepreter shebang Patch2: pyglet-1.2.4-fix-examples.patch -%if 0%{?suse_version} -BuildRequires: fdupes -%endif +BuildRequires: %{python_module Pillow} +BuildRequires: %{python_module devel} +BuildRequires: %{python_module setuptools} BuildRequires: alsa-devel BuildRequires: dos2unix +BuildRequires: fdupes BuildRequires: fontconfig-devel BuildRequires: freetype2-devel BuildRequires: gtk2-devel BuildRequires: openal-soft-devel -BuildRequires: python-devel BuildRequires: python-imaging -BuildRequires: python-setuptools BuildRequires: pkgconfig(gl) BuildRequires: pkgconfig(glu) BuildRequires: pkgconfig(x11) +BuildRequires: python-rpm-macros Requires: alsa-devel Requires: fontconfig-devel Requires: freetype2-devel @@ -57,12 +56,8 @@ Requires: python-imaging Requires: pkgconfig(gl) Requires: pkgconfig(glu) Requires: pkgconfig(x11) -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if 0%{?suse_version} && 0%{?suse_version} <= 1110 -%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%else BuildArch: noarch -%endif +%python_subpackages %description pyglet provides an object-oriented programming @@ -70,7 +65,7 @@ interface for developing games and other visually-rich applications for Windows, Mac OS X and Linux. %prep -%setup -q -n %{oname}-%{version} +%setup -q -n pyglet-%{version} %patch0 %patch1 %patch2 @@ -79,19 +74,21 @@ for Windows, Mac OS X and Linux. find -name "*.py" -exec dos2unix "{}" "+" %build -python setup.py build +%python_build %install -python setup.py install --prefix=%{_prefix} --root=%{buildroot} +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} -%if 0%{?suse_version} - %fdupes -s %{buildroot}%{_prefix} -%endif +%{python_expand cp -r examples examples_%{$python_bin_suffix} +find . -name "*.py" -exec sed -i "s|#!/usr/bin/python|#!%__$python|" {} \; +} -%files +%files %{python_files} %defattr(-,root,root,-) -%doc CHANGELOG README LICENSE NOTICE RELEASE_NOTES examples -%{python_sitelib}/%{oname} -%{python_sitelib}/%{oname}-%{version}-py%{py_ver}.egg-info +%doc CHANGELOG README LICENSE NOTICE RELEASE_NOTES +%doc examples_%{python_bin_suffix}/ +%{python_sitelib}/pyglet +%{python_sitelib}/pyglet-%{version}-py*.egg-info %changelog