File pacewar.spec of Package pacewar

#
# spec file for package pacewar
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2018, 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:           pacewar
Version:        1.6.7
Release:        0
Summary:        A simple fighting game between two teams of space ships
License:        GPL-3.0-or-later
Group:          Amusements/Games/Action/Arcade
URL:            https://pacewar.github.io/
Source:         https://github.com/pacewar/pacewar/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0:         data-path.patch
BuildRequires:  fdupes
BuildRequires:  update-desktop-files
Requires:       python3-pygame >= 1.9.1
Requires:       python3-sge-pygame >= 1.4
BuildArch:      noarch

%description
Pacewar is a relatively simple fighting game between two teams of space
ships. A team wins the round when all ships of the other team are
destroyed, and a certain number of victories more than the other player
is needed to win the game. But there's a catch: as a team gets closer
to winning, it loses ships, so you need to be better than the other
team to succeed.

Human players take over one ship at a time from their respective teams.
If a human player's ship is destroyed, that human player takes over an
AI ship from their team randomly. This ensures that the human players
are always in the game.

%prep
%autosetup -p1
sed -e 's|DATA = None|DATA = "%{_datadir}/%{name}"|' \
    -e 's|env python|python|' \
    -i pacewar.py
sed -i 's|\r||' README.txt

%build

%install
# Install data
install -D -m0755 pacewar.py %{buildroot}%{_datadir}/%{name}/pacewar.py
cp -Rav data/ %{buildroot}%{_datadir}/%{name}
# Install link to program
install -d %{buildroot}/%{_bindir}
ln -s %{_datadir}/%{name}/pacewar.py %{buildroot}/%{_bindir}/%{name}
# Install icon
install -D -m0644 data/images/icon.png %{buildroot}/%{_datadir}/pixmaps/%{name}.png
# Instal .desktop file
%suse_update_desktop_file -c %{name} %{name} "A simple spaceship fighting game" %{name} %{name} Game ArcadeGame
%fdupes -s %{buildroot}/%{_datadir}

%files
%doc README.txt
%license COPYING
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/applications/%{name}.desktop

%changelog
openSUSE Build Service is sponsored by