File thedarkmod.spec of Package thedarkmod

#
# spec file for package thedarkmod
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# 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/
#


%ifarch x86_64
%define tdm_targetarch x64
%else
%ifarch %{ix86}
%define tdm_targetarch x86
%endif
%endif
Name:           thedarkmod
Version:        2.11
Release:        0
Summary:        Steampunk Stealth Game
License:        CC-BY-NC-SA-3.0 AND GPL-3.0-only
Group:          Amusements/Games/Action/Shoot
URL:            https://www.thedarkmod.com/
Source:         https://www.thedarkmod.com/sources/%{name}.%{version}.src.7z
Source3:        thedarkmod
Source4:        thedarkmod.png
Source5:        thedarkmod.desktop
BuildRequires:  bsdtar
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  glibc-devel
BuildRequires:  hicolor-icon-theme
BuildRequires:  libavcodec-devel
BuildRequires:  libavformat-devel
BuildRequires:  libavutil-devel
BuildRequires:  libboost_filesystem-devel
BuildRequires:  libboost_program_options-devel
BuildRequires:  libboost_thread-devel
BuildRequires:  libbz2-devel
BuildRequires:  libjpeg-devel
BuildRequires:  libswresample-devel
BuildRequires:  libswscale-devel
BuildRequires:  m4
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(gl)
BuildRequires:  pkgconfig(glew)
BuildRequires:  pkgconfig(libpng)
BuildRequires:  pkgconfig(libssl)
BuildRequires:  pkgconfig(openal)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(xxf86vm)
BuildRequires:  pkgconfig(zlib)
Requires:       xdg-utils
ExclusiveArch:  %{ix86} x86_64

%description
A first-person stealth game. In it you play a hooded figure
slinking through the shadows of a gothic steampunk city,
hunting priceless valuables while avoiding the swords and
arrows of those hired to stop you.

%prep
mkdir darkmod
bsdtar -xvf "%{_sourcedir}/%{name}.%{version}.src.7z" -C darkmod

# cleanup bundled stuff
for dir in boost curl devil ffmpeg libpng libjpeg zlib; do
    rm -Rf include/$dir
    rm -Rf lib/$dir
done
rm -Rf win32 win64 macosx linux/*/*.a linux/*/*/*.a

%build
cd darkmod
export CXXFLAGS="$CXXFLAGS -Wno-error=format-security"
%cmake \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DCMAKE_INSTALL_PREFIX=%{_prefix} \
    -DUCM_UNITY_BUILD=ON

%cmake_build

%install
mkdir -p %{buildroot}%{_libexecdir}/thedarkmod/
mv darkmod/thedarkmod.%{tdm_targetarch} %{buildroot}%{_libexecdir}/thedarkmod/thedarkmod.bin

# workaround for http://bugs.thedarkmod.com/view.php?id=3567
mkdir -p %{buildroot}%{_bindir}
install -m0755 %{SOURCE3} %{buildroot}%{_bindir}

mkdir -p %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/
install -m0644 %{SOURCE4} %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/

mkdir -p %{buildroot}%{_datadir}/applications/
install -m0644 %{SOURCE5} %{buildroot}%{_datadir}/applications/

%files
%license darkmod/LICENSE.txt
%{_bindir}/thedarkmod
%{_libexecdir}/thedarkmod
%{_datadir}/applications/thedarkmod.desktop
%{_datadir}/icons/hicolor/64x64/apps/thedarkmod.png

%changelog
openSUSE Build Service is sponsored by