File fofix.spec of Package fofix

#
# spec file for package fofix
#
# Copyright (c) 2013 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 http://bugs.opensuse.org/
#


Name:           fofix
Version:        3.121
Release:        0
Summary:        Frets on Fire X - A multi-OS rhythm game
License:        GPL-2.0
Group:          Amusements/Games/Other
Url:            http://code.google.com/p/fofix/
Source:         %{name}-3.121.tar.bz2
BuildRequires:  dos2unix
BuildRequires:  fdupes
BuildRequires:  update-desktop-files
Requires:       python-base
Requires:       python-imaging
Requires:       python-numeric
Requires:       python-numpy
Requires:       python-ogg
Requires:       python-opengl
Requires:       python-pygame
Requires:       python-sqlite2
Requires:       python-vorbis
Requires:       python-xml
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
A multi-OS rhythm game, written in Python, similar to Guitar Hero
or Rock Band. Play guitar, bass or drums along with your favorite
songs on your computer using either your keyboard or instruments.
You can use your Guitar Hero or Rock Band instrument controllers.

Separated audio tracks will mute when you fail to hit or sustain
the required notes correctly to simulate a real concert-playing
experience.

Simplified list of features
* Completely Customizable Graphics (standard .PNG format)
* Completely Customizable Sound Effects & Menu Music
* Completely Customizable Fretboard Point Of View (POV)
* Completely Customizable Menus and Layouts
* 2D or 3D Notes & Frets
* 3D Note Texturing
* Unlimited Themes
* Unlimited Necks
* Graphical Neck Selection
* Multiplayer Support with several different game types (2 players
  only for now, battle and cooperative modes)
* Random Stages, Stage Rotation (slideshow) and basic Animated Stages
* Support for seperated song, guitar, bass and drum audio tracks
* Guitar playable & separated track support
* Lead Guitar & Rhythm Guitar playable track support
* Bass Guitar playable & separated track support
* Bass Groove 5x, 6x, 10x, and 12x multiplier support
* Drums playable & separated track support
* Starpower/Overdrive
* Big Rock Endings
* Drum Fills to activate starpower / overdrive
* Native MIDI instrument input / controller support
* Pitch-bending whammy DSP effect
* Songlist metadata caching for faster subsequent load times
* Both digital and analog Killswitch effects
* Jurgen (Computer Player, skilled at guitar / bass / drums)
* Support for Guitar Solos, Bass Solos, and Drum Solos
* Practice mode: single-track, full-speed, selectable start position
* Slowdown mode: single or multiple tracks, 3/4, 1/2 or 1/4 speed
* Tutorial songs (4 so far)
* Customizable HO/POs (including chord pull-offs) and Note Hit Window
* In-Game Status Display
* In-Game Star Score Display
* Optional scrolling or static MIDI / RockBand lyrics
* World high score chart with optional score uploading

%prep
%setup -q
dos2unix     doc/*.txt src/FontTest.py src/DrawingTest.py src/midi/*.txt
chmod 644 doc/*     src/FontTest.py src/DrawingTest.py src/midi/*.txt
dos2unix     AUTHORS ChangeLog COPYING CREDITS README
chmod 644 AUTHORS ChangeLog COPYING CREDITS README

rm    doc/*.chm
rm -r src/scripts

mv "data/themes/MegaLight GH3" data/themes/MegaLight_GH3

find src -name '*.py' | xargs dos2unix
find src -name '*.py' | xargs sed -i -e 's|/usr/bin/env.*python|/usr/bin/python|g'
find src -name '*.py' | xargs chmod 644
chmod 644 src/*.pot

%build
make translations

%install
cat > %{name}.sh << EOF
#!/bin/bash
cd %{_datadir}/%{name}/src
python ./FoFiX.py "\$@"
EOF
install -D -m 755 %{name}.sh %{buildroot}%{_bindir}/%{name}

install -dm 755 %{buildroot}%{_datadir}/%{name}
cp -a data %{buildroot}%{_datadir}/%{name}
cp -a src %{buildroot}%{_datadir}/%{name}
cp -a svg %{buildroot}%{_datadir}/%{name}

# icon
install -dm 755 %{buildroot}%{_datadir}/pixmaps
install -m 644 data/mfhlogo.png %{buildroot}%{_datadir}/pixmaps/%{name}.png

# menu-entry
install -dm 755 %{buildroot}%{_datadir}/applications
cat > %{buildroot}%{_datadir}/applications/%{name}.desktop << EOF
[Desktop Entry]
Name=FoFiX
GenericName=FoFiX
Comment=FoFiX - A multi-OS rhythm game
Exec=%{name}.sh
Icon=%{name}
Terminal=false
Categories=Games;ActionGame;
Type=Application
EOF
%suse_update_desktop_file %{name} Games ActionGame

chmod 755 %{buildroot}%{_datadir}/%{name}/src/svg2png.py
chmod 755 %{buildroot}%{_datadir}/%{name}/src/TestAll.py
chmod 755 %{buildroot}%{_datadir}/%{name}/src/FoFiX.py
chmod 755 %{buildroot}%{_datadir}/%{name}/src/DrawingTest.py
chmod 755 %{buildroot}%{_datadir}/%{name}/src/FontTest.py

%fdupes %{buildroot}%{_datadir}

%files
%defattr(-, root, root)
%doc AUTHORS ChangeLog COPYING CREDITS README
%doc doc
%{_bindir}/%{name}
%{_datadir}/pixmaps/*.png
%{_datadir}/applications/*.desktop
%{_datadir}/%{name}/src/
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/data
%{_datadir}/%{name}/data/*.dae
%{_datadir}/%{name}/data/*.ini
%{_datadir}/%{name}/data/*.png
%{_datadir}/%{name}/data/*.ttf
%{_datadir}/%{name}/data/avatars/
%{_datadir}/%{name}/data/mods/
%dir %{_datadir}/%{name}/data/necks
%{_datadir}/%{name}/data/necks/*.png
%{_datadir}/%{name}/data/po/
%{_datadir}/%{name}/data/shaders/
%dir %{_datadir}/%{name}/data/sounds
%{_datadir}/%{name}/data/sounds/*.ogg
%dir %{_datadir}/%{name}/data/themes
%{_datadir}/%{name}/data/themes/MegaLight/
%{_datadir}/%{name}/data/themes/MegaLight_GH3/
%{_datadir}/%{name}/data/themes/Uberlight/
%dir %{_datadir}/%{name}/data/translations
%{_datadir}/%{name}/data/translations/*.mo
%{_datadir}/%{name}/data/tutorials/
%{_datadir}/%{name}/svg/
%{_datadir}/%{name}/data/users/
%{_datadir}/%{name}/data/vocals/

%changelog