File python3-pygame.spec of Package python3-pygame
#
# spec file for package python3-pygame
#
# 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
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define _lver 1.9.2
%define _hgrev hg3425
%define oname pygame
Name: python3-pygame
Version: %{_lver}+%{_hgrev}
Release: 0
Summary: Python3 Module for Interfacing with the SDL Multimedia Library
License: LGPL-2.1+
Group: Development/Libraries/Python
Url: http://www.pygame.org/
# Downloaded from https://bitbucket.org/pygame/pygame/wiki/VersionControl
# Packed as tar.bz2
Source0: %{oname}-%{_lver}+%{_hgrev}.tar.bz2
Source1: %{name}.rpmlintrc
%if 0%{?suse_version}
BuildRequires: fdupes
%endif
BuildRequires: dos2unix
BuildRequires: freetype2-devel
BuildRequires: libavformat-devel
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: libswscale-devel
BuildRequires: libv4l-devel
BuildRequires: pkgconfig
BuildRequires: python3-devel
BuildRequires: python3-numpy-devel
BuildRequires: xorg-x11
BuildRequires: pkgconfig(SDL_image)
BuildRequires: pkgconfig(SDL_mixer)
BuildRequires: pkgconfig(SDL_ttf)
BuildRequires: pkgconfig(zlib)
%if 0%{?suse_version} >= 1320
BuildRequires: portmidi-devel
%endif
Requires: python3-numpy
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Pygame is a cross-platfrom library designed to make it easy to write
multimedia software, such as games, in Python. Pygame requires
the Python language and SDL multimedia library.
It can also make use of several other popular libraries.
%package doc
Summary: Documentation and example programs for the Pygame
Group: Development/Libraries/Python
BuildArch: noarch
Requires: %{name} = %{version}
%description doc
Pygame is a cross-platfrom library designed to make it easy to write
multimedia software, such as games, in Python. Pygame requires
the Python language and SDL multimedia library.
It can also make use of several other popular libraries.
Documentation and Example programs for the package python3-pygame.
%package devel
Summary: Pygame development package
Group: Development/Libraries/Python
Requires: %{name} = %{version}
%description devel
Pygame is a cross-platfrom library designed to make it easy to write
multimedia software, such as games, in Python. Pygame requires
the Python language and SDL multimedia library.
It can also make use of several other popular libraries.
The python3-pygame-devel package contains header files for
developing applications that use python3-pygame.
%prep
%setup -q -n %{oname}
# Some docs have the DOS line ends
dos2unix docs/reST/ref/code_examples/joystick_calls.py \
docs/reST/ref/code_examples/draw_module_example.py
# SED-FIX-OPENSUSE -- Fix version
sed -i -e 's|1.9.2a0|%{_lver}|' setup.py
# SED-FIX-OPENSUSE -- Fix paths
sed -i -e 's|/usr/X11R6/include|/usr/include|' config_unix.py
# Remove not needed files
rm -fr examples/macosx
%build
yes y | python3 -d config.py
python3 setup.py build
%install
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
%check
python3 setup.py test
%if 0%{?suse_version}
%fdupes -s %{buildroot}%{_prefix}
%endif
%files
%defattr(-,root,root,-)
%{python3_sitearch}/%{oname}
%{python3_sitearch}/%{oname}-%{_lver}-py%{py3_ver}.egg-info
%files doc
%defattr(-,root,root,-)
%doc docs examples PYTHON3 WHATSNEW readme.html readme.rst
%files devel
%defattr(-,root,root,-)
%{_includedir}
%changelog