File dangerdeep.spec of Package dangerdeep
#
# spec file for package dangerdeep
#
# Copyright (c) 2018 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: dangerdeep
Version: 0.4.0+git.1483314290.aec5b6c
Release: 0
Summary: WW2 German submarine simulation
License: GPL-2.0-only
Group: Amusements/Games/3D/Simulation
Url: http://dangerdeep.sourceforge.net/
Source: %{name}-%{version}.tar.xz
# PATCH-FIX-OPENSUSE libavutil-path.patch - Fix path of avutil header on openSUSE
Patch0: libavutil-path.patch
# PATCH-FIX-UPSTREAM define-static-member.patch - https://sourceforge.net/p/dangerdeep/patches/25/
Patch1: define-static-member.patch
# PATCH-FIX-UPSTREAM dangerdeep-0.4.0-scons-python3.patch -- Fix build with scons based on Python 3
Patch2: dangerdeep-0.4.0-scons-python3.patch
BuildRequires: ImageMagick
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: hicolor-icon-theme
BuildRequires: pkgconfig
BuildRequires: scons
BuildRequires: update-desktop-files
BuildRequires: pkgconfig(SDL_image)
BuildRequires: pkgconfig(SDL_mixer)
BuildRequires: pkgconfig(SDL_net)
BuildRequires: pkgconfig(bzip2)
BuildRequires: pkgconfig(fftw3)
BuildRequires: pkgconfig(gl)
BuildRequires: pkgconfig(glu)
BuildRequires: pkgconfig(libavutil)
BuildRequires: pkgconfig(sdl)
Requires: %{name}-data
%description
Danger from the deep is a World War II German submarine simulation.
%package data
Summary: Data package for the dangerdeep
License: CC-BY-NC-ND-2.0 AND CC-BY-NC-ND-2.5
Group: Amusements/Games/3D/Simulation
BuildArch: noarch
Requires: %{name} = %{version}
%description data
Data files for the "Danger from the Deep" World War II german submarine simulator
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
# fix paths
perl -i -pe "s|/usr/local/bin|%{_bindir}|;" \
-pe "s|/usr/local/share/dangerdeep|%{_datadir}/dangerdeep|;" \
-pe "s|/usr/local/lib|%{_libdir}|;" SConstruct
# spurious-executable-perm
find src "(" -name '*.h' -o -name "*.cpp" ")" -exec chmod a-x {} +
# file-not-utf8
iconv -f iso8859-1 -t utf-8 ChangeLog > ChangeLog.conv && mv -f ChangeLog.conv ChangeLog
iconv -f iso8859-1 -t utf-8 CREDITS > CREDITS.conv && mv -f CREDITS.conv CREDITS
iconv -f iso8859-1 -t utf-8 README > README.conv && mv -f README.conv README
iconv -f iso8859-1 -t utf-8 LICENSE > LICENSE.conv && mv -f LICENSE.conv LICENSE
%build
export CXXFLAGS="%{optflags} -std=c++98"
scons %{?_smp_mflags} \
datadir=%{_datadir}/%{name} \
usex86sse=1
for i in 16 32 48; do
convert -size ${i}x$i logo.xpm -strip -resize ${i}x$i %{name}-${i}x$i.png
done
%install
scons \
installbindir=%{buildroot}%{_bindir} \
installdatadir=%{buildroot}%{_datadir} \
datadir=%{_datadir}/%{name} \
install
# icon
install -vDm 644 %{name}-16x16.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/%{name}.png
install -vDm 644 %{name}-32x32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
install -vDm 644 %{name}-48x48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
# .desktop file
%suse_update_desktop_file -c %{name} "Danger from the deep" "WW2 german submarine simulation" %{name} %{name} Game StrategyGame
# Data
mkdir -vp %{buildroot}/%{_datadir}/dangerdeep
cp -vap data/* %{buildroot}/%{_datadir}/dangerdeep
# remove duplicates
%fdupes %{buildroot}/%{_datadir}
%post
%desktop_database_post
%icon_theme_cache_post
%postun
%desktop_database_postun
%icon_theme_cache_postun
%files
%defattr(-,root,root)
%doc ChangeLog CREDITS README
%license LICENSE
%{_bindir}/%{name}
%dir %{_datadir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%files data
%defattr(-,root,root)
%{_datadir}/%{name}/*
%changelog