File freesynd.spec of Package freesynd

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


Name:           freesynd
Version:        0.7.5
Release:        0
Summary:        Reimplementation of the classic Bullfrog game Syndicate
License:        GPL-2.0
Group:          Amusements/Games/Strategy/Real Time
Url:            http://freesynd.sourceforge.net/
Source:         http://downloads.sourceforge.net/project/%{name}/%{name}/%{name}-%{version}/%{name}-%{version}.tar.gz
Source2:        http://freesynd.sourceforge.net/images/freesynd-logo.svg
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig(SDL_mixer)
BuildRequires:  pkgconfig(SDL_image)
BuildRequires:  pkgconfig(libpng)
BuildRequires:  pkgconfig(zlib)
BuildRequires:  hicolor-icon-theme
BuildRequires:  update-desktop-files
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
FreeSynd is a cross-platform, free software reimplemented engine
for the classic Bullfrog game, Syndicate.

The game assets from an original copy of Syndicate are required to play.

%prep
%setup -q

%build
%cmake
make %{?_smp_mflags}

%install
%cmake_install

## install new icon and desktop file
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
cp %{SOURCE2} %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/freesynd.svg

mkdir -p %{buildroot}%{_datadir}/applications/
cat > %{buildroot}%{_datadir}/applications/freesynd.desktop << EOF
[Desktop Entry]
Type=Application
Name=FreeSynd
GenericName=Tactical RPG
Icon=freesynd
Terminal=false
Exec=freesynd
Categories=Game;RolePlaying;
EOF

%post
%icon_theme_cache_post
%desktop_database_post

%postun
%icon_theme_cache_postun
%desktop_database_postun

%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README TODO.txt
%{_bindir}/freesynd
%{_datadir}/freesynd/
%{_datadir}/freesynd/data/
%{_datadir}/freesynd/data/cursors/
%{_datadir}/freesynd/data/lang/
%{_datadir}/freesynd/data/music/
%{_datadir}/freesynd/data/ref/
%{_datadir}/icons/hicolor/scalable/apps/freesynd.svg
%{_datadir}/applications/freesynd.desktop

%changelog
openSUSE Build Service is sponsored by