Blob Blame History Raw
%bcond docs 1
# tests are broken on s390x
%ifarch s390x
%bcond tests 0
%bcond tests 1

Name:           crosswords
Version:        0.3.13
Release:        %autorelease
Summary:        Solve crossword puzzles

# crosswords itself is GPL-3.0-or-later, the puzzle sets it bundles are
# CC-BY-SA-4.0
License:        GPL-3.0-or-later AND CC-BY-SA-4.0
Source:         %{url}/-/archive/%{version}/%{name}-%{version}.tar.gz

BuildRequires:  desktop-file-utils
BuildRequires:  cmake
BuildRequires:  gcc
BuildRequires:  libappstream-glib
BuildRequires:  meson
BuildRequires:  sed
%if %{with docs}
BuildRequires:  python3dist(sphinx)
BuildRequires:  python3dist(sphinx-rtd-theme)
BuildRequires:  python3dist(myst-parser)
%if %{with tests}
# gen-word-list requires en_US.UTF8
BuildRequires:  glibc-langpack-en

BuildRequires:  pkgconfig(gio-2.0)
BuildRequires:  pkgconfig(gio-unix-2.0)
BuildRequires:  pkgconfig(gtk4)
BuildRequires:  pkgconfig(iso-codes)
BuildRequires:  pkgconfig(json-glib-1.0)
BuildRequires:  pkgconfig(libadwaita-1)
BuildRequires:  pkgconfig(libipuz-0.4)
BuildRequires:  pkgconfig(libpanel-1)
BuildRequires:  pkgconfig(librsvg-2.0)

Requires:       dbus-common
Requires:       %{name}-puzzle-sets-cats-and-dogs = %{version}-%{release}
Requires:       %{name}-puzzle-sets-uri = %{version}-%{release}
Recommends:     %{name}-thumbnailer = %{version}-%{release}
Suggests:       crossword-editor = %{version}-%{release}
%if %{with docs}
Suggests:       %{name}-doc = %{version}-%{release}

A simple and fun game of crosswords. Load your crossword files, or play one of
the included games. Features include:

- Support for shaped and colored crosswords
- Loading .ipuz and .puz files
- Hint support, such as showing mistakes and suggesting words
- Dark mode support
- Locally installed crosswords as well as support for 3rd party downloaders

%package        puzzle-sets-cats-and-dogs
Summary:        Puzzles about cats and dogs for GNOME Crosswords
Requires:       %{name} = %{version}-%{release}
BuildArch:      noarch

%description    puzzle-sets-cats-and-dogs
This package contains a puzzle set about cats and dogs for GNOME Crosswords.

%package        puzzle-sets-internal
Summary:        Load additional puzzles for GNOME Crosswords
Requires:       %{name} = %{version}-%{release}
Provides:       crosswords-puzzle-sets-uri = %{version}-%{release}
Obsoletes:      crosswords-puzzle-sets-uri < 0.3.6-3
BuildArch:      noarch

# Used to load .puz files from disk
Recommends:     ipuz-convertor = %{version}-%{release}

%description    puzzle-sets-internal
This package contains puzzle sets used internally by GNOME Crosswords to load
additional puzzles from disk.

%package        thumbnailer
Summary:        GNOME Crosswords Thumbnailer

%description    thumbnailer
This package provides a thumbnailer for crosswords puzzles in formats supported
by GNOME Crosswords.

%if %{with docs}
%package        doc
Summary:        Documentation for %{name}
BuildArch:      noarch

%description    doc
This package contains additional documentation for GNOME Crosswords.

%package -n     crossword-editor
Summary:        Crossword puzzle editor

Requires:       %{name}%{?_isa} = %{version}-%{release}
Recommends:     %{name}-thumbnailer = %{version}-%{release}
# Used to load .puz files from disk
Recommends:     ipuz-convertor = %{version}-%{release}

%description -n crossword-editor
Standalone-tool to create crossword puzzles based on GNOME Crosswords. It can
be used to create simple puzzles with grids and clues. It has a pattern solver
and grid autofill dialog for filling in hard-to-finish corners, and will make
suggestions of words when creating the grid.

%package -n     ipuz-convertor
Summary:        Converts puz files to ipuz files
BuildArch:      noarch

Requires:       crosswords
Requires:       python3
Requires:       python3dist(dateparser)
Requires:       python3dist(lxml)
Requires:       python3dist(puzpy)
Requires:       python3dist(regex)

%description -n ipuz-convertor
ipuz-convertor is a script to convert puzzle files from puz to ipuz.

%autosetup -p1

# Update image references in README
mkdir images
cp -p data/images/{a-dogs-day,hero}.png images/
sed -i 's:data/images/:images/:g'

%meson -Ddevelopment=false

%if %{with docs}
sphinx-build-3 docs html
rm -rf html/.{doctrees,buildinfo}

%find_lang %{name}

%if %{with tests}

appstream-util validate-relax --nonet \

desktop-file-validate \
  %{buildroot}/%{_datadir}/applications/org.gnome.Crosswords.desktop \

%files -f %{name}.lang
%license COPYING
%doc images
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/puzzle-sets

%if %{with docs}
%files doc
%license COPYING
%doc html

%files puzzle-sets-cats-and-dogs
%license COPYING

%files puzzle-sets-internal
%license COPYING
%exclude %{_datadir}/%{name}/puzzle-sets/cats-and-dogs

%files thumbnailer
%license COPYING
%dir %{_datadir}/thumbnailers

%files -n crossword-editor

%files -n ipuz-convertor
%license COPYING