File vangers.spec of Package vangers

#
# spec file for package vangers
#
# 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:           vangers
Version:        1.0.0+git.20200614
Release:        0
Summary:        Game engine for "Vangers: One for the Road"
License:        GPL-3.0-or-later
Group:          Amusements/Games/Action/Race
URL:            https://github.com/KranX/Vangers
#Git-Clone:     https://github.com/KranX/Vangers.git
Source:         Vangers-%{version}.tar.xz
# The CLUNK C++ library provides support for real-time 3D(binaural) sound
# Special version for Vangers - Licensed under LGPL-2.1-or-later
Source1:        https://github.com/stalkerg/clunk/archive/master.zip
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig
BuildRequires:  unzip
BuildRequires:  pkgconfig(sdl2)
BuildRequires:  pkgconfig(SDL2_net)
BuildRequires:  pkgconfig(ogg)
BuildRequires:  pkgconfig(vorbis)
BuildRequires:  pkgconfig(libavcodec)
BuildRequires:  pkgconfig(libavformat)
BuildRequires:  pkgconfig(libavutil)
BuildRequires:  pkgconfig(libavutil)
BuildRequires:  pkgconfig(zlib)

%description
Vangers is a video game that combines elements of the racing and
role-playing genres.

Note: This package only includes the binary files.
You still need the data files (Steam/GOG/CD) from the original
"Vangers: One for the Road" game to play the game.

%prep
%setup -q -n Vangers-%{version}
unzip %{SOURCE1} 

%build
# HACK: Build libclunk (static, special version for vangers)
cd clunk-master
mkdir build && cd build
cmake .. \
  -DBUILD_SHARED_LIBS=OFF \
  -DCMAKE_INSTALL_PREFIX=/tmp/clunk/
%make_build
make install
cd ../..
# HACK: Workaround clunk include path issues
# https://github.com/KranX/Vangers/issues/164
cp -arv /tmp/clunk/include/clunk/*.h /tmp/clunk/include

### Build vangers
%cmake \
  -DCLUNK_LIBRARY=/tmp/clunk/lib/libclunk.a \
  -DCLUNK_INCLUDE_DIR=/tmp/clunk/include
%make_build

%install
install -D -m0755 build/src/vangers %{buildroot}/%{_bindir}/vangers

%post
echo "Please create a directory with the original data files from the game Vangers"
echo "You then have to run the vangers from this directory."

%files
%license LICENSE
%doc README.md
%{_bindir}/vangers

%changelog
openSUSE Build Service is sponsored by