File fretsonfire.spec of Package fretsonfire

#
# spec file for package fretsonfire
#
# Copyright (c) 2021 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


Name:           fretsonfire
Version:        1.3.110
Release:        0
Summary:        A game of musical skill and fast fingers
License:        GPL-2.0-or-later
Group:          Amusements/Games/Action/Arcade
URL:            http://fretsonfire.sourceforge.net/
Source:         %{name}-%{version}.tar.bz2
Source1:        %{name}.desktop
NoSource:       0
Patch0:         %{name}-%{version}.patch
Patch1:         %{name}-%{version}-font-revert.patch
Patch2:         %{name}-%{version}-keep_sound_when_failed.patch
Patch3:         %{name}-%{version}-typeerror.patch
Patch4:         %{name}-%{version}-settings.patch
Patch5:         %{name}-%{version}-song-chooser.patch
Patch6:         pillow.patch
BuildRequires:  fdupes
BuildRequires:  python
BuildRequires:  update-desktop-files
Requires:       python2-Pillow
Requires:       python-numpy
Requires:       python-ogg
Requires:       python-opengl
Requires:       python-pygame
Requires:       python-vorbis
BuildArch:      noarch
# Upstream does not provide updates or maintenance anymore (since ~2008)
# Use FoFiX instead
Provides:       deprecated()

%description
Frets on Fire is a game of musical skill and fast fingers. The aim of the game is to play guitar with the keyboard as accurately as possible.

%prep
%setup -q
%patch0
%patch1
%patch2
%patch3
%patch4
%patch5
%patch6 -p1
# remove unused files
rm -f MANIFEST* Makefile PKG-INFO install.txt setup.cfg setup.py
rm -rf Frets_on_Fire.egg-info
rm -f data/*.svg data/*.pyc data/Makefile data/*.ico data/*.icns data/*.sh
rm -f data/mods/*/*.svg
rm -f data/songs/*.sh data/songs/*/*.svg
rm -rf data/translations/old data/translations/*.po data/translations/*.py data/win32 doc
rm -f src/*.pot src/midi/*.txt src/TestAll.py src/[rs]*.py
# fix attributes of files
chmod -x copying.txt data/*.png data/songs/*/*

%build
# compile scripts
python -mcompileall .

%install
mkdir -p %{buildroot}%{_datadir}/%{name}
cp -a data %{buildroot}%{_datadir}/%{name}
cp -a src/* %{buildroot}%{_datadir}/%{name}
mkdir -p %{buildroot}%{_bindir}
ln -s %{_datadir}/%{name}/FretsOnFire.py %{buildroot}%{_bindir}/fretsonfire
install -D -m 0644 data/icon.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
%suse_update_desktop_file -i %{name} Game ArcadeGame
%fdupes %{buildroot}

%files
%license copying.txt
%doc readme.txt todo.txt
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png

%changelog
openSUSE Build Service is sponsored by