File PySolFC.spec of Package PySolFC
#
# spec file for package PySolFC
#
# Copyright (c) 2022 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: PySolFC
Version: 2.18.0
Release: 0
Summary: PySol Fan Club edition
License: GPL-3.0-or-later
Group: Amusements/Games/Board/Card
URL: http://pysolfc.sourceforge.net/
Source0: https://datapacket.dl.sourceforge.net/project/pysolfc/%{name}/%{name}-%{version}/%{name}-%{version}.tar.xz
Source1: %{name}.png
BuildRequires: fdupes
BuildRequires: hicolor-icon-theme
BuildRequires: python-rpm-macros
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%if 0%{?suse_version}
BuildRequires: python3-tk
BuildRequires: update-desktop-files
%endif
%if 0%{?fedora}
BuildRequires: python3-tkinter
BuildRequires: desktop-file-utils
%endif
## MANUAL BEGIN ##
Requires: python3-Pillow
Requires: python3-attrs
Requires: python3-base
Requires: python3-pygame
Requires: python3-pysol-cards
Requires: python3-random2
%if 0%{?suse_version}
Requires: python3-tk
%endif
%if 0%{?fedora}
Requires: python3-tkinter
%endif
Requires: python3-tk
Recommends: PySolFC-Cardsets
## MANUAL END ##
Conflicts: pysol
BuildArch: noarch
%description
PySolFC is a collection of more than 1000 solitaire card games.
It is a fork of PySol Solitaire.
There are games that use the 52 card International Pattern deck,
games for the 78 card Tarock deck, eight and ten suit Ganjifa
games, Hanafuda games, Matrix games, Mahjongg games, and games
for an original hexadecimal-based deck.
Its features include modern look and feel (uses Tile widget set),
multiple cardsets and tableau backgrounds, sound, unlimited undo,
player statistics, a hint system, demo games, a solitaire wizard,
support for user written plug-ins, an integrated HTML help browser,
and lots of documentation.
PySolFC is distributed under the terms of the GNU General Public
License.
%lang_package
%prep
%autosetup
sed -i -e 's|Icon=%{_datadir}/icons/pysol01.png|Icon=%{name}|g' data/pysol.desktop
sed -i -e 's|Encoding=UTF-8|GenericName=%{name}|g' data/pysol.desktop
# files aren't meant to be executed, remove shebang
find pysollib -name '*.py' | xargs sed -i -e '/\/usr\/bin\/env/d;/\/usr\/bin\/python3/d'
find pysollib -name '*.py' | xargs sed -i -e '/\/usr\/bin\/env/d;/\/usr\/bin\/python/d'
%build
%if 0%{?suse_version}
export LC_ALL=en_US.utf8
%python3_build
%endif
%if 0%{?fedora}
%py3_build
%endif
%install
%if 0%{?suse_version}
export LC_ALL=en_US.utf8
%python3_install
%endif
%if 0%{?fedora}
%py3_install
pathfix.py -pni "%{__python3} %{py3_shbang_opts}" %{buildroot}%{_bindir}/*
%endif
# menu-entry
%if 0%{?suse_version}
%suse_update_desktop_file -i pysol Game CardGame
%endif
%if 0%{?fedora}
desktop-file-install --delete-original --dir=%{buildroot}%{_datadir}/applications %{buildroot}%{_datadir}/applications/pysol.desktop
%endif
ln -s pysol.py %{buildroot}%{_bindir}/pysol
%find_lang pysol %{?no_lang_C}
%fdupes -s %{buildroot}
%files
%doc AUTHORS.md NEWS.asciidoc README.md
%license COPYING
%{_bindir}/pysol
%{_bindir}/pysol.py
%{python3_sitelib}/*
%{_datadir}/%{name}/
%{_datadir}/%{name}/*
%{_datadir}/applications/pysol.desktop
%{_datadir}/icons/*/*/apps/pysol*.png
%files lang -f pysol.lang
%changelog