File tagainijisho.spec of Package tagainijisho
#
# spec file for package tagainijisho
#
# Copyright (c) 2025 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/
#
%define __builder ninja
%define kanjivg_version 20250816
Name: tagainijisho
Version: 1.2.2+89.g4f5f9d8
Release: 0
Summary: Japanese dictionary and learning assistant
License: GPL-3.0-only AND CC-BY-SA-3.0
URL: https://www.tagaini.net/
Source0: %{name}-%{version}.tar.zst
Source1: https://github.com/KanjiVG/kanjivg/releases/download/r%{kanjivg_version}/kanjivg-%{kanjivg_version}.xml.gz
Source2: http://www.edrdg.org/kanjidic/kanjidic2.xml.gz
Source3: http://ftp.edrdg.org/pub/Nihongo/JMdict.gz
Source4: LICENSE.dict
BuildRequires: MultiMarkdown-6
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: hicolor-icon-theme
BuildRequires: ninja
BuildRequires: pkgconfig
BuildRequires: xz
BuildRequires: cmake(Qt6Gui)
BuildRequires: cmake(Qt6LinguistTools)
BuildRequires: cmake(Qt6Network)
BuildRequires: cmake(Qt6PrintSupport)
BuildRequires: cmake(Qt6Widgets)
BuildRequires: pkgconfig(sqlite3)
%description
A Japanese dictionary and study assistant that features Kanji lookup and
stroke order, study lists, powerful search parameters, and much more.
This package uses the EDICT and KANJIDIC dictionary files. These files
are the property of the Electronic Dictionary Research and Development
Group, and are used in conformance with the Group's licence.
%prep
%setup -q
mkdir 3rdparty
cp %{SOURCE1} 3rdparty/kanjivg.xml.gz
gunzip 3rdparty/kanjivg.xml.gz
cp %{SOURCE2} 3rdparty/kanjidic2.xml.gz
gunzip 3rdparty/kanjidic2.xml.gz
cp %{SOURCE3} 3rdparty/JMdict.gz
gunzip 3rdparty/JMdict.gz
cp %{SOURCE4} .
%build
%cmake -DEMBED_SQLITE=NO ..
%cmake_build docs
# have to re-run cmake to make it pick up the docs
# nobody ever writes good cmake scripts… this litters the source tree
cmake .
%cmake_build
%install
%cmake_install install_docs
install -d 755 %{buildroot}%{_docdir}/%{name}
mv %{buildroot}%{_datadir}/%{name}/doc/* %{buildroot}%{_docdir}/%{name}
%fdupes %{buildroot}/%{_prefix}
%files
%license COPYING.txt LICENSE.dict
%doc README.md Changelog
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.*
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/%{name}
%{_docdir}/%{name}/manual.html
%{_docdir}/%{name}/images
%changelog