Blame crosswords.spec

c9dd5d0
%bcond docs 1
d50702f
# tests are broken on s390x
d50702f
# https://gitlab.gnome.org/jrb/crosswords/-/issues/118
d50702f
%ifarch s390x
c9dd5d0
%bcond tests 0
d50702f
%else
c9dd5d0
%bcond tests 1
d50702f
%endif
1e4b93d
1e4b93d
Name:           crosswords
6b5a738
Version:        0.3.13.3
1e4b93d
Release:        %autorelease
1e4b93d
Summary:        Solve crossword puzzles
1e4b93d
124fb94
# crosswords itself is GPL-3.0-or-later, the puzzle sets it bundles are
124fb94
# CC-BY-SA-4.0
9abefb6
License:        GPL-3.0-or-later AND CC-BY-SA-4.0
1e4b93d
URL:            https://gitlab.gnome.org/jrb/crosswords
1e4b93d
Source:         %{url}/-/archive/%{version}/%{name}-%{version}.tar.gz
6b5a738
# Update requirements.txt and add a warning
6b5a738
Patch:          %{url}/-/commit/0458426e9595c95f765f347d47a27a2a4ed8ae63.patch
6b5a738
# build: relax Python version pins in requirements.txt
6b5a738
Patch:          %{url}/-/merge_requests/179.patch
1e4b93d
1e4b93d
BuildRequires:  desktop-file-utils
1e4b93d
BuildRequires:  cmake
1e4b93d
BuildRequires:  gcc
1e4b93d
BuildRequires:  libappstream-glib
1e4b93d
BuildRequires:  meson
6b5a738
BuildRequires:  python3-devel
1e4b93d
BuildRequires:  sed
d1fde43
%if %{with docs}
d1fde43
BuildRequires:  python3dist(sphinx)
d1fde43
BuildRequires:  python3dist(sphinx-rtd-theme)
d1fde43
BuildRequires:  python3dist(myst-parser)
d1fde43
%endif
1e4b93d
%if %{with tests}
1e4b93d
# gen-word-list requires en_US.UTF8
1e4b93d
# https://gitlab.gnome.org/jrb/crosswords/-/issues/109
1e4b93d
BuildRequires:  glibc-langpack-en
1e4b93d
%endif
1e4b93d
1e4b93d
BuildRequires:  pkgconfig(gio-2.0)
1e4b93d
BuildRequires:  pkgconfig(gio-unix-2.0)
1e4b93d
BuildRequires:  pkgconfig(gtk4)
4651127
BuildRequires:  pkgconfig(iso-codes)
4651127
BuildRequires:  pkgconfig(json-glib-1.0)
1e4b93d
BuildRequires:  pkgconfig(libadwaita-1)
a24cc22
BuildRequires:  pkgconfig(libipuz-0.4)
f81e2ce
BuildRequires:  pkgconfig(libpanel-1)
4651127
BuildRequires:  pkgconfig(librsvg-2.0)
1e4b93d
1e4b93d
Requires:       dbus-common
dca2a34
Requires:       %{name}-puzzle-sets-cats-and-dogs = %{version}-%{release}
dca2a34
Requires:       %{name}-puzzle-sets-uri = %{version}-%{release}
c9dd5d0
Recommends:     %{name}-thumbnailer = %{version}-%{release}
1e4b93d
Suggests:       crossword-editor = %{version}-%{release}
d1fde43
%if %{with docs}
1e4b93d
Suggests:       %{name}-doc = %{version}-%{release}
d1fde43
%endif
1e4b93d
1e4b93d
%description
1e4b93d
A simple and fun game of crosswords. Load your crossword files, or play one of
1e4b93d
the included games. Features include:
1e4b93d
1e4b93d
- Support for shaped and colored crosswords
1e4b93d
- Loading .ipuz and .puz files
1e4b93d
- Hint support, such as showing mistakes and suggesting words
1e4b93d
- Dark mode support
1e4b93d
- Locally installed crosswords as well as support for 3rd party downloaders
1e4b93d
1e4b93d
%package        puzzle-sets-cats-and-dogs
1e4b93d
Summary:        Puzzles about cats and dogs for GNOME Crosswords
1e4b93d
Requires:       %{name} = %{version}-%{release}
1e4b93d
BuildArch:      noarch
1e4b93d
1e4b93d
%description    puzzle-sets-cats-and-dogs
1e4b93d
This package contains a puzzle set about cats and dogs for GNOME Crosswords.
1e4b93d
3d29106
%package        puzzle-sets-internal
3d29106
Summary:        Load additional puzzles for GNOME Crosswords
1e4b93d
Requires:       %{name} = %{version}-%{release}
3d29106
Provides:       crosswords-puzzle-sets-uri = %{version}-%{release}
3d29106
Obsoletes:      crosswords-puzzle-sets-uri < 0.3.6-3
1e4b93d
BuildArch:      noarch
1e4b93d
1e4b93d
# Used to load .puz files from disk
1e4b93d
Recommends:     ipuz-convertor = %{version}-%{release}
1e4b93d
3d29106
%description    puzzle-sets-internal
3d29106
This package contains puzzle sets used internally by GNOME Crosswords to load
3d29106
additional puzzles from disk.
1e4b93d
c9dd5d0
%package        thumbnailer
c9dd5d0
Summary:        GNOME Crosswords Thumbnailer
c9dd5d0
c9dd5d0
%description    thumbnailer
c9dd5d0
This package provides a thumbnailer for crosswords puzzles in formats supported
c9dd5d0
by GNOME Crosswords.
c9dd5d0
d1fde43
%if %{with docs}
1e4b93d
%package        doc
1e4b93d
Summary:        Documentation for %{name}
1e4b93d
BuildArch:      noarch
1e4b93d
1e4b93d
%description    doc
1e4b93d
This package contains additional documentation for GNOME Crosswords.
d1fde43
%endif
1e4b93d
1e4b93d
%package -n     crossword-editor
1e4b93d
Summary:        Crossword puzzle editor
1e4b93d
1e4b93d
Requires:       %{name}%{?_isa} = %{version}-%{release}
c9dd5d0
Recommends:     %{name}-thumbnailer = %{version}-%{release}
1e4b93d
# Used to load .puz files from disk
1e4b93d
Recommends:     ipuz-convertor = %{version}-%{release}
1e4b93d
1e4b93d
%description -n crossword-editor
1e4b93d
Standalone-tool to create crossword puzzles based on GNOME Crosswords. It can
1e4b93d
be used to create simple puzzles with grids and clues. It has a pattern solver
1e4b93d
and grid autofill dialog for filling in hard-to-finish corners, and will make
1e4b93d
suggestions of words when creating the grid.
1e4b93d
1e4b93d
%package -n     ipuz-convertor
1e4b93d
Summary:        Converts puz files to ipuz files
1e4b93d
BuildArch:      noarch
1e4b93d
124fb94
Requires:       crosswords
1e4b93d
Requires:       python3
6b5a738
Requires:       python3dist(beautifulsoup4)
1e4b93d
Requires:       python3dist(dateparser)
1e4b93d
Requires:       python3dist(lxml)
1e4b93d
Requires:       python3dist(puzpy)
1e4b93d
Requires:       python3dist(regex)
6b5a738
Requires:       python3dist(requests)
6b5a738
Requires:       python3dist(xdfile)
1e4b93d
1e4b93d
%description -n ipuz-convertor
1e4b93d
ipuz-convertor is a script to convert puzzle files from puz to ipuz.
1e4b93d
1e4b93d
%prep
1e4b93d
%autosetup -p1
1e4b93d
1e4b93d
# Update image references in README
1e4b93d
mkdir images
1e4b93d
cp -p data/images/{a-dogs-day,hero}.png images/
1e4b93d
sed -i 's:data/images/:images/:g' README.md
1e4b93d
6b5a738
# Generate Python dependencies for the converter
6b5a738
%generate_buildrequires
6b5a738
%pyproject_buildrequires -N requirements.txt
6b5a738
1e4b93d
%build
1e4b93d
%meson -Ddevelopment=false
1e4b93d
%meson_build
1e4b93d
d1fde43
%if %{with docs}
d1fde43
sphinx-build-3 docs html
d1fde43
rm -rf html/.{doctrees,buildinfo}
d1fde43
%endif
d1fde43
1e4b93d
%install
1e4b93d
%meson_install
1e4b93d
%find_lang %{name}
1e4b93d
1e4b93d
%if %{with tests}
1e4b93d
%check
1e4b93d
%meson_test
1e4b93d
1e4b93d
appstream-util validate-relax --nonet \
1e4b93d
  %{buildroot}%{_metainfodir}/org.gnome.Crosswords.metainfo.xml
1e4b93d
1e4b93d
desktop-file-validate \
1e4b93d
  %{buildroot}/%{_datadir}/applications/org.gnome.Crosswords.desktop \
1e4b93d
  %{buildroot}/%{_datadir}/applications/org.gnome.Crosswords.Editor.desktop
1e4b93d
%endif
1e4b93d
1e4b93d
%files -f %{name}.lang
1e4b93d
%license COPYING
1e4b93d
%doc CONTRIBUTING.md NEWS.md README.md TODO.md images
1e4b93d
%{_bindir}/%{name}
1e4b93d
%dir %{_datadir}/%{name}
1e4b93d
%dir %{_datadir}/%{name}/puzzle-sets
1e4b93d
%{_datadir}/applications/org.gnome.Crosswords.desktop
1e4b93d
%{_datadir}/dbus-1/services/org.gnome.Crosswords.service
1e4b93d
%{_datadir}/glib-2.0/schemas/org.gnome.Crosswords.gschema.xml
1e4b93d
%{_datadir}/icons/hicolor/scalable/apps/org.gnome.Crosswords.svg
1e4b93d
%{_datadir}/icons/hicolor/symbolic/apps/org.gnome.Crosswords-symbolic.svg
1e4b93d
%{_datadir}/mime/packages/org.gnome.Crosswords.xml
1e4b93d
%{_metainfodir}/org.gnome.Crosswords.metainfo.xml
1e4b93d
d1fde43
%if %{with docs}
1e4b93d
%files doc
1e4b93d
%license COPYING
d1fde43
%doc html
d1fde43
%endif
1e4b93d
1e4b93d
%files puzzle-sets-cats-and-dogs
1e4b93d
%license COPYING
1e4b93d
%{_datadir}/%{name}/puzzle-sets/cats-and-dogs
1e4b93d
3d29106
%files puzzle-sets-internal
1e4b93d
%license COPYING
3d29106
%{_datadir}/%{name}/puzzle-sets/*
3d29106
%exclude %{_datadir}/%{name}/puzzle-sets/cats-and-dogs
1e4b93d
c9dd5d0
%files thumbnailer
c9dd5d0
%license COPYING
c9dd5d0
%{_bindir}/%{name}-thumbnailer
c9dd5d0
%dir %{_datadir}/thumbnailers
c9dd5d0
%{_datadir}/thumbnailers/%{name}.thumbnailer
c9dd5d0
1e4b93d
%files -n crossword-editor
1e4b93d
%{_bindir}/crossword-editor
1e4b93d
%{_datadir}/applications/org.gnome.Crosswords.Editor.desktop
1e4b93d
%{_datadir}/dbus-1/services/org.gnome.Crosswords.Editor.service
1e4b93d
%{_datadir}/glib-2.0/schemas/org.gnome.Crosswords.Editor.gschema.xml
1e4b93d
%{_datadir}/icons/hicolor/scalable/apps/org.gnome.Crosswords.Editor.svg
1e4b93d
%{_datadir}/icons/hicolor/symbolic/apps/org.gnome.Crosswords.Editor-symbolic.svg
0eddf8f
%{_metainfodir}/org.gnome.Crosswords.Editor.metainfo.xml
1e4b93d
1e4b93d
%files -n ipuz-convertor
1e4b93d
%license COPYING
124fb94
%{_datadir}/%{name}/ipuz-convertor
1e4b93d
%{_libexecdir}/ipuz-convertor
1e4b93d
1e4b93d
%changelog
1e4b93d
%autochangelog