A new user interface for you! Read more...

File keeperrl.spec of Package keeperrl

#
# spec file for package keeperrl
#
# Copyright (c) 2016 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 http://bugs.opensuse.org/
#


Name:           keeperrl
Version:        alpha16
Release:        0
Summary:        Dungeon management and roguelike
License:        GPL-2.0
Group:          Amusements/Games/Action/Other
Url:            http://keeperrl.com/
Source:         https://github.com/miki151/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
Source2:        keeper
Source99:       %{name}.changes
# PATCH-FIX-UPSTREAM fix-template.patch
Patch0:         fix-template.patch
# PATCH-FIX-UPSTREAM fix-invalid-return-value.patch -- Fix boolean function returning nullptr_t
Patch1:         fix-invalid-return-value.patch
# PATCH-FIX-OPENSUSE fix-non-void-returns.patch -- Return values for non void function return by switch-case
Patch2:         fix-non-void-returns.patch
BuildRequires:  angelscript-devel >= 2.29.1
BuildRequires:  binutils-gold
BuildRequires:  fdupes
BuildRequires:  freeglut-devel
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig(glew)
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(sfml-all)
BuildRequires:  pkgconfig(zlib)
%if 0%{?suse_version} <= 1320
BuildRequires:  boost_1_58_0-devel
%else
BuildRequires:  boost-devel
%endif

%description
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.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -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

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

%install
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}

%check
make test

%files
%defattr(-,root,root)
%doc LICENSE README.md
%attr(755,root,root) %{_bindir}/%{name}
%{_libexecdir}/%{name}

%changelog