File hearts.spec of Package hearts
#
# spec file for package hearts
#
# Copyright (c) 2025 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: 1.9.2
Release: 0
Summary: The card game
License: MIT
Group: Amusements/Games/Board/Card
URL: https://github.com/Rescator7/Hearts
Source0: %{name}-%{version}.tar.gz
# URL: http://www.iconarchive.com/show/flatwoken-icons-by-alecive/Apps-Game-Cards-icon.html
# License: CC-BY-SA-4.0
Source1: %{name}.svg
#PATCH-FIX-OPENSUSE - hearts-install.patch - Fix install places
Patch0: hearts-install.patch
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: hicolor-icon-theme
BuildRequires: pkgconfig
BuildRequires: rsvg-convert
BuildRequires: pkgconfig(allegro-5)
BuildRequires: pkgconfig(allegro_acodec-5)
BuildRequires: pkgconfig(allegro_audio-5)
BuildRequires: pkgconfig(allegro_memfile-5)
%if 0%{?suse_version} >= 1699
BuildRequires: cmake(Qt6Core)
BuildRequires: cmake(Qt6Gui)
BuildRequires: cmake(Qt6LinguistTools)
BuildRequires: cmake(Qt6Network)
BuildRequires: cmake(Qt6Svg)
BuildRequires: cmake(Qt6Widgets)
%requires_eq libQt6Svg6
%else
BuildRequires: cmake(Qt5LinguistTools)
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(Qt5Svg)
BuildRequires: pkgconfig(Qt5Widgets)
%requires_eq libQt5Svg5
%endif
%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 -n Hearts-%{version}
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
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
%if 0%{?suse_version} >= 1699
%qmake6
%qmake6_build
%else
%qmake5
%make_build
%endif
%install
%if 0%{?suse_version} >= 1699
%qmake6_install
%else
%qmake5_install
%endif
%files
%doc Changelog README.md
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.??g
%license LICENSE
%changelog