File python-pygame.spec of Package python-pygame

# spec file for package python-pygame
# Copyright (c) 2014 SUSE LINUX Products 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

Name:           python-pygame
Version:        1.9.1
Release:        0
Source1:        README.SUSE
Source2:        python-pygame.rpmlintrc
Patch1:         pygame-v4l-2.6.38.patch
Summary:        A Python Module for Interfacing with the SDL Multimedia Library
License:        LGPL-2.1+
Group:          Development/Libraries/Python
Provides:       pygame = %{version}
Obsoletes:      pygame < %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  SDL_image-devel
BuildRequires:  SDL_mixer-devel
BuildRequires:  SDL_ttf-devel
BuildRequires:  fdupes
BuildRequires:  libjpeg-devel
BuildRequires:  libpng-devel
BuildRequires:  python-devel
BuildRequires:  xorg-x11
%if 0%{?suse_version} > 1110
BuildRequires:  python-numpy
BuildRequires:  python-numeric
%if 0%{?suse_version} >= 1210
BuildRequires:  libv4l-devel >= 0.8.4
%if 0%{?suse_version} >= 1320
BuildRequires:  portmidi-devel

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,
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
Requires:       python-pygame = %{version}

%description devel
This package contains the header files for developers of Pygame.

%setup -q -n pygame-%{version}release
%if 0%{?suse_version} >= 1210

export CFLAGS="$RPM_OPT_FLAGS -Wall -fno-strict-aliasing"
yes y | python -d
python build

python 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

%fdupes -s %{buildroot}%{_prefix}

%doc %dir %{_docdir}/python-pygame
%doc %{_docdir}/python-pygame/WHATSNEW
%doc %{_docdir}/python-pygame/README.txt
%doc %{_docdir}/python-pygame/README.SUSE

%files doc
%doc %{_docdir}/python-pygame/docs
%doc %{_docdir}/python-pygame/examples

%files devel