File gnurobbo.spec of Package gnurobbo

#
# spec file for package gnurobbo
#
# Copyright (c) 2021 SUSE LLC
# Copyright Vincent Petry <PVince81@opensuse.org>
#
# 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/
#

%define _lto_cflags %{nil}
Name:           gnurobbo
Version:        0.68
Release:        0
Summary:        GNU Robbo
License:        GPL-2.0
Group:          Amusements/Games/Action/Arcade
Url:            http://gnurobbo.sourceforge.net/
Source0:        https://sourceforge.net/projects/gnurobbo/files/gnurobbo/gnurobbo%%20%{version}/gnurobbo-%{version}-source.tar.gz
Source1:        %{name}.desktop
BuildRequires:  SDL-devel
BuildRequires:  SDL_image-devel
BuildRequires:  SDL_mixer-devel
BuildRequires:  SDL_ttf-devel
BuildRequires:  fdupes
BuildRequires:  update-desktop-files

%description
GNU Robbo is a very addictive logic game. You must help
little robot to get out of an unfriendly planet, collecting
parts of an emergency capsule.

%prep
%setup -q
mv %{name}/* . && rmdir %{name}
sed -i 's|-d ||' Makefile

%build
export CFLAGS="%{optflags}"
make BINDIR="%{_bindir}" PACKAGE_DATA_DIR="%{_datadir}/%{name}" DOCDIR="%{_docdir}/%{name}"

%install
make BINDIR="%{buildroot}%{_bindir}" PACKAGE_DATA_DIR="%{buildroot}%{_datadir}/%{name}" DOCDIR="%{buildroot}%{_docdir}/%{name}" install
# Install missing doc files
install -m 644 LICENSE-ttf AUTHORS %{buildroot}/%{_docdir}/%{name}/
install -d -D -m 755 %{buildroot}%{_datadir}/applications/
install -D -m 644 %{SOURCE1} %{buildroot}%{_datadir}/applications/
install -d -D -m 755 %{buildroot}%{_datadir}/pixmaps/
install -D -m 644 icon32.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
%suse_update_desktop_file %{name}
%fdupes %{buildroot}

%files
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_docdir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png

%changelog
openSUSE Build Service is sponsored by