File openxray.spec of Package openxray

#
# spec file for package openxray
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2020, 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:           openxray
Version:        0.0.1144+git.20211206
Release:        0
Summary:        X-Ray Engine Linux port by OpenXRay team
License:        BSD-3-Clause
Group:          Amusements/Games/3D/Shoot
URL:            https://github.com/OpenXRay/xray-16.git
Source0:        %{name}-%{version}.tar.xz
Source1:        README.SUSE
Source99:       openxray-rpmlintrc
# PATCH-FIX-OPENSUSE openxray-workaround-spurious-gcc8-warnings.patch mardnh@gmx.de -- Workaround spurious gcc8 warnings.
Patch0:         openxray-workaround-spurious-gcc8-warnings.patch
BuildRequires:  binutils-gold
BuildRequires:  cmake
BuildRequires:  fdupes
BuildRequires:  freeimage-devel
%if 0%{?sle_version} > 150300 || 0%{?suse_version} > 1500
BuildRequires:  gcc-c++ >= 8
%else
BuildRequires:  gcc8-c++
%endif
BuildRequires:  git-core
BuildRequires:  hicolor-icon-theme
BuildRequires:  libjpeg-devel
BuildRequires:  liblockfile-devel
BuildRequires:  lzo-devel
BuildRequires:  pcre-devel
BuildRequires:  pkgconfig
BuildRequires:  tbb-devel
BuildRequires:  pkgconfig(cryptopp)
BuildRequires:  pkgconfig(glew)
BuildRequires:  pkgconfig(ogg)
BuildRequires:  pkgconfig(openal)
BuildRequires:  pkgconfig(sdl2)
BuildRequires:  pkgconfig(theora)
BuildRequires:  pkgconfig(vorbis)

%description
OpenXRay is an improved version of the X-Ray Engine, the game engine
used in the world-famous S.T.A.L.K.E.R. game series by GSC Game World.

Currently the following games are supported:
 * S.T.A.L.K.E.R.: Call of Pripyat
 * S.T.A.L.K.E.R.: Clear Sky

To play one of the S.T.A.L.K.E.R. games with OpenXRay you need the
original game files.
See: %{_docdir}/openxray/README.SUSE for details.

%prep
%setup -q
cp %{SOURCE1} .
sed -i -e '/^#!\//, 1d' res/*.desktop
%if 0%{?sle_version} <= 150300 && 0%{?suse_version} < 1550
%patch0 -p1
%endif

%build
mkdir build && cd build
# FIXME: you should use the %%cmake macros
#        compilation does not work with obs-provided %%optflags!
cmake .. \
%if 0%{?sle_version} <= 150300 && 0%{?suse_version} < 1550
    -DCMAKE_C_COMPILER=/usr/bin/gcc-8 \
    -DCMAKE_CXX_COMPILER=/usr/bin/g++-8 \
%endif
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=%{_prefix}
%make_build

%install
cd build
%make_install
# FIXME: .gitattributes should not be part of the installed files
rm %{buildroot}%{_datadir}/openxray/gamedata/shaders/.gitattributes
%fdupes %{buildroot}%{_datadir}

%files
%license License.txt
%doc README.md README.SUSE
%{_bindir}/xr_3da
#
# FIXME: mimalloc should be installed in the correct folders
#        Should be fixed by upstream (mimalloc GH#223) !
/usr/lib/mimalloc-1.6/
#
%{_libdir}/OPCODE.so
%{_libdir}/libODE.so
%{_libdir}/xrAICore.so
%{_libdir}/xrAPI.so
%{_libdir}/xrCDB.so
%{_libdir}/xrCore.so
%{_libdir}/xrEngine.so
%{_libdir}/xrGame.so
%{_libdir}/xrGameSpy.so
%{_libdir}/xrLuabind.so
%{_libdir}/xrLuajit.so
%{_libdir}/xrNetServer.so
%{_libdir}/xrParticles.so
%{_libdir}/xrPhysics.so
%{_libdir}/xrRender_GL.so
%{_libdir}/xrScriptEngine.so
%{_libdir}/xrSound.so
%{_libdir}/xrUICore.so
%dir %{_datadir}/openxray
%{_datadir}/openxray/fsgame.ltx
%{_datadir}/openxray/gamedata
%{_datadir}/applications/openxray_cop.desktop
%{_datadir}/icons/hicolor/*/apps/openxray_cop.png
%{_datadir}/pixmaps/openxray_cop.png
%{_datadir}/applications/openxray_cs.desktop
%{_datadir}/icons/hicolor/*/apps/openxray_cs.png
%{_datadir}/pixmaps/openxray_cs.png
%{_datadir}/applications/openxray_soc.desktop
%{_datadir}/icons/hicolor/*/apps/openxray_soc.png
%{_datadir}/pixmaps/openxray_soc.png
%{_datadir}/bash-completion/completions/xr_3da

%changelog
openSUSE Build Service is sponsored by