File vegastrike.spec of Package vegastrike

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


%if 0%{?sle_version} && 0%{?sle_version} < 160000
%global force_gcc_version 13
%endif
%define srcname Vega-Strike-Engine-Source
Name:           vegastrike
Version:        0.9.1
Release:        0
Summary:        3D OpenGL spaceflight simulator
License:        GPL-2.0-or-later
Group:          Amusements/Games/3D/Simulation
URL:            https://www.vega-strike.org/
Source0:        https://github.com/vegastrike/%{srcname}/archive/refs/tags/v%{version}.tar.gz#/%{srcname}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM - https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/445
Patch0:         0001-cmake-Install-man-pages-into-matching-sub-directory.patch
# PATCH-FIX-UPSTREAM - vegastrike-fix-missing-includes.patch - https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/1144/
Patch1:         vegastrike-fix-missing-includes.patch
BuildRequires:  cmake
BuildRequires:  gcc%{?force_gcc_version}-c++
BuildRequires:  fdupes
BuildRequires:  libboost_atomic-devel
BuildRequires:  libboost_filesystem-devel
BuildRequires:  libboost_log-devel
BuildRequires:  libboost_program_options-devel
BuildRequires:  libboost_python3-devel
BuildRequires:  libboost_system-devel
BuildRequires:  libboost_thread-devel
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(expat)
BuildRequires:  pkgconfig(glu)
BuildRequires:  pkgconfig(glut)
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  pkgconfig(libjpeg)
BuildRequires:  pkgconfig(libpng)
BuildRequires:  pkgconfig(openal)
BuildRequires:  pkgconfig(opengl)
BuildRequires:  pkgconfig(python3)
BuildRequires:  pkgconfig(sdl2)
BuildRequires:  pkgconfig(vorbis)
Requires:       hicolor-icon-theme
Requires:       xdg-utils
Recommends:     %{name}-data >= %{version}

%description
Vega Strike is a GPL 3D OpenGL Action RPG space sim that allows a player to
trade and bounty hunt. You start in an old beat up Wayfarer cargo ship, with
endless possibility before you and just enough cash to scrape together a life.
Yet danger lurks in the space beyond.

%prep
%autosetup -p1 -n %{srcname}-%{version}

%build
%if 0%{?force_gcc_version}
export CXX="g++-%{force_gcc_version}"
%endif

%cmake \
  -DDATADIR=%{_datadir}/%{name} \
  -DUSE_PYTHON_3:BOOL=ON \
  -DUSE_SYSTEM_BOOST:BOOL=ON \
  -DBUILD_STATIC_LIBS:BOOL=ON \
  -DBUILD_SHARED_LIBS:BOOL=OFF \
  -DCMAKE_BUILD_TYPE="Release" \
  -DENABLE_PIE:BOOL=ON \
  -DUSE_GTEST:BOOL=OFF \
  -DINSTALL_GTEST:BOOL=OFF \
  ../engine
%make_build

%install
%cmake_install

# Remove debug files
rm -rfv %{buildroot}%{_libdir}/debug/usr/bin/*

# Remove duplicates
%fdupes %{buildroot}%{_mandir}
%fdupes %{buildroot}%{_bindir}

%files
%doc AUTHORS AUTHORS.GITHUB AUTHORS.SF ChangeLog README.md
%license LICENSE
%{_bindir}/vega*
%{_bindir}/vs-*
%{_mandir}/man1/*

%changelog
openSUSE Build Service is sponsored by