LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File Tanks-of-Freedom.spec of Package Tanks-of-Freedom (Project games)

#
# spec file for package Tanks-of-Freedom
#
# 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/
#


%define rel_ver   0.5.0
%define rel_state beta
Name:           Tanks-of-Freedom
Version:        %{rel_ver}+%{rel_state}
Release:        0
Summary:        Indie Turn Based Strategy Game
# Code is MIT, Fonts OFL, Assets CC-BY-SA 4.0
%if 0%{?suse_version} != 1310
License:        MIT and OFL-1.1 and CC-BY-SA-4.0
%else
License:        MIT and OFL-1.1 and SUSE-Freeware
%endif
Group:          Amusements/Games/Strategy/Turn Based
Url:            http://tof.p1x.in/
Source0:        https://github.com/w84death/Tanks-of-Freedom/archive/%{rel_ver}-%{rel_state}/%{name}-%{rel_ver}-%{rel_state}.tar.gz
BuildRequires:  fdupes
BuildRequires:  hicolor-icon-theme
BuildRequires:  update-desktop-files
Requires:       godot >= 2.0
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
Classic turn-based strategy game with two armies fighting against each other.
Challenge yourself in campaign against AI or hot-seat battle with a friend.
Using easy map editor you can create any imaginable scenario to play and
share online for others to discover!

%prep
%setup -q -n %{name}-%{rel_ver}-%{rel_state}

%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.md PORT.md CHANGELOG.md

# 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}/icons/hicolor
for size in 16 24 32 48 128 256; do
    install -Dm644 "assets/icons/icon$size".png "%{buildroot}%{_datadir}/icons/hicolor/$size"x"$size/apps/%{name}.png"
done
%if 0%{?suse_version} > 1320 || 0%{?suse_version} == 1315
	install -Dm644 assets/icons/icon512.png "%{buildroot}%{_datadir}/icons/hicolor/512x512/apps/%{name}.png"
%endif
install -dm755   %{buildroot}%{_datadir}/applications
%suse_update_desktop_file -c %{name} %{name} "Indie Turn Based Strategy Game" %{name} %{name} Game StrategyGame

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

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

%changelog