File keeperrl.spec of Package keeperrl

# spec file for package keeperrl
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# 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

Name:           keeperrl
Version:        alpha28
Release:        0
Summary:        Dungeon management and roguelike
License:        GPL-2.0
Group:          Amusements/Games/Action/Other
Source2:        keeper
Source99:       %{name}.changes
# PATCH-FIX-OPENSUSE unrecognized-options.patch -- remove unrecognized command line options
Patch0:         unrecognized-options.patch
# TODO: Patch out all occurrences of "control reaches end of non-void function".
BuildRequires:  binutils-gold
BuildRequires:  pkgconfig(vorbis)
BuildRequires:  pkgconfig(openal)
BuildRequires:  pkgconfig(sdl2)
BuildRequires:  pkgconfig(SDL2_image)
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(zlib)

KeeperRL is an ambitious dungeon simulator with roguelike and RPG elements.
Take the role of an evil wizard and seek the ultimate knowledge of destruction.
Explore the world, murder innocent villagers and burn their homes. Build your
dungeon, lay traps and prepare for an assault of angry heroes.

When you control your minions the game becomes a classic roguelike, with
turn-based and very tactical combat. You can also play as an adventurer
and assault dungeons made by you or other players.

%setup -q
%patch0 -p1
sed -i 's/-Wl,-rpath=$(RPATH)/-fuse-ld=gold/g' Makefile
modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")"
DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\""
# Since we are not building from git we must do it manually:
echo "#define BUILD_VERSION \"%{version}\"" > version.h
echo "#define BUILD_DATE $DATE" >> version.h

CFLAGS="%{optflags}" \
make RELEASE=1 OPT=1 %{?_smp_mflags}

mkdir -p %{buildroot}%{_libexecdir}/%{name}
install -Dm755 keeper %{buildroot}%{_libexecdir}/%{name}
cp -rt "%{buildroot}%{_libexecdir}/%{name}" data_free/ data_contrib/

mkdir -p %{buildroot}%{_bindir}
sed -i "s@libexec=.*@libexec=\"%{_libexecdir}\"@" %{SOURCE2}
install %{SOURCE2} %{buildroot}%{_bindir}/keeperrl

%fdupes %{buildroot}%{_libexecdir}/%{name}

# deactivated as tests are currently broken
#make test

%attr(755,root,root) %{_bindir}/%{name}