File yamagi-quake2-xatrix.spec of Package yamagi-quake2-xatrix
#
# spec file for package yamagi-quake2-xatrix
#
# Copyright (c) 2025 SUSE LLC and contributors
# Copyright (c) 2016-2025, 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: yamagi-quake2-xatrix
Version: 2.16
Release: 0
Summary: Quake II - Mission Pack 1 ('The Reckoning') for yamagi-quake2
License: GPL-2.0-only
Group: Amusements/Games/3D/Shoot
URL: https://www.yamagi.org/quake2/
Source: http://deponie.yamagi.org/quake2/quake2-xatrix-%{version}.tar.xz
Source1: yquake2-xatrix.desktop
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: update-desktop-files
BuildRequires: yamagi-quake2
Requires: yamagi-quake2
%description
Yamagi Quake II is an enhanced client for id Software's Quake II. The main
focus is an unchanged single player experience like back in 1997, thus the
gameplay and the graphics are unaltered. Over 1000 bugs were fixed and an
extensive code audit done, making Yamagi Quake II one of the most solid Quake
II implementations available. Other than most ports Yamagi Quake II is full 64
bit clean, so it works perfectly on modern 64 bit processors and operating
systems.
This package provides the Quake II - Mission Pack 1 ('The Reckoning').
%prep
%autosetup -n quake2-xatrix-%{version}
# replace __DATE__ and __TIME__ with date/time of the last specfile changelog
# entry
modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")"
DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\""
TIME="\"$(date -d "${modified}" "+%%R")\""
find . -name '*.[ch]' -print -exec sh -c '
sed "/^[ \t]*#[ \t]*if/n;s/__DATE__/$3/g;s/__TIME__/$2/g" "$1" >"$1.new" && \
mv "$1.new" "$1"
' {} {} "${TIME}" "${DATE}" \;
%build
%cmake
%make_jobs
%install
install -dm 755 %{buildroot}%{_bindir}
install -Dpm 644 build/game.so %{buildroot}%{_libexecdir}/yamagi-quake2/xatrix/game.so
echo -e "#!/bin/sh\nexec %{_libexecdir}/yamagi-quake2/yquake2 \+set game xatrix \"\$@\"" > %{buildroot}%{_bindir}/yquake2-xatrix
chmod 755 %{buildroot}%{_bindir}/yquake2-xatrix
%suse_update_desktop_file -i yquake2-xatrix
%files
%license LICENSE
%doc CHANGELOG README.md
%{_bindir}/yquake2-xatrix
%dir %{_libexecdir}/yamagi-quake2/xatrix
%{_libexecdir}/yamagi-quake2/xatrix/game.so
%{_datadir}/applications/yquake2-xatrix.desktop
%changelog