# https://github.com/fushinari/Wordbook/commit/2d79e9e9ef21ba4b54d0b46c764a1481a06f0f1b %global commit 2d79e9e9ef21ba4b54d0b46c764a1481a06f0f1b %global commit_date 20221101 %global short_commit %(c=%{commit}; echo ${c:0:7}) %global snapshot %{commit_date}git%{short_commit} %global bname wordbook %global rdns com.github.fushinari.Wordbook Name: Wordbook Version: 0.3.1^%{snapshot} Release: 1%{?dist} Summary: Offline English dictionary using Open English WordNet License: GPL-3.0-or-later URL: https://github.com/fushinari/%{name} Source0: %{url}/archive/%{commit}/%{name}-%{commit}.tar.gz BuildArch: noarch BuildRequires: python3-devel BuildRequires: meson # Minimum versions according to upstream # https://github.com/fushinari/Wordbook/blob/2d79e9e9ef21ba4b54d0b46c764a1481a06f0f1b/meson.build#L23-L27 BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.35.0 BuildRequires: pkgconfig(gtk4) >= 4.6 BuildRequires: pkgconfig(libadwaita-1) >= 1.0 BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(pygobject-3.0) >= 3.29.1 BuildRequires: desktop-file-utils BuildRequires: libappstream-glib Requires: libadwaita >= 1.0 # python3-wn is also built in this Copr Requires: python3dist(wn) = 0.9.1 Provides: %{bname} = %{version}-%{release} %description Wordbook is an offline English-English dictionary application built for GNOME using the Open English WordNet database for definitions and the reliable eSpeak for pronunciations (both audio and phoneme). Features: - Fully offline after initial data download - Random Word - Live Search - Double click to search - Custom Definitions feature using Pango Markup or an HTML subset for formatting - Support for GNOME Dark Mode and launching app in dark mode. %prep %autosetup -n %{name}-%{commit} # Patch AppStream data path sed -i -e "s|install_dir: join_paths(get_option('datadir'), 'appdata')|install_dir: join_paths(get_option('datadir'), 'metainfo')|" data/meson.build %build %meson %meson_build %install %meson_install %py3_shebang_fix %{buildroot}%{_bindir}/%{bname} %find_lang %{bname} %check desktop-file-validate %{buildroot}%{_datadir}/applications/%{rdns}.desktop appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{rdns}.metainfo.xml %files -f %{bname}.lang %license LICENSE %doc README.md %{_bindir}/%{bname} %{_datadir}/%{bname}/ %{_datadir}/applications/%{rdns}.desktop %{_datadir}/icons/hicolor/scalable/apps/%{rdns}.svg %{_datadir}/icons/hicolor/symbolic/apps/%{rdns}-symbolic.svg %{_datadir}/glib-2.0/schemas/%{rdns}.gschema.xml %{_metainfodir}/%{rdns}.metainfo.xml %changelog * Sat Jan 28 2023 Justin Koh - 0.3.1^20221101git2d79e9e-1 - Initial build