Name:    aisleriot
Epoch:   1
Version: 3.22.9
Release: 2
Summary: A collection of card games

License: GPL-3.0-or-later and LGPL-3.0-or-later and GFDL-1.1-or-later and GFDL-1.3-only
URL:     https://wiki.gnome.org/Apps/Aisleriot
Source0: https://download.gnome.org/sources/aisleriot/3.22/aisleriot-%{version}.tar.xz

BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: pkgconfig(guile-2.0)
BuildRequires: pkgconfig(librsvg-2.0)
BuildRequires: pkgconfig(libcanberra-gtk3)
BuildRequires: appdata-tools
BuildRequires: desktop-file-utils
# Required for autoreconf (to copy guile-2.2.m4 macros to aclocal.m4).
BuildRequires: autoconf automake libtool
BuildRequires: gcc
BuildRequires: intltool
BuildRequires: itstool
BuildRequires: libappstream-glib
BuildRequires: make
BuildRequires: yelp-tools

%description
Aisleriot is a collection of over 80 card games programmed in scheme.

%prep
%autosetup -p1

%build
autoreconf --force --install
%configure --with-guile=2.0 --with-platform=gtk-only --with-pysol-card-theme-path=%_datadir/games/pysol
%make_build

%install
%make_install

# Update the screenshot shown in the software center
#
# NOTE: It would be *awesome* if this file was pushed upstream.
#
# See http://people.freedesktop.org/~hughsient/appdata/#screenshots for more details.
#
appstream-util replace-screenshots $RPM_BUILD_ROOT%{_datadir}/metainfo/sol.appdata.xml \
  https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/sol/a.png \
  https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/sol/b.png \
  https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/sol/c.png \
  https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/sol/d.png 

# Omit the valgrind suppression file; only for use during development
rm $RPM_BUILD_ROOT%{_libdir}/valgrind/aisleriot.supp

%find_lang %{name} --with-gnome

%check
appstream-util validate-relax --nonet $RPM_BUILD_ROOT%{_datadir}/metainfo/sol.appdata.xml
desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/sol.desktop

%files -f %{name}.lang
%doc AUTHORS
%license COPYING.GPL3 COPYING.LGPL3 COPYING.GFDL
%{_bindir}/*
%{_libdir}/aisleriot
%{_libexecdir}/aisleriot/
%{_datadir}/aisleriot
%{_datadir}/applications/sol.desktop
%{_datadir}/icons/hicolor/*/apps/*.png
%{_datadir}/icons/hicolor/symbolic/apps/gnome-aisleriot-symbolic.svg
%{_datadir}/metainfo/sol.appdata.xml
%{_datadir}/glib-2.0/schemas/org.gnome.Patience.WindowState.gschema.xml
%{_mandir}/man6/sol.6*

%changelog
* Tue Dec 10 2024 Funda Wang <fundawang@yeah.net> - 1:3.22.9-2
- clearify license

* Fri May 26 2023 wangtaozhi <wangtaozhi@kylinsec.com.cn> - 1:3.22.9-1
- Package init
