File openrct2.spec of Package openrct2

# spec file for package openrct2
# Copyright (c) 2021 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

%define lib_suffix %{nil}
%ifarch x86_64
  %define lib_suffix 64
%define title_version 0.1.2
%define title_version_url %{title_version}c
%define objects_version 1.2.1
Name:           openrct2
Release:        0
Summary:        An open source re-implementation of Roller Coaster Tycoon 2
License:        GPL-3.0-only
Group:          Amusements/Games/Strategy/Other
# PATCH-FIX-OPENSUSE no-werror.patch -- Do not use werror, as wno-clobbered does not work
Patch0:         no-werror.patch
BuildRequires:  cmake >= 3.9
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  glibc-devel
BuildRequires:  hicolor-icon-theme
BuildRequires:  nlohmann_json-devel >= 3.6.0
BuildRequires:  pkgconfig
BuildRequires:  shared-mime-info
BuildRequires:  update-desktop-files
BuildRequires:  zip
BuildRequires:  pkgconfig(duktape)
BuildRequires:  pkgconfig(fontconfig)
BuildRequires:  pkgconfig(gl)
BuildRequires:  pkgconfig(icu-uc) >= 59.0
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(libpng16)
BuildRequires:  pkgconfig(libzip) >= 1.0
BuildRequires:  pkgconfig(openssl) >= 1.0.0
BuildRequires:  pkgconfig(sdl2)
BuildRequires:  pkgconfig(speexdsp)
BuildRequires:  pkgconfig(zlib)
Recommends:     (kdialog or zenity)

An open source clone of RollerCoaster Tycoon 2
that depends on the original game assets. On first
game start it will create a ~/.config/OpenRCT2/config.ini file
where the game_path = "" setting has to be set to a directory
into which the original game has been installed to.

%package titlesequences
Summary:        Titlesequences for openRCT2
Group:          Amusements/Games/Strategy/Other
Requires:       %{name} = %{version}

%description titlesequences
This package contains tilesequences like the original ones
used in RollerCoaster Tycoon 1 and 2.
When using RCT1 sequences, the original RCT1 files have to be installed.

%setup -q -n OpenRCT2-%{version} -a 1 -a 2
%patch0 -p1

# Remove build time references so build-compare can do its work
sed -i "s/__DATE__/\"openSUSE\"/" src/openrct2/Version.h
sed -i "s/__TIME__/\"Build Service\"/" src/openrct2/Version.h

%make_build all
# libopenrct2 is not installed when openrct2 is called by make, so set the LD_LIBRARY_PATH
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(dirname $(find . -name"
%make_build g2
# %%cmake changes directory into "build"
cd ..

# Generate titles from source (zipping as parkseq)
pushd title-sequences-%{title_version_url}/title
  mv -v v%{title_version} openrct2
  rm -rv v*
  for dir in *; do
    pushd "$dir"
    zip -9 -X -r ../"$dir"".parkseq" *


mkdir -p '%{buildroot}%{_datadir}/%{name}/title'
cp -v title-sequences-%{title_version_url}/title/*.parkseq "%{buildroot}%{_datadir}/%{name}/title"

mkdir -p '%{buildroot}%{_datadir}/%{name}/object'
cp -vR objects-%{objects_version}/objects/* '%{buildroot}%{_datadir}/%{name}/object'

find '%{buildroot}%{_datadir}/%{name}' -type f -exec chmod 644 \{\} \;

# We do that in the correct docdir in the files section.
rm -rf %{buildroot}%{_datadir}/doc

%fdupes %{buildroot}%{_datadir}/%{name}

%license licence.txt
%doc distribution/changelog.txt distribution/readme.txt
%exclude %{_datadir}/openrct2/title/rct*
%dir %{_datadir}/metainfo/

%files titlesequences
%license licence.txt

openSUSE Build Service is sponsored by