File xrick.spec of Package xrick

#
# spec file for package xrick
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2018, 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 http://bugs.opensuse.org/
#


Name:           xrick
Version:        021212
Release:        0
Summary:        A clone of Rick Dangerous game
# The code is released in the spirit of the GNU GPL, see README for details.
License:        NonFree
Group:          Amusements/Games/Action/Arcade
URL:            https://www.bigorno.net/xrick/
Source0:        https://www.bigorno.net/xrick/%{name}-%{version}.tgz
BuildRequires:  ImageMagick
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(sdl)
BuildRequires:  pkgconfig(zlib)

%description
Xrick is a clone of Rick Dangerous game.

%prep
%setup -q
# Change data path
sed 's|"data.zip"|"%{_datadir}/xrick/data.zip"|' -i src/xrick.c
# Add our build flags
sed "s|CFLAGS=|CFLAGS+=|;s|LDFLAGS=|LDFLAGS+=|" -i Makefile
# Create icon
convert -strip src/xrickST.ico xrick.png
# Change data path in manual page
gunzip xrick.6.gz
sed 's|where xrick is|%{_datadir}/xrick.|;s|run from.||' -i xrick.6

%build
export CFLAGS='%{optflags}'
make %{?_smp_mflags}

%install
install -D -m0755 xrick %{buildroot}/%{_bindir}/%{name}
install -D -m0644 xrick.6 %{buildroot}/%{_mandir}/man6/%{name}.6
install -D -m0644 xrick.png %{buildroot}/%{_datadir}/pixmaps/%{name}.png
install -d %{buildroot}%{_datadir}/%{name}
install -m0644 {data.zip,KeyCodes} %{buildroot}/%{_datadir}/%{name}
%suse_update_desktop_file -c %{name} %{name} "A clone of Rick Dangerous" %{name} %{name} Game ArcadeGame

%if 0%{?suse_version} < 1330
%post
%desktop_database_post

%postun
%desktop_database_postun
%endif

%files
%doc README
%{_bindir}/%{name}
%{_mandir}/man6/%{name}.6%{?ext_man}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/%{name}
%{_datadir}/pixmaps/%{name}.png

%changelog
openSUSE Build Service is sponsored by