File pinball.spec of Package pinball

# spec file for package pinball
# Copyright (c) 2021 SUSE LLC
# 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:           pinball
Version:        0.3.1
Release:        0
Summary:        Emilia Pinball Emulator
License:        GPL-2.0-only
Group:          Amusements/Games/Action/Arcade
Source1:        pinball.desktop
Source2:        pinball-16x16.png
Source3:        pinball-32x32.png
Source4:        pinball-48x48.png
Patch0:         pinball-0.3.1-sys-ltdl.patch
Patch1:         pinball-0.3.1-strictproto.patch
Patch2:         pinball-0.3.1-lacomment.patch
Patch3:         pinball-0.3.1-cstddef.patch
Patch4:         0001-Do-not-return-pointer-to-temporary.patch
Patch5:         fix_make_dependency_order.patch
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  libtool
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(SDL_image)
BuildRequires:  pkgconfig(SDL_mixer)
%if 0%{?suse_version} >= 1500
Requires(pre):  user(games)
Requires(pre):  group(games)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%global _lto_cflags %{?_lto_cflags} -ffat-lto-objects

The Emilia Pinball Project is a pinball simulator for Linux and other
Unix systems. There are only two levels to play with, but they are very

%package devel
Summary:        Developemnt files for %{name}
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description devel
Development files for %{name}.

%setup -q
%patch0 -p1
%patch2 -p1
%patch4 -p1
rm -fr libltdl

# update libtool to distro version, bundled one breaks when libpthread is a linker script
autoreconf -i -f
%configure \
    --disable-static \
    --disable-libtest \
%__make %{?_smp_mflags} VERBOSE=1 CXXFLAGS="%{optflags}"

chmod -x ChangeLog
install -Dm 0644 %{SOURCE1} \
install -Dm 0644 %{SOURCE2} \
install -Dm 0644 %{SOURCE3} \
install -Dm 0644 %{SOURCE4} \
# remove unused test module
rm %{buildroot}%{_libdir}/%{name}/libModuleTest.*
# ltdl can use native (.so) libs, but we have to fix the name in the pinball definition
for pbl in %{buildroot}%{_datadir}/%{name}/*/*.pbl; do
    sed -i -e 's#\(libModule.*\).la#\' $pbl && echo "Patched $pbl"
# remove unused pcx files (only used by alternative Allegro backend)
rm %{buildroot}%{_datadir}/%{name}/*.pcx
rm %{buildroot}%{_datadir}/%{name}/*/*.pcx
# remove bogus development files
rm %{buildroot}%{_libdir}/%{name}/lib*.{la,a}
%fdupes -s %{buildroot}%{_datadir}/%{name}/



%doc ChangeLog README
%license COPYING
%dir %{_libdir}/%{name}
%dir %{_localstatedir}/games/
%dir %{_localstatedir}/games/%{name}/
%dir %attr(0775,games,games) %{_localstatedir}/games/%{name}/*/
%ghost %attr(0664,games,games) %{_localstatedir}/games/%{name}/*/highscores

%files devel
%license COPYING

openSUSE Build Service is sponsored by