File hearts.spec of Package hearts

#
# spec file for package hearts
#
# Copyright (c) 2020 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 https://bugs.opensuse.org/
#


Name:           hearts
Version:        @SERVICE@
Release:        0
Summary:        The card game
License:        MIT
Group:          Amusements/Games/Board/Card
URL:            https://github.com/Rescator7/Hearts
Source:         %{name}-%{version}.tar.xz
# URL: http://www.iconarchive.com/show/flatwoken-icons-by-alecive/Apps-Game-Cards-icon.html
# License: CC-BY-SA-4.0
Source1:        %{name}.svg
Source2:        leaves.jpg
Patch1:         install.patch
Patch2:         config_cpp.patch
Patch3:         mainwindow_cpp.patch
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig
BuildRequires:  cmake(Qt5LinguistTools)
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5Svg)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(allegro-5)
BuildRequires:  pkgconfig(allegro_acodec-5)
BuildRequires:  pkgconfig(allegro_audio-5)
BuildRequires:  pkgconfig(allegro_memfile-5)
BuildRequires:  rsvg-convert
%requires_eq    libQt5Svg5

%description
The overall objective is to be the player with the fewest points by the end of the game.
The card game Hearts for QT 5.x and liballegro 5 (for sounds support)

%prep
%autosetup -p1
mkdir -p data/icons/{16x16,24x24,32x32,48x48,64x64,72x72,96x96,128x128,256x256,512x512,scalable}/apps
cp %{SOURCE1} ./data/icons/scalable/apps/
for i in 16 24 32 48 64 72 96 128 256 512 ; do
    rsvg-convert -a -h $i %{SOURCE1} -o data/icons/$i\x$i/apps/%{name}.png
done
cp %{SOURCE2} backgrounds/leaves.jpg
cat > ./data/%{name}.desktop <<-EOF
[Desktop Entry]
Name=Hearts
Name[fr]=La Dame de Pique
Name[ru]=Червы
GenericName=Card Game Hearts
GenericName[fr]=La Dame de Pique
GenericName[ru]=Карточная игра Червы
Exec=%{name}
Icon=%{name}
Type=Application
Categories=Game;CardGame;
EOF

%build
export LANG=C.UTF-8
rm -fv languages/translation_*.qm
%qmake5
%make_build

%install
%qmake5_install

%files
%doc Changelog README.md
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.??g
%license LICENSE

%changelog
openSUSE Build Service is sponsored by