File sienna.spec of Package sienna

#
# spec file for package sienna
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2019, 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 https://bugs.opensuse.org/
#


Name:           sienna
Version:        1.0d
Release:        0
Summary:        A one-button platformer game
License:        Zlib AND MIT AND CC-BY-SA-3.0
Group:          Amusements/Games/Action/Other
URL:            http://tangramgames.dk/games/sienna/
Source0:        https://github.com/SimonLarsen/%{name}/archive/v%{version}.tar.gz
BuildRequires:  ImageMagick
BuildRequires:  hicolor-icon-theme
BuildRequires:  love >= 0.10.0
BuildRequires:  update-desktop-files
BuildRequires:  zip
Requires:       love >= 0.10.0
BuildArch:      noarch

%description
Sienna is a simple, albeit frustrating, one-button platformer.

%prep
%setup -q

%build
zip -X %{name}_%{version}.love `find -type f | sort` -x LICENCE.txt README.md

%install
cat >"%{name}" <<-EOF
	#!/bin/sh
	exec love %{_datadir}/%{name}/%{name}_%{version}.love
EOF
install -D -m 0644 %{name}_%{version}.love %{buildroot}%{_datadir}/%{name}/%{name}_%{version}.love
install -D -m 0755 %{name} %{buildroot}%{_bindir}/%{name}

# Install icons and desktop
for size in 256 128 96 64 48 32 16; do
    mkdir -p %{buildroot}%{_datadir}/icons/hicolor/$size"x$size/apps"
    convert -strip art/titlescreen.png -resize "$size"x"$size" %{buildroot}%{_datadir}/icons/hicolor/$size"x$size/apps/%{name}.png"
done
%suse_update_desktop_file -c %{name} "A simple one-button platformer game" "Arcade 2D Actiongame" %{name} %{name} Game ArcadeGame

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

%if 0%{?suse_version} < 1330
%postun
%desktop_database_postun
%icon_#theme_cache_postun
%endif

%files
%license LICENCE.txt
%doc README.md
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png

%changelog
openSUSE Build Service is sponsored by