File globulation2.spec of Package globulation2

#
# spec file for package globulation2
#
# Copyright (c) 2024 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/
#


Name:           globulation2
Version:        0.9.4.4
Release:        0
Summary:        A real time strategy game focussing on macro management
License:        GPL-3.0-only
Group:          Amusements/Games/Strategy/Real Time
URL:            https://www.globulation2.org
Source:         http://dl.sv.nongnu.org/releases/glob2/0.9.4/glob2-%{version}.tar.gz
# PATCH-FIX-OPENSUSE
Patch2:         glob2-fix_streambackend.patch
Patch3:         glob2-fix_missing_return_in_nonvoid_functions.patch
Patch4:         glob2_SConstruct.patch
Patch5:         fix-build-with-gcc5.patch
Patch6:         fix-build-with-gcc6.patch
Patch7:         fix-saving-settings.patch
Patch8:         glob2-bool.patch
BuildRequires:  gcc-c++
BuildRequires:  fdupes
BuildRequires:  boost-devel
BuildRequires:  pkgconfig
BuildRequires:  scons
BuildRequires:  SDL_net-devel
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig(SDL_image)
BuildRequires:  pkgconfig(SDL_net)
BuildRequires:  pkgconfig(SDL_ttf)
BuildRequires:  pkgconfig(fribidi)
BuildRequires:  pkgconfig(glu)
BuildRequires:  pkgconfig(portaudio-2.0)
BuildRequires:  pkgconfig(sdl)
BuildRequires:  pkgconfig(speex)
BuildRequires:  pkgconfig(vorbis)
BuildRequires:  pkgconfig(zlib)
BuildRequires:  libboost_thread-devel
BuildRequires:  libboost_date_time-devel
BuildRequires:  libboost_system-devel

%description
Globulation is a project to create an innovative real time strategy
game by minimizing micro-managment and assigning the tasks
automatically to the units. The player just has to order
the number of units he wants for a selected task and the units will
do their best to satisfy your requirements.

Glob2 can be played by a single player, through your Local Area
Network (LAN), or through Internet thanks to Ysagoon Online Game (YOG),
a meta-server. It also features a scripting language for versatile
gameplay and an integrated map editor.

%prep
%setup -q -n glob2-%{version}

%patch -P 2
%patch -P 3
%patch -P 4 -p1
%patch -P 5 -p1
%patch -P 6 -p1
%patch -P 7 -p1
%patch -P 8 -p1

# adjust scons files to work with python3
sed -i 's/print \(.*\)/print\(\1\)/' SConstruct
sed -i 's/print \(.*\)/print\(\1\)/' scons/*.py
# adjust scons files to work with scons 3.0.2+
# ('Options' class has been removed after it was deprecated and replaced by 'Variables' since years)
sed -i 's/Options/Variables/' SConstruct
sed -i 's/BoolOption/BoolVariable/' SConstruct
sed -i 's/PathOption/PathVariable/' SConstruct

chmod -x {src/*.h,src/*.cpp,libgag/include/*.h,gnupg/*,libgag/src/*.cpp,scripts/*,data/*.txt,campaigns/*,COPYING,README}

%build
scons \
  --portaudio=true \
  BINDIR="%{_bindir}" \
  INSTALLDIR="%{_datadir}" \
  CXXFLAGS="%{optflags}" \
  %{?jobs:-j%{jobs}}

%install
scons \
  --portaudio=true \
  BINDIR="%{buildroot}%{_bindir}" \
  INSTALLDIR="%{buildroot}%{_datadir}" \
  CXXFLAGS="%{optflags}" \
  install

%fdupes %{buildroot}%{_datadir}

%files
%doc README
%license COPYING
%{_bindir}/glob2
%{_datadir}/glob2/
%{_datadir}/applications/glob2.desktop
%{_datadir}/icons/hicolor/*/apps/glob2-icon-*.png

%changelog
openSUSE Build Service is sponsored by