File puzzletube.spec of Package puzzletube

#
# spec file for package puzzletube
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2018, Martin Hauke <mardnh@gmx.de>
#
# 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:           puzzletube
Version:        0.0.0+git.20170425
Release:        0
Summary:        3D Puzzle Game
License:        GPL-2.0-or-later
Group:          Amusements/Games/Strategy/Other
URL:            http://ziz.gp2x.de/
Source:         %{name}-%{version}.tar.xz
Patch0:         puzzletube-fix-build.patch
BuildRequires:  pkgconfig
BuildRequires:  sparrow3d-devel
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(SDL_image)
BuildRequires:  pkgconfig(SDL_mixer)
BuildRequires:  pkgconfig(SDL_net)
BuildRequires:  pkgconfig(SDL_ttf)
BuildRequires:  pkgconfig(sdl)
Requires:       puzzletube-data = %{version}

%description
This a a puzzle game like many others but this time on a tube. There are
3 game modes explained at beginning. In every mode you have to crush
stones. To crush a stone you have to move at least 4 stones of the same
color to a 2x2 square. This square, every attached stone of the same
color and stones on the other side of the tube with the same color will
explode and you get points. If there is a stone of the same color on the
other side the stone wobbles. If you got a chain reaction you get more
points. How much points you get (and why) is shown on the left side of
the screen.

To get the 2x2 squares you have to change stones. You always switch two
stones around a third one "in the middle". There are 3 modes to switch
two stones, configurable in the settings. In the normal mode you just
press the shown buttons to switch the stones under the buttons.
E.g. on the GP2X A and X switches the stone left of your cursor with the
stone above your cursor.
In the second mode named "Snake" you move with 3 Cursors like a Snake
and the Tail and the Head switch if you press A, B, X or D.
The last and newest mode named "D-Pad" (or similar) is a bit
experimental, but much people seem to like it. You have to press A, B,
C or D, hold it down (!) and with the D-Pad choice a stone to switch.

%package data
Summary:        Architecture independent data for puzzletube
Group:          Amusements/Games/Strategy/Other
Requires:       %{name} = %{version}
BuildArch:      noarch

%description data
This package contains the game data for puzzletube.
It is required to play the game.

%prep
%setup -q
%patch0 -p1
# HACK: Fix path to game-folder
sed -i 's|./images|/usr/share/puzzletube/images|g' *.c translations/translations.txt
sed -i 's|./font|/usr/share/puzzletube/font|g' *.c
sed -i 's|./music|/usr/share/puzzletube/music|g' *.c
sed -i 's|./sounds|/usr/share/puzzletube/sounds|g' *.c
sed -i 's|./translations|/usr/share/puzzletube/translations|g' *.c

%build
export CFLAGS='%{optflags}'
make %{?_smp_mflags}

%install
install -d %{buildroot}/%{_bindir}
install -m0755 puzzletube %{buildroot}/%{_bindir}/puzzletube
#
install -d %{buildroot}/%{_datadir}/puzzletube
cp -r font %{buildroot}/%{_datadir}/puzzletube
cp -r images %{buildroot}/%{_datadir}/puzzletube
#cp -r music %%{buildroot}/%%{_datadir}/puzzletube
cp -r sounds %{buildroot}/%{_datadir}/puzzletube
cp -r translations %{buildroot}/%{_datadir}/puzzletube
##
install -Dm0644 puzzletube.png %{buildroot}/%{_datadir}/pixmaps/puzzletube.png
%suse_update_desktop_file -c %{name} %{name} "3D Puzzle game" %{name} %{name} Game StrategyGame

%if 0%{?suse_version} < 1330
%post
%desktop_database_post

%postun
%desktop_database_postun
%endif

%files
%doc README
%{_bindir}/puzzletube
%{_datadir}/pixmaps/puzzletube.png
%{_datadir}/applications/puzzletube.desktop

%files data
%{_datadir}/puzzletube

%changelog
openSUSE Build Service is sponsored by