File falconseye.spec of Package falconseye

# spec file for package falconseye
# 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

Name:           falconseye
####License:        Other License(s), see package 
#### it's the Nethack General Public License ngpl, see
Requires:       timidity
PreReq:         fileutils permissions
Version:        1.9.3
Release:        0
Source:         %{name}-%{version}.tar.bz2
Source1:        %name.desktop
Source99:       %{name}.changes
Patch:          %{name}-%{version}.diff
Patch1:         %{name}-libs.patch
Patch2:         %{name}-tinfo.patch
Summary:        A Mouse-Driven interface for NetHack
License:        NGPL
Group:          Amusements/Games/RPG
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  SDL-devel
BuildRequires:  alsa-devel
BuildRequires:  bison
BuildRequires:  cpp
BuildRequires:  flex
BuildRequires:  gdbm-devel
BuildRequires:  glib2-devel
BuildRequires:  glibc-devel
BuildRequires:  libtool
BuildRequires:  ncurses-devel
BuildRequires:  permissions
BuildRequires:  slang-devel
BuildRequires:  update-desktop-files
BuildRequires:  xorg-x11-devel
BuildRequires:  zlib-devel

Falcon's Eye is a mouse-driven interface for NetHack that enhances the
visuals, audio, and accessibility of the game, yet retains all the
original gameplay and game features.

Falcon's Eye needs to be installed together with nh_data and is run as

%setup -q
#from 12.1 is ncurses splitted
%if 0%{?suse_version} > 1210
# fix build-compare
modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{SOURCE99}")"
EPOCH=$(date -d "${modified}" "+%%s")
sed -i "s/(void) time((time_t \\*)&clocktim)/clocktim=$EPOCH/" util/makedefs.c

sh sys/unix/ links
# parallel build fails
make -C src CC="gcc $RPM_OPT_FLAGS" -j1

make DESTDIR="$RPM_BUILD_ROOT" install
mv $RPM_BUILD_ROOT/usr/share/games/falconseye/falconseye \
ln -snf /usr/games/falconseye.bin \
%suse_update_desktop_file -i %name Game X-SuSE-AdventureGame
rmdir $RPM_BUILD_ROOT/usr/share/games/falconseye/save
mkdir -p $RPM_BUILD_ROOT/var/games/falconseye/save
ln -s /var/games/falconseye/save $RPM_BUILD_ROOT/usr/share/games/falconseye/save
touch $RPM_BUILD_ROOT/var/games/falconseye/jtp_log.txt
ln -s /var/games/falconseye/jtp_log.txt $RPM_BUILD_ROOT/usr/share/games/falconseye/jtp_log.txt

# Move save files from old location.
mkdir -p var/games/falconseye/save
mv usr/share/games/falconseye/save/* var/games/falconseye/save >/dev/null 2>/dev/null || true
rmdir usr/share/games/falconseye/save >/dev/null 2>/dev/null || true

%if 0%{?suse_version} < 1140
%set_permissions /usr/games/falconseye.bin

%verify_permissions -e /usr/games/falconseye.bin

%attr(0775,games,games) %dir /usr/share/games/falconseye
%verify(not mode) %attr(0755,games,games) /usr/games/falconseye.bin
%attr(0775,games,games) %dir /var/games/falconseye
%attr(0775,games,games) %dir /var/games/falconseye/save
%attr(0664,games,games) %verify(not size md5 mtime) /var/games/falconseye/jtp_log.txt