File Minilens.spec of Package Minilens

#
# spec file for package Minilens
#
# Copyright (c) 2016 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/
#

Name:           Minilens
Version:        1.2
Release:        0
# Code is GPLv3+, Music CC-BY-SA 4.0
%if 0%{?suse_version} == 1310
License:        GPL-3.0+ and SUSE-Freeware
%else
License:        GPL-3.0+ and CC-BY-SA-4.0
%endif
Summary:        Libre puzzle platform game
Url:            https://kobuge-games.github.io/minilens/
Group:          Amusements/Games/Other
Source :        https://github.com/KOBUGE-Games/minilens/archive/v%{version}/%{name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM fix-screen-resizing.patch -- https://github.com/KOBUGE-Games/minilens/commit/ca74fb82ea53d00ff5abb5a3a2b908681f74bd21
Patch0:         fix-screen-resizing.patch
BuildRequires:  update-desktop-files
BuildRequires:  fdupes
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       godot >= 2.0
BuildArch:      noarch

%description
Free Puzzle Platform Game
1000 years after post-apocalyptic Earth, many form of lifes went extinct, including humans.
An alien robot series, called Minilens, are cleaning up earth and collecting surviving flora.
The game is won by destroying all Radioactive Barrels and collecting surviving flora.
The drawback is that Minilens can't jump.

%prep
%autosetup -p1 -n minilens-%{version}

%build

%install
# Install game files
install -dm755 %{buildroot}%{_datadir}/%{name}
cp -R -t %{buildroot}%{_datadir}/%{name} *

# Install License and Readme (for legal reasons is the very important)
install -d -m755 %{buildroot}%{_docdir}/%{name}
install -m644 -t %{buildroot}%{_docdir}/%{name} README.md LICENSE.txt CREDITS.txt

# Install Gamewrapper
install -dm755 %{buildroot}%{_bindir}
cat > %{buildroot}%{_bindir}/%{name} << EOF
#!/bin/sh
godot -path "%{_datadir}/%{name}" $@
EOF
chmod 755 %{buildroot}%{_bindir}/%{name}

# Install Icon and Desktop files
install -dm755  %{buildroot}%{_datadir}/pixmaps
install -m644   icon.png  %{buildroot}%{_datadir}/pixmaps/%{name}.png
install -dm755 %{buildroot}%{_datadir}/applications
%suse_update_desktop_file -c %{name} %{name} "Libre puzzle platform game" %{name} %{name} Game LogicGame

# Remove duplicates
%fdupes %{buildroot}%{_datadir}

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

%changelog
openSUSE Build Service is sponsored by