%global namex pyglet %global versionx 1.2 %global versionedname %{namex}-%{versionx}alpha1 Name: %{namex} Version: %{versionx} Release: 0.3.alpha1%{?dist} Summary: A cross-platform windowing and multimedia library for Python # The entire source code is BSD except pyglet/image/codecs/pypng.py which is # under both BSD and MIT License: BSD and MIT URL: http://www.pyglet.org/ # The upstream tarball includes some non-free files in the examples and tests, # and a patented texture compression algorithm. # Run the following (in rpmbuild/SOURCES) to generate the distributed tarball: # $ sh pyglet-get-tarball.sh pyglet-1.2alpha1 # See the script for details. Source0: %{versionedname}-repacked.tar.gz Source1: pyglet-get-tarball.sh BuildArch: noarch BuildRequires: python2-devel Requires: python %if 0%{?fedora} <= 18 Requires: python-imaging%{?_isa} %else Requires: python-pillow%{?_isa} %endif # The libraries are imported dynamically using ctypes, so rpm can't find them. Requires: libGL Requires: libX11 %description This library provides an object-oriented programming interface for developing games and other visually-rich applications with Python. pyglet has virtually no external dependencies. For most applications and game requirements, pyglet needs nothing else besides Python, simplifying distribution and installation. It also handles multiple windows and fully aware of multi-monitor setups. pyglet might be seen as an alternative to PyGame. %prep %setup -q -n %{versionedname} # Remove the bundled pypng library python-pillow provides the same functionality) rm pyglet/image/codecs/png.py rm pyglet/image/codecs/pypng.py # Get rid of hashbang lines. This is a library, it has no executable scripts. # Also remove Windows newlines find . -name '*.py' | xargs sed --in-place -e's|#!/usr/bin/\(env \)\?python||;s/\r//' %build %{__python} setup.py build %install %{__python} setup.py install --skip-build --root %{buildroot} %files %doc LICENSE %doc CHANGELOG %doc README %doc NOTICE %doc PKG-INFO %{python_sitelib}/%{versionedname}-py2.7.egg-info %{python_sitelib}/%{name} %changelog * Thu Mar 07 2013 Petr Viktorin - 1.2-0.3.alpha1 - Replace dos2unix by an additional sed command - Remove bundled pypng, replace by a dependency in python-pillow * Fri Oct 19 2012 Petr Viktorin - 1.2-0.1.alpha1 - initial version of package