File zandronum.spec of Package zandronum

#
# spec file for package zandronum
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2021-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:           zandronum
Version:        3.1.0
Release:        0
Summary:        A DOOM source port focusing on multiplayer gaming
# https://zdoom.org/wiki/License
License:        BSD-3-Clause AND Sleepycat
Group:          Amusements/Games/3D/Shoot
URL:            https://zandronum.com/
#Git-Clone:     https://github.com/TorrSamaho/zandronum.git
Source:         %{name}-%{version}.tar.xz
Source1:        sqlite.tar.gz
# Icon from https://zandronum.com/tracker/print_bug_page.php?bug_id=3104
Source2:        https://zandronum.com/essentials/fmod/fmodapi42416linux64.tar.gz
Source3:        zandronum_icon.png
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(bzip2)
BuildRequires:  pkgconfig(fluidsynth)
BuildRequires:  pkgconfig(glew)
BuildRequires:  pkgconfig(gtk+-2.0)
BuildRequires:  pkgconfig(libgme)
BuildRequires:  pkgconfig(libjpeg)
BuildRequires:  pkgconfig(openssl)
BuildRequires:  pkgconfig(sdl)
BuildRequires:  pkgconfig(zlib)
Provides:       bundled(fmod)
Provides:       bundled(libGeoIP)
Provides:       bundled(libdumb)
Provides:       bundled(libgdtoa)
Provides:       bundled(libgme)
Provides:       bundled(liblzma)
Provides:       bundled(libsqlite3)
ExclusiveArch:  x86_64

%description
Zandronum is a source port focused on offering a modernized multiplayer
experience, offering new game modes such as capture the flag, invasion
or domination. The International Doom League adopted it as its port of
choice in 2014.

Features:
 * Support for up to 64 players in cooperative, deathmatch, team deathmatch,
   capture the flag, possession, domination, invasion, Last Man Standing,
   survival, and other game modes.
 * Support for most ZDoom and GZDoom features, including the latter's
   hardware accelerated renderer.
 * Continuing support for unique Skulltag editing features as well.
 * Console, Quake-style keybindings, free look, jumping, and other advanced
   controls.
 * Full support for all Doom engine games, including Heretic, Hexen, and
   Strife.

Note:
Game data must be placed in ~/.config/zandronum/ .

%prep
%setup -q
tar xzvf %{SOURCE1}
tar xzvf %{SOURCE2}

%build
mkdir build && cd build
cmake .. \
  -DCMAKE_BUILD_TYPE=Release \
  -DSERVERONLY=OFF \
  -DRELEASE_WITH_DEBUG_FILE=OFF \
  -DFMOD_LIBRARY=../fmodapi42416linux64/api/lib/libfmodex64-4.24.16.so \
  -DFMOD_INCLUDE_DIR=../fmodapi42416linux64/api/inc/ \
  -Wno-dev
%make_build

%install
zandronumdir="%{buildroot}%{_libexecdir}/%{name}"
install -d %{buildroot}%{_bindir}
install -d $zandronumdir
install -d $zandronumdir/fmod
install -m 755 build/zandronum $zandronumdir/zandronum
install -m 755 build/output_sdl/liboutput_sdl.so $zandronumdir/liboutput_sdl.so
install -m 644 build/brightmaps.pk3 $zandronumdir/
install -m 644 build/zandronum.pk3 $zandronumdir/
install -m 644 build/skulltag_actors.pk3 $zandronumdir/
install -m 755 fmodapi42416linux64/api/lib/libfmodex64-4.24.16.so $zandronumdir/fmod/

# wrapper
echo -e "#!/bin/sh\nLD_LIBRARY_PATH=\"%{_libexecdir}/zandronum/fmod/\" exec %{_libexecdir}/zandronum/zandronum \"\$@\"" > %{buildroot}%{_bindir}/zandronum
chmod 755 %{buildroot}%{_bindir}/zandronum

# icons
install -Dm 0644 %{SOURCE3} %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/%{name}.png

# desktop file
%suse_update_desktop_file -c %{name} 'Zandronum' 'A multiplayer oriented DOOM source port' %{name} %{name} Game ActionGame

%files
%license LICENSE.txt
%doc README.md
%{_bindir}/zandronum
%dir %{_libexecdir}/%{name}
%{_libexecdir}/%{name}/zandronum
%{_libexecdir}/%{name}/liboutput_sdl.so
%{_libexecdir}/%{name}/brightmaps.pk3
%{_libexecdir}/%{name}/zandronum.pk3
%{_libexecdir}/%{name}/skulltag_actors.pk3
%dir %{_libexecdir}/%{name}/fmod
%{_libexecdir}/%{name}/fmod/libfmodex64-4.24.16.so
%{_datadir}/icons/hicolor/256x256/apps/%{name}.png
%{_datadir}/applications/%{name}.desktop

%changelog
openSUSE Build Service is sponsored by