4551ebb
%global __provides_exclude_from ^%{_libdir}/fcitx5/.*\\.so$
4551ebb
47198fc
%if 0%{?fedora} >= 40 
47198fc
  %ifarch %qt6_qtwebengine_arches
47198fc
    %global use_qt6 1
47198fc
    %define qtwebengine 1
47198fc
  %else
47198fc
    %global use_qt6 0
47198fc
    %ifarch %qt5_qtwebengine_arches
47198fc
      %define qtwebengine 1
47198fc
    %else
47198fc
      %define qtwebengine 0
47198fc
    %endif
47198fc
  %endif
e9d38b4
%else
47198fc
  %global use_qt6 0
47198fc
  %ifarch %qt5_qtwebengine_arches
47198fc
    %define qtwebengine 1
47198fc
  %else
47198fc
    %define qtwebengine 0
47198fc
  %endif
e9d38b4
%endif
e9d38b4
e9d38b4
%if %{use_qt6}
e9d38b4
%define qt_major_ver 6
e9d38b4
%else
e9d38b4
%define qt_major_ver 5
e9d38b4
%endif
e9d38b4
4551ebb
Name:           fcitx5-chinese-addons
7bfdc9f
Version:        5.1.5
ee5950e
Release:        %autorelease
4551ebb
Summary:        Chinese related addon for fcitx5
4551ebb
License:        LGPLv2+
a7b703f
URL:            https://github.com/fcitx/fcitx5-chinese-addons
7bfdc9f
Source:         https://download.fcitx-im.org/fcitx5/fcitx5-chinese-addons/fcitx5-chinese-addons-%{version}_dict.tar.zst
7bfdc9f
Source1:        https://download.fcitx-im.org/fcitx5/fcitx5-chinese-addons/fcitx5-chinese-addons-%{version}_dict.tar.zst.sig
a7b703f
Source2:        https://pgp.key-server.io/download/0x8E8B898CBF2412F9
ae32006
a7b703f
BuildRequires:  gnupg2
4551ebb
BuildRequires:  boost-devel
4551ebb
BuildRequires:  cmake
4551ebb
BuildRequires:  extra-cmake-modules
4551ebb
BuildRequires:  fcitx5-qt-devel
4551ebb
BuildRequires:  fcitx5-lua-devel
4551ebb
BuildRequires:  gcc-c++
4551ebb
BuildRequires:  libime-devel
4551ebb
BuildRequires:  ninja-build
4551ebb
BuildRequires:  gettext-devel
4551ebb
BuildRequires:  pkgconfig(libcurl)
4551ebb
BuildRequires:  pkgconfig(fmt)
47198fc
%if %{qtwebengine}
e9d38b4
BuildRequires:  cmake(Qt%{qt_major_ver}WebEngineWidgets)
47198fc
%else
47198fc
BuildRequires:  cmake(Qt%{qt_major_ver}WebKitWidgets)
47198fc
%endif
4551ebb
BuildRequires:  pkgconfig(opencc)
4551ebb
BuildRequires:  pkgconfig(Fcitx5Core)
4551ebb
BuildRequires:  pkgconfig(Fcitx5Module)
015cb1c
BuildRequires:  /usr/bin/appstream-util
4551ebb
Requires:       hicolor-icon-theme
4551ebb
Requires:       %{name}-data = %{version}-%{release}
4551ebb
Requires:       fcitx5-lua
4551ebb
Requires:       fcitx5-data
4551ebb
4551ebb
%description
4551ebb
This provides pinyin and table input method
4551ebb
support for fcitx5. Released under LGPL-2.1+.
4551ebb
4551ebb
im/pinyin/emoji.txt is derived from Unicode 
4551ebb
CLDR with modification.
4551ebb
4551ebb
%package data
4551ebb
Summary:        Data files of %{name}
4551ebb
BuildArch:      noarch
4551ebb
Requires:       %{name} = %{version}-%{release}
4551ebb
Requires:       hicolor-icon-theme
4551ebb
Requires:       fcitx5-lua
4551ebb
Requires:       fcitx5-data
4551ebb
4551ebb
%description data
4551ebb
The %{name}-data package provides shared data for %{name}.
4551ebb
4551ebb
%package devel
4551ebb
Summary:        Development files for %{name}
4551ebb
Requires:       %{name}%{?_isa} = %{version}-%{release}
4551ebb
Requires:       fcitx5-devel
4551ebb
4551ebb
%description devel
4551ebb
devel files for fcitx5-chinese-addons
4551ebb
4551ebb
%prep
a7b703f
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
ae32006
%autosetup -p1
4551ebb
4551ebb
%build
e9d38b4
%cmake -GNinja \
e9d38b4
%if %{use_qt6}
47198fc
    -DUSE_QT6=On \
47198fc
%else
47198fc
    -DUSE_QT6=Off \
47198fc
%endif
47198fc
%if %{qtwebengine}
47198fc
    -DUSE_WEBKIT=Off
e9d38b4
%else
47198fc
    -DUSE_WEBKIT=On
e9d38b4
%endif
4551ebb
%cmake_build 
4551ebb
4551ebb
%install
4551ebb
%cmake_install
4551ebb
fc1356d
# convert symlinked icons to copied icons, this will help co-existing with
fc1356d
# fcitx4
fc1356d
for iconfile in $(find %{buildroot}%{_datadir}/icons -type l)
fc1356d
do
fc1356d
  origicon=$(readlink -f ${iconfile})
fc1356d
  rm -f ${iconfile}
fc1356d
  cp ${origicon} ${iconfile}
fc1356d
done 
015cb1c
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.metainfo.xml
4551ebb
%find_lang %{name}
4551ebb
4551ebb
%check
4551ebb
%ctest
4551ebb
4551ebb
%files -f %{name}.lang
4551ebb
%license LICENSES/LGPL-2.1-or-later.txt
4551ebb
%doc README.md 
4551ebb
%{_bindir}/scel2org5
4551ebb
%{_libdir}/fcitx5/*.so
e9d38b4
%{_libdir}/fcitx5/qt%{qt_major_ver}/libpinyindictmanager.so
e9d38b4
%{_libdir}/fcitx5/qt%{qt_major_ver}/libcustomphraseeditor.so
4551ebb
4551ebb
%files data
4551ebb
%dir %{_datadir}/fcitx5/pinyin
4551ebb
%dir %{_datadir}/fcitx5/punctuation
4551ebb
%dir %{_datadir}/fcitx5/pinyinhelper
4551ebb
%{_datadir}/fcitx5/addon/*.conf
4551ebb
%{_datadir}/fcitx5/inputmethod/*.conf
4551ebb
%{_datadir}/fcitx5/lua/imeapi/extensions/pinyin.lua
4551ebb
%{_datadir}/fcitx5/pinyin/*.dict
0f4b7f3
%{_datadir}/fcitx5/pinyin/symbols
4551ebb
%{_datadir}/fcitx5/pinyinhelper/py_*.mb
4551ebb
%{_datadir}/fcitx5/punctuation/punc.mb.*
a4dfeca
%dir %{_datadir}/fcitx5/chttrans
a4dfeca
%{_datadir}/fcitx5/chttrans/gbks2t.tab
4551ebb
%{_datadir}/icons/hicolor/*/apps/*
d6892df
%{_metainfodir}/org.fcitx.Fcitx5.Addon.ChineseAddons.metainfo.xml
4551ebb
4551ebb
%files devel
4551ebb
%{_includedir}/Fcitx5/Module/fcitx-module/*
4551ebb
%{_libdir}/cmake/Fcitx5Module*
4551ebb
4551ebb
%changelog
ee5950e
%autochangelog