File slune.spec of Package slune
#
# spec file for package slune
#
# Copyright (c) 2016 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/
#
Name: slune
Version: 1.0.15
Release: 0
Summary: A multiplayer 3D racing and car-crashing game
License: GPL-2.0
Group: Amusements/Games/3D/Race
Url: http://home.gna.org/oomadness/en/slune/index.html
Source: http://download.gna.org/slune/Slune-%{version}.tar.bz2
BuildRequires: update-desktop-files
BuildRequires: hicolor-icon-theme
BuildRequires: python-devel
BuildRequires: fdupes
Requires: python-pygame
Requires: python
Requires: python-py2play
Requires: python-pyopenal
Requires: soya >= 0.14
Requires: python-pyvorbis
Requires: python-tk
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
A 3D racing and car-crashing game in Python, with multiplayer mode.
In this game, Gnu and Tux must provide AIDS medicine for Africa.
Includes a multiplayer mode.
%prep
%setup -q -n Slune-%{version}
#(eandry) pt .mo file is not provided in 1.0.15 because of empty .po (check if still valid with new versions)
rm -rf locale/pt
%build
python setup.py build
%install
python setup.py install --root=%{buildroot} \
--install-purelib %{_datadir} \
--install-scripts %{_bindir} \
--install-data %{_datadir} \
--no-lang
mkdir -p %{buildroot}%{_datadir}/applications
cat > %{buildroot}%{_datadir}/applications/%{name}.desktop << EOF
[Desktop Entry]
Name=Slune
Comment=%{summary}
Exec=%{name}
Icon=%{name}
Terminal=false
Type=Application
Categories=Game;ActionGame;
StartupNotify=true
Encoding=UTF-8
EOF
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/16x16/apps
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/32x32/apps
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/48x48/apps
install -p -m 644 ./images/slune.16.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/%{name}.png
install -p -m 644 ./images/slune.32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
install -p -m 644 ./images/slune.48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
# install translations
for f in ./locale/*
do install -m644 ./$f/LC_MESSAGES/%{name}.mo -D %{buildroot}%{_datadir}/$f/LC_MESSAGES/%{name}.mo
done
%find_lang %{name}
%fdupes %{buildroot}%{_datadir}
%post
%desktop_database_post
%icon_theme_cache_post
%postun
%desktop_database_postun
%icon_theme_cache_postun
%files -f %{name}.lang
%defattr(-,root,root,-)
%doc README README.fr AUTHORS CHANGES LICENSE manual.fr.pdf
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/*.egg-info
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/16x16/apps/%{name}.png
%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
%changelog