File 7kaa.spec of Package 7kaa

#
# spec file for package 7kaa
#
# 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/
#


# See also http://en.opensuse.org/openSUSE:Specfile_guidelines

Name:           7kaa
Version:        2.14.5
Release:        0
Summary:        Seven Kingdoms: Ancient Adversaries
License:        GPL-2.0
Group:          Amusements/Games/StrategyGame
Url:            http://7kfans.com/
Source0:        http://sourceforge.net/projects/skfans/files/7KAA%20%{version}/%{name}-%{version}.tar.bz2
# PATCH-FIX-OPENSUSE - 7kaa-2.14.5.patch -- https://github.com/the3dfxdude/7kaa/issues/48
Patch0:         %{name}-2.14.5.patch
# PATCH-FIX-UPSTREAM - patch buffer overflow due to wrong size assumptions
Patch1:         %{name}-2.14.5_overflow.patch
Patch2:         gcc6_char_cast.patch
Source1:        %{name}.png
Source2:        %{name}.desktop
%if 0%{?suse_version}
BuildRequires:  fdupes
BuildRequires:  update-desktop-files
%endif
BuildRequires:  enet-devel
BuildRequires:  gcc-c++
BuildRequires:  openal-soft-devel
BuildRequires:  pkgconfig(sdl2)
Recommends:     %{name}-music
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Seven Kingdoms made departures from the traditional real-time strategy models
of "gather resources, build a base and army, and attack". The economic model
bears more resemblance to a turn-based strategy game. It features an espionage
system that allows players to train and control spies individually, who each
have a spying skill that increases over time. The player is also responsible
for catching spies in their own kingdom. Inns built within the game allow
players to hire mercenaries of various occupations, skill levels, and races.
Skilled spies of enemy races are essential to a well-conducted espionage
program, and the player can bolster his forces by grabbing a skilled fighter
or give ones own factories, mines, and towers of science, a boost by hiring a
skilled professional.

Enlight Software decided to release the game to the Open Source community
in August 2009. At that time everything, but the music, was released under
the GPL v2.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1

%build
export CXXFLAGS="%{optflags} -fno-strict-aliasing"
%configure --docdir=%{_docdir}/%{name}
make %{?_smp_mflags}

%install
%make_install

# install icon
install -Dm 0644 %{S:1} %{buildroot}%{_datadir}/pixmaps/%{name}.png

# install Desktop file
install -Dm 0644 %{S:2} %{buildroot}%{_datadir}/applications/%{name}.desktop

%if 0%{?suse_version}
    %suse_update_desktop_file %{name}
    %fdupes -s %{buildroot}%{_prefix}
%endif

%files
%defattr(-,root,root)
%doc COPYING README
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/%{name}

%changelog