File vodovod.spec of Package vodovod
#
# spec file for package vodovod
#
# Copyright (c) 2014 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/
#
%define _lver 1.10
%define _svnrev svn23
Name: vodovod
Version: %{_lver}_%{_svnrev}
Release: 0
Summary: Cross-platform pipe connecting action puzzle game
License: GPL-2.0+
Group: Amusements/Games/Arcade/Logic
Url: http://home.gna.org/vodovod/
Source0: %{name}-%{_lver}+%{_svnrev}.tar.bz2
Source1: %{name}.png
Source2: %{name}.desktop
# Fix bad C++ code
Patch0: %{name}-%{_lver}-hiscore.h.patch
%if 0%{?suse_version}
BuildRequires: fdupes
BuildRequires: update-desktop-files
%endif
BuildRequires: gcc-c++
BuildRequires: pkgconfig(SDL_image)
BuildRequires: pkgconfig(SDL_mixer)
BuildRequires: pkgconfig(SDL_ttf)
BuildRequires: pkgconfig(sdl)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
The goal of the game is to reach the highest possible score. You get a limited
number of pipes on each level and need to combine them to lead the water from
the house at the top of the screen to the storage tank at the bottom. For each
pipe water goes through, you get 20 points and if you fill the cross-pipe both
ways, you get 60 points. At end of each level, you are awarded depending on the
skill level:
* Beginner: 100 points
* Toolman: 100 points + number of pipes remaining
* Master plumber: 100 points + 2 x number of pipes remaining
Some of the levels also have obstacles where you cannot place pipes. The game
is playable with joystick/joypad: just move it and press buttons when you go to
Options -> Configure controls
%prep
%setup -q -n %{name}-svn
%patch0
# Fix path
sed -i 's|= /usr/local|= /usr|' Makefile
%build
make %{?_smp_mflags} CXXFLAGS="%{optflags}"
%install
%make_install
%find_lang %name
# install icons
install -Dm 0644 icon.ico %{buildroot}%{_datadir}/%{name}
install -Dm 0644 %{S:1} %{buildroot}/%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
# install Desktop file
install -Dm 0644 %{S:2} %{buildroot}%{_datadir}/applications/%{name}.desktop
# install score
mkdir -p %{buildroot}%{_localstatedir}/games/
touch %{buildroot}%{_localstatedir}/games/%{name}.sco
%if 0%{?suse_version}
%suse_update_desktop_file %{name}
%fdupes -s %{buildroot}%{_prefix}
%endif
%files -f %name.lang
%defattr(-,root,root,-)
%doc CHANGES COPYING html
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/
%{_datadir}/%{name}
# Correct Permissions
%attr(0664,games,games) %{_localstatedir}/games/%{name}.sco
%changelog