File yamagi-quake2.spec of Package yamagi-quake2
#
# spec file for package yamagi-quake2
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2016 Luke Jones <luke.nukem.jones@gmail.com>
#
# 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 http://bugs.opensuse.org/
#
%define fver 5_34
Name: yamagi-quake2
Version: 5.34
Release: 0
Summary: Enhanced Quake 2 Source Port
License: GPL-2.0
Group: Amusements/Games/3D/Shoot
Url: http://www.yamagi.org/quake2/
Source: https://github.com/yquake2/yquake2/archive/QUAKE2_%{fver}.tar.gz
Source99: %{name}.changes
# PATCH-FEATURE-OPENSUSE allow-custom-cflags.patch -- Allow custom cflags for our optflags
Patch0: allow-custom-cflags.patch
BuildRequires: libSDL2-devel
BuildRequires: libjpeg-devel
BuildRequires: libvorbis-devel
BuildRequires: openal-soft-devel
BuildRequires: update-desktop-files
BuildRequires: zlib-devel
%description
Yamagi Quake II is an enhanced client for id Software's Quake II. The
main focus is an unchanged single player experience; the gameplay and
graphics are unaltered. It also features: anisotropic filtering and
multi-sample anti-aliasing, widescreen aspect ratio and unlimited
screen size, compatibility with most mods, optional support for
retexturing packs and HUD scaling.
%prep
%setup -q -n yquake2-QUAKE2_5_34
%patch0 -p1
# Fix usage of __DATE__ macro to prevent build in excess
modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{SOURCE99}")"
DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\""
sed -i "s/__DATE__/${DATE}/g" src/common/misc.c src/game/savegame/savegame.c
%build
CFLAGS="%{optflags}" make %{?_smp_mflags} \
WITH_SYSTEMWIDE=yes \
WITH_SYSTEMDIR='%{_libdir}/%{name}'
%install
install -D -p -m 755 ./release/quake2 %{buildroot}%{_bindir}/yquake2
install -D -p -m 755 ./release/q2ded %{buildroot}%{_bindir}/yq2ded
install -D -p -m 644 ./release/baseq2/game.so \
%{buildroot}%{_libdir}/%{name}/baseq2/game.so
install -D -p -m 644 stuff/yq2.cfg \
%{buildroot}%{_libdir}/%{name}/baseq2/yq2.cfg
install -D -p -m 644 stuff/icon/Quake2.png \
%{buildroot}%{_datadir}/pixmaps/yquake2.png
%suse_update_desktop_file -c yquake2 'Quake II' 'Yamagi Quake II' yquake2 yquake2 Game ActionGame
%post
%desktop_database_post
%postun
%desktop_database_postun
%files
%defattr(-,root,root)
%doc CHANGELOG CONTRIBUTE LICENSE README.md
%{_bindir}/yquake2
%{_bindir}/yq2ded
%{_libdir}/%{name}
%{_datadir}/pixmaps/yquake2.png
%{_datadir}/applications/yquake2.desktop
%changelog