forked from pool/python-pygame
Accepting request 515786 from home:TheBlackCat:branches:devel:languages:python
- Update to version 1.9.3 - Implement single-spec version - Fix source URL - Fix shebangs OBS-URL: https://build.opensuse.org/request/show/515786 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pygame?expand=0&rev=13
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-pygame
|
||||
#
|
||||
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -16,60 +16,50 @@
|
||||
#
|
||||
|
||||
|
||||
# There are font issues in the test environment
|
||||
%bcond_with test
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
Name: python-pygame
|
||||
Version: 1.9.1
|
||||
Version: 1.9.3
|
||||
Release: 0
|
||||
Source: http://pygame.org/ftp/pygame-%{version}release.tar.gz
|
||||
Source1: README.SUSE
|
||||
Source2: python-pygame.rpmlintrc
|
||||
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
|
||||
Patch1: pygame-v4l-2.6.38.patch
|
||||
Source0: https://files.pythonhosted.org/packages/source/P/Pygame/pygame-%{version}.tar.gz
|
||||
Summary: A Python Module for Interfacing with the SDL Multimedia Library
|
||||
License: LGPL-2.1+
|
||||
Group: Development/Libraries/Python
|
||||
Url: http://www.pygame.org/
|
||||
Provides: pygame = %{version}
|
||||
Obsoletes: pygame < %{version}
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: %{python_module devel}
|
||||
BuildRequires: %{python_module numpy}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: SDL_image-devel
|
||||
BuildRequires: SDL_mixer-devel
|
||||
BuildRequires: SDL_ttf-devel
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: fontconfig
|
||||
BuildRequires: freetype2-devel
|
||||
BuildRequires: libjpeg-devel
|
||||
BuildRequires: libpng-devel
|
||||
BuildRequires: python-devel
|
||||
BuildRequires: xorg-x11
|
||||
%if 0%{?suse_version} > 1110
|
||||
BuildRequires: python-numpy
|
||||
%else
|
||||
BuildRequires: python-numeric
|
||||
%endif
|
||||
%if 0%{?suse_version} >= 1210
|
||||
BuildRequires: libv4l-devel >= 0.8.4
|
||||
%endif
|
||||
%if 0%{?suse_version} >= 1320
|
||||
BuildRequires: portmidi-devel
|
||||
BuildRequires: python-rpm-macros
|
||||
BuildRequires: xorg-x11
|
||||
Requires: fontconfig
|
||||
Requires: python-numpy
|
||||
%ifpython2
|
||||
Provides: pygame = %{version}
|
||||
Obsoletes: pygame < %{version}
|
||||
%endif
|
||||
%{py_requires}
|
||||
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
Pygame is a Python wrapper module for the SDL multimedia library. It
|
||||
contains Python functions and classes that allow you to use SDL's
|
||||
support for playing CD-ROMs, audio and video output, and keyboard,
|
||||
support for playing CD-ROMs, audio and video output, and kz`eyboard,
|
||||
mouse and joystick input. Pygame also includes support for the
|
||||
Numerical Python extension. Pygame is the successor to the pySDL
|
||||
wrapper project, written by Mark Baker.
|
||||
|
||||
%package doc
|
||||
Summary: Pygame documentation and example programs
|
||||
Group: Development/Libraries/Python
|
||||
Provides: pygame-doc > 1.5.5
|
||||
Obsoletes: pygame-doc <= 1.5.5
|
||||
Requires: python-pygame = %{version}
|
||||
|
||||
%description doc
|
||||
This package contains documentation and example programs for Pygame.
|
||||
|
||||
%package devel
|
||||
Summary: Pygame development package
|
||||
Group: Development/Libraries/Python
|
||||
@@ -78,41 +68,71 @@ Requires: python-pygame = %{version}
|
||||
%description devel
|
||||
This package contains the header files for developers of Pygame.
|
||||
|
||||
%package -n %{name}-doc
|
||||
Summary: Pygame documentation and example programs
|
||||
Group: Development/Libraries/Python
|
||||
Provides: pygame-doc = %{version}
|
||||
Obsoletes: pygame-doc < %{version}
|
||||
Provides: %{python_module pygame-doc = %{version}}
|
||||
|
||||
%description -n %{name}-doc
|
||||
This package contains documentation and example programs for Pygame.
|
||||
|
||||
%prep
|
||||
%setup -q -n pygame-%{version}release
|
||||
%if 0%{?suse_version} >= 1210
|
||||
%patch1
|
||||
%endif
|
||||
%setup -q -n pygame-%{version}
|
||||
sed -i 's/\r$//' docs/reST/ref/code_examples/draw_module_example.py
|
||||
sed -i 's/\r$//' docs/reST/ref/code_examples/joystick_calls.py
|
||||
# Fix wrong-script-interpreter
|
||||
find examples -name '*.py' -exec sed -i "s|^#!/usr/bin/env python$|#!%{__python3}|" {} \;
|
||||
find examples -name '*.py' -exec sed -i "s|^#! /usr/bin/env python$|#!%{__python3}|" {} \;
|
||||
chmod a+x examples/*.py
|
||||
%fdupes docs
|
||||
%fdupes examples
|
||||
|
||||
%build
|
||||
export CFLAGS="$RPM_OPT_FLAGS -Wall -fno-strict-aliasing"
|
||||
yes y | python -d config.py
|
||||
python setup.py build
|
||||
export CFLAGS="%{optflags} -fno-strict-aliasing"
|
||||
%python_build
|
||||
|
||||
%install
|
||||
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
||||
#install doc
|
||||
install -d %{buildroot}%{_docdir}/python-pygame
|
||||
install -m 644 WHATSNEW README.txt %{SOURCE1} %{buildroot}%{_docdir}/python-pygame
|
||||
cp -r docs/ examples/ %{buildroot}%{_docdir}/python-pygame
|
||||
%python_install
|
||||
%{python_expand pushd %{buildroot}%{$python_sitearch}
|
||||
sed -i "s|^#!/usr/bin/env python$|#!%{__python3}|" pygame/tests/test_utils/png.py
|
||||
chmod a+x pygame/tests/test_utils/png.py
|
||||
chmod a+x pygame/examples/macosx/aliens_app_example/aliens.py
|
||||
chmod a+x pygame/examples/*.py
|
||||
chmod a-x pygame/examples/__init__.py
|
||||
chmod a-x pygame/examples/prevent_display_stretching.py
|
||||
chmod a-x pygame/examples/freetype_misc.py
|
||||
$python -m compileall -d %{$python_sitearch} pygame/tests/test_utils/
|
||||
$python -O -m compileall -d %{$python_sitearch} pygame/tests/test_utils/
|
||||
%fdupes .
|
||||
popd
|
||||
}
|
||||
|
||||
%fdupes -s %{buildroot}%{_prefix}
|
||||
%if %{with test}
|
||||
%check
|
||||
export SDL_VIDEODRIVER=dummy
|
||||
export SDL_AUDIODRIVER=disk
|
||||
%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitearch}
|
||||
$python -m pygame.tests.__main__ --exclude opengl --time_out 300
|
||||
}
|
||||
%endif
|
||||
|
||||
%files
|
||||
%defattr(644,root,root,755)
|
||||
%doc %dir %{_docdir}/python-pygame
|
||||
%doc %{_docdir}/python-pygame/WHATSNEW
|
||||
%doc %{_docdir}/python-pygame/README.txt
|
||||
%doc %{_docdir}/python-pygame/README.SUSE
|
||||
%{python_sitearch}/*
|
||||
%files %{python_files}
|
||||
%defattr(-,root,root)
|
||||
%doc LGPL WHATSNEW readme.html readme.rst
|
||||
%{python_sitearch}/pygame/
|
||||
%{python_sitearch}/pygame-%{version}-py*.egg-info
|
||||
|
||||
%files doc
|
||||
%defattr(644,root,root,755)
|
||||
%doc %{_docdir}/python-pygame/docs
|
||||
%doc %{_docdir}/python-pygame/examples
|
||||
%files %{python_files devel}
|
||||
%defattr(-,root,root)
|
||||
%doc LGPL
|
||||
%{python_sysconfig_var INCLUDEPY}/pygame/
|
||||
|
||||
%files devel
|
||||
%defattr(644,root,root,755)
|
||||
%{py_incdir}/pygame/
|
||||
%files -n %{name}-doc
|
||||
%defattr(-,root,root)
|
||||
%doc LGPL
|
||||
%doc docs/
|
||||
%doc examples/
|
||||
|
||||
%changelog
|
||||
|
Reference in New Issue
Block a user