File OpenRA-release-mono.spec of Package OpenRA-release-mono

#
# spec file for package OpenRA-release-mono
#
# Copyright (c) 2024 Boian Berberov
#
# 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/
#

%global         pkg_name     OpenRA
%global         ver_name     release
%global         net_run      mono
%global         nuget_api    https://www.nuget.org/api/v2/package
%global         use_lua_ver  5.1

Name:           %{pkg_name}-%{ver_name}-%{net_run}
Version:        20231010
Release:        0
Group:          Amusements/Games/Strategy/Real Time
Summary:        Game engine for early Command & Conquer games and Dune 2000
License:        GPL-3.0+
URL:            https://www.openra.net/

Source0:        https://github.com/%{pkg_name}/%{pkg_name}/archive/refs/tags/%{ver_name}-%{version}.tar.gz
Source1:        nuget.config
Source2:        https://github.com/OpenRA/GeoIP-Database/releases/download/monthly/IP2LOCATION-LITE-DB1.IPV6.BIN.ZIP
Source100:      %{nuget_api}/DiscordRichPresence/1.1.3.18
Source101:      %{nuget_api}/Linguini.Bundle/0.5.0
Source102:      %{nuget_api}/Microsoft.Extensions.DependencyModel/6.0.0
Source103:      %{nuget_api}/Microsoft.NET.Test.Sdk/17.6.2
Source104:      %{nuget_api}/Microsoft.Win32.Registry/5.0.0
Source105:      %{nuget_api}/Mono.NAT/3.0.4
Source106:      %{nuget_api}/MP3Sharp/1.0.5
Source107:      %{nuget_api}/NUnit/3.13.3
Source108:      %{nuget_api}/NUnit3TestAdapter/4.5.0
Source109:      %{nuget_api}/NUnit.Console/3.16.3
Source110:      %{nuget_api}/NVorbis/0.10.5
Source111:      %{nuget_api}/OpenRA-Eluant/1.0.22
Source112:      %{nuget_api}/OpenRA-Freetype6/1.0.11
Source113:      %{nuget_api}/OpenRA-FuzzyLogicLibrary/1.0.1
Source114:      %{nuget_api}/OpenRA-OpenAL-CS/1.0.22
Source115:      %{nuget_api}/OpenRA-SDL2-CS/1.0.40
Source116:      %{nuget_api}/Pfim/0.11.2
Source117:      %{nuget_api}/rix0rrr.BeaconLib/1.0.2
Source118:      %{nuget_api}/SharpZipLib/1.4.2
Source119:      %{nuget_api}/System.Collections.Immutable/6.0.0
Source120:      %{nuget_api}/System.Net.Http/4.3.4
Source121:      %{nuget_api}/System.Runtime.Loader/4.3.0
Source122:      %{nuget_api}/System.Threading.Channels/6.0.0
Source123:      %{nuget_api}/TagLibSharp/2.3.0

BuildRequires:  pkgconfig
BuildRequires:  msbuild
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(lua%{use_lua_ver})
%if mono == %{net_run}
BuildRequires:  pkgconfig(mono)
%endif
BuildRequires:  pkgconfig(openal)
BuildRequires:  pkgconfig(sdl2)

%if mono == %{net_run}
Requires:       mono-core >= 6.12
%endif

%if 1330 <= 0%{?suse_version}
Requires(pre):  group(games)
Requires(pre):  user(games)
%endif

%description
Open Source real-time strategy game engine for early Westwood games such as
Command & Conquer: Tiberian Dawn and Red Alert, and Dune 2000


%prep
%setup -q -n %{pkg_name}-%{ver_name}-%{version} -a 1 -a 2

mkdir LocalNugetPackages
pushd LocalNugetPackages
cp %{SOURCE100} .
cp %{SOURCE101} .
cp %{SOURCE102} .
cp %{SOURCE103} .
cp %{SOURCE104} .
cp %{SOURCE105} .
cp %{SOURCE106} .
cp %{SOURCE107} .
cp %{SOURCE108} .
cp %{SOURCE109} .

cp %{SOURCE110} .
cp %{SOURCE111} .
cp %{SOURCE112} .
cp %{SOURCE113} .
cp %{SOURCE114} .
cp %{SOURCE115} .
cp %{SOURCE116} .
cp %{SOURCE117} .
cp %{SOURCE118} .
cp %{SOURCE119} .

cp %{SOURCE120} .
cp %{SOURCE121} .
cp %{SOURCE122} .
cp %{SOURCE123} .
popd

%make_build VERSION=%{ver_name}-%{version} version


%build
%make_build RUNTIME=%{net_run} TARGETPLATFORM=unix-generic


%install
%make_install gameinstalldir=%{%_libexecdir}/%{name}
%_make \
	DESTDIR=%{?buildroot} \
	INSTALL="%{__install} -p" \
	datadir=%{%_datadir}/%{name} \
	install-linux-appdata
%_make \
	DESTDIR=%{?buildroot} \
	INSTALL="%{__install} -p" \
	bindir=%{%_bindir} \
	datadir=%{%_datadir}/%{name} \
	gameinstalldir=%{%_libexecdir}/%{name} \
	install-linux-shortcuts
%_make \
	DESTDIR=%{?buildroot} \
	INSTALL="%{__install} -p" \
	mandir=%{%_mandir} \
	install-man


%files
%license        COPYING
%doc            Changelog.md


%changelog
openSUSE Build Service is sponsored by