Name: serioussam
Version: 1.10.6d
Release: 1%{?dist}

Summary: Linux port of Serious Sam Classic
License: GPLv2
SourceLicense: GPLv2+ with Bison-1.24 exception, GPLv2
Group: Games

URL: https://github.com/tx00100xt/SeriousSamClassic
BugURL: https://github.com/tx00100xt/SeriousSamClassic/issues
# The archive from salsa.debian.org is used,
# which has been tested by licenserecon and lintian
Source0: https://salsa.debian.org/tx00100xt/%{name}/-/archive/%{version}+dfsg/%{name}-%{version}+dfsg.tar.gz
Patch1: 0001-serioussam-desktop-file.patch
Patch2: 0002-serioussam-CMakeLists.txt.patch
Patch3: 0003-serioussam-Engine.cpp.patch
Patch4: 0004-serioussam-Engine.h.patch
Patch5: 0005-serioussam-Stream.patch
Patch6: 0006-serioussam-Fix-spelling-error-in-binary.patch
Patch7: 0007-serioussam-SeriousSam.cpp.patch
Patch8: 0008-serioussam-Menu.cpp.patch
Patch9: 0009-serioussam-Game.cpp.patch
Patch10: 0010-serioussam-Types.h.patch
Patch11: 0011-serioussam-manpages.patch

BuildRequires: sed gawk cmake nasm bison flex zlib-devel libogg-devel libvorbis-devel
BuildRequires: gcc-c++ SDL2-devel ImageMagick libvorbis-devel
Requires: SDL2 zlib libogg libvorbis

%description
serioussam - is open source game engine version developed by Croteam for
Serious Sam Classic, but it should work on (or be easily portable to)
any system that supports OpenGl 1.3 and SDL2.

Note that while the Serious Engine source code has been released under GPL, 
you still need to legally own the game and provide Serious Sam Classic 
the game data to play.

%prep
%autosetup -p1 -n %{name}-%{version}+dfsg

%build
%cmake
%cmake_build

%install
%cmake_install

%files
%license LICENSE
%{_bindir}/serioussam*
%{_libdir}/serioussam*
%{_mandir}/man6/serioussam*
%{_datadir}/metainfo/io.github.tx00100xt.serioussam.appdata.xml
%{_datadir}/applications/io.github.tx00100xt.serioussam*
%{_datadir}/icons/hicolor/*

%post
update-desktop-database

%postun
update-desktop-database

%changelog
* Fri Mar 29 2024 Alexander Pavlov <t.x00100x.t@yandex.ru> 1.10.6d
- Initial packaging.