File dave_gnukem.spec of Package dave_gnukem
#
# spec file for package dave_gnukem
#
# Copyright (c) 2020 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/
#
%define data_version 1.0
Name: dave_gnukem
Version: 1.0.1
Release: 0
Summary: A 2D scrolling platform shooter
License: GPL-2.0-or-later OR MIT
Group: Amusements/Games/Action/Arcade
URL: https://github.com/davidjoffe/dave_gnukem
#Git-Clone: https://github.com/davidjoffe/dave_gnukem.git
Source: https://github.com/davidjoffe/dave_gnukem/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: https://github.com/davidjoffe/gnukem_data/archive/v%{data_version}.tar.gz#/%{name}-data-%{data_version}.tar.gz
Source2: %{name}-wrapper.sh
Patch0: dave_gnukem-fix-build.patch
Patch1: dave_gnukem-dont-link-against-sdl_main.patch
BuildRequires: ImageMagick
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: pkgconfig
BuildRequires: update-desktop-files
BuildRequires: pkgconfig(SDL_mixer)
BuildRequires: pkgconfig(sdl)
Requires: %{name}-data = %{version}
%description
Dave Gnukem is a retro-style 2D scrolling platform shooter similar to,
and inspired by, Duke Nukem 1 (~1991).
The original Duke Nukem 1 had 16-color EGA 320x200 graphics; the aim
here is 'similar but different' gameplay and 'look and feel'.
It is kind of a parody of the original.
Please note it is not a 'clone', and not a 're-make'.
%package data
Summary: Architecture independent data for %{name}
Group: Amusements/Games/Action/Arcade
Requires: %{name} = %{version}
BuildArch: noarch
%description data
This package contains the game data for %{name}.
It is required to play the game.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
mkdir -p data
tar xzvf %{SOURCE1} -C data --strip-components=1
convert -strip -resize 48x48 data/icon.bmp %{name}.png
%build
export CCFLAGS="%{optflags}"
make %{?_smp_mflags}
%install
install -D -m0755 davegnukem %{buildroot}/%{_libexecdir}/%{name}/%{name}
install -D -m0755 %{SOURCE2} %{buildroot}/%{_bindir}/%{name}
install -D -m0644 %{name}.png %{buildroot}/%{_datadir}/pixmaps/%{name}.png
install -d %{buildroot}/%{_datadir}/%{name}
cp -r data/ %{buildroot}/%{_datadir}/%{name}
%suse_update_desktop_file -c %{name} %{name} "Dave Gnukem - A Duke Nukem parody" %{name} %{name} Game ArcadeGame
%fdupes -s %{buildroot}%{_datadir}
%if 0%{?suse_version} < 1330
%post
%desktop_database_post
%postun
%desktop_database_postun
%endif
%files
%doc HISTORY.txt README.md
%license COPYING MIT-LICENSE.txt
%{_bindir}/%{name}
%dir %{_libexecdir}/%{name}
%{_libexecdir}/%{name}/%{name}
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/applications/%{name}.desktop
%files data
%{_datadir}/%{name}
%changelog