File kmquake2.spec of Package kmquake2
#
# spec file for package kmquake2
#
# Copyright (c) 2022, 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: kmquake2
Version: 0.20+git20221008
Release: 0
Summary: Enhanced Quake 2 Source Port
License: GPL-2.0-only
Group: Amusements/Games/3D/Shoot
URL: http://www.markshan.com/knightmare/
#Git-Clone: https://bitbucket.org/Knightmare66/kmquake2_stable.git
Source: %{name}-%{version}.tar.xz
Patch0: x.patch
BuildRequires: pkgconfig
BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(libjpeg)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(ogg)
BuildRequires: pkgconfig(sdl2)
BuildRequires: pkgconfig(vorbisfile)
BuildRequires: pkgconfig(zlib)
### FIXME: HACK to workaround:
#[ 6s] kmquake2.x86_64: E: executable-stack (Badness: 10000) /usr/bin/kmquake2
#[ 6s] The binary declares the stack as executable. Executable stack is usually an
#[ 6s] error as it is only needed if the code contains GCC trampolines or similar
#[ 6s] constructs which uses code on the stack. One common source for needlessly
#[ 6s] executable stack cases are object files built from assembler files which don't
#[ 6s] define a proper .note.GNU-stack section.
BuildRequires: execstack
%description
KMQuake2 is a source port for the Quake 2 game. Originally it has been started
to extend the engine limits for in-game map sizes, entities count, sounds,
drawing distance and so on. Later, improved particle system, clipped decals,
stencil shadows and lightning effects have been added, making this port one of
the most visually advanced ports produced for the Quake 2.
NOTE:
copy the quake2 gamedata files (pak0-3) to
~/.local/share/quake2/baseq2/
HIRES maps + other stuff
http://www.markshan.com/knightmare/downloads.htm
%prep
%setup -q
%patch0 -p1
%build
# FIXME: use distro CFLAGS
%make_build \
release \
BUILD_DATADIR=NO \
BUILD_GAME=YES \
BUILD_KMQUAKE2=YES \
BUILD_KMQUAKE2_DEDICATED=NO \
BUILD_LIBDIR=no
%install
# HACK
execstack -c ./quake2/kmquake2
#
q2dir="%{buildroot}%{_libexecdir}/%{name}"
install -Dpm 755 quake2/kmquake2 $q2dir/kmquake2
install -Dpm 755 quake2/baseq2/kmq2gamex64.so $q2dir/baseq2/kmq2gamex64.so
#
install -d %{buildroot}%{_bindir}
cat > %{buildroot}%{_bindir}/kmquake2 << EOF
#!/bin/sh
cd %{_libexecdir}/kmquake2/
./kmquake2 "\$@"
EOF
%files
%license gnu.txt
%doc kmquake2_changelog.txt kmquake2_lazarus.txt kmquake2.txt kmq2_*_scripting.txt readme.txt
%attr(0755,root,root) %{_bindir}/kmquake2
%{_libexecdir}/%{name}
%changelog