File worminator.spec of Package worminator

#
# spec file for package worminator
#
# Copyright (c) 2021 SUSE LLC
#
# 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:           worminator
Version:        3.0R2.1
Release:        0
Summary:        Sidescrolling platform and shoot 'em up action game
License:        GPL-2.0-or-later
Group:          Amusements/Games/Action/Arcade
URL:            https://sourceforge.net/projects/worminator/
# Downloaded from http://download.sourceforge.net/worminator/worminator-3.0R2.1.tar.gz
# Repacked as .tar.bz2
Source0:        %{name}-%{version}.tar.bz2
Source1:        worminator.desktop
Source2:        worminator.png
Patch0:         worminator-3.0R2.1-speed.patch
Patch1:         fix-math-h.patch
BuildRequires:  allegro-devel
BuildRequires:  fdupes
BuildRequires:  update-desktop-files
Requires:       worminator-data >= %{version}

%description
You play as The Worminator and fight your way through many levels of madness
and mayhem. Worminator features nine unique weapons, visible character damage,
full screen scrolling, sound and music, and much more!

%prep
%setup -q
%patch0 -p1 -z .speed
%patch1 -p1
sed -i 's/\r//' ReadMe.txt

%build
gcc %{optflags} -fsigned-char -Wno-deprecated-declarations \
  -Wno-char-subscripts -DDATADIR=\"%{_datadir}/%{name}/\" -o %{name} \
  Worminator.c `allegro-config --libs` -lm

%install
mkdir -p %{buildroot}%{_bindir}
install -m 0755 %{name} %{buildroot}%{_bindir}

mkdir -p %{buildroot}%{_datadir}/icons/hicolor/32x32/apps
install -m 0644 %{SOURCE2} %{buildroot}%{_datadir}/icons/hicolor/32x32/apps

%suse_update_desktop_file -i %{name} Game ArcadeGame
%fdupes %{buildroot}

%files
%license license.txt
%doc ReadMe.txt changes.unix license-change.txt
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor
%{_datadir}/pixmaps/worminator.png

%changelog
openSUSE Build Service is sponsored by