diff --git a/libqt5-qtwebengine.changes b/libqt5-qtwebengine.changes index 51da3a6..2c383c7 100644 --- a/libqt5-qtwebengine.changes +++ b/libqt5-qtwebengine.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Sun Mar 25 15:58:52 UTC 2018 - kamikazow@opensuse.org + +- Enable spell checking: + * Ported script snippet from Fedora package by Kevin Kofler + * Converts available Hunspell dictionaries locally during installation +- Changed specfile header to reflect code coming from K. Kofler + ------------------------------------------------------------------- Fri Mar 23 08:14:18 UTC 2018 - wbauer@tmo.at diff --git a/libqt5-qtwebengine.spec b/libqt5-qtwebengine.spec index 287deea..ecf1647 100644 --- a/libqt5-qtwebengine.spec +++ b/libqt5-qtwebengine.spec @@ -1,20 +1,23 @@ # # spec file for package libqt5-qtwebengine # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright © 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright © 2017 Kevin Kofler +# Copyright © 2018 Markus S. # -# 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 http://bugs.opensuse.org/ +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 2.1 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see . # - %define qt5_snapshot 0 @@ -48,6 +51,8 @@ %bcond_without sle_bundles %bcond_with system_harfbuzz %endif +# spellchecking dictionary directory +%global _qtwebengine_dictionaries_dir %{_libqt5_datadir}/qtwebengine_dictionaries Name: libqt5-qtwebengine Version: 5.10.1 @@ -84,7 +89,6 @@ BuildRequires: flex BuildRequires: gperf # It really wants a commit hash, even if it's not in a .git checkout... BuildRequires: git-core -BuildRequires: hunspell-devel BuildRequires: krb5 BuildRequires: krb5-devel BuildRequires: libcap-devel @@ -131,9 +135,7 @@ BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(gmodule-2.0) BuildRequires: pkgconfig(gobject-2.0) BuildRequires: pkgconfig(gthread-2.0) -%if 0%{?suse_version} >= 1315 BuildRequires: pkgconfig(jsoncpp) -%endif BuildRequires: binutils-gold BuildRequires: pkgconfig(libcrypto) BuildRequires: pkgconfig(libdrm) @@ -318,25 +320,38 @@ rm -f %{buildroot}%{_libqt5_libdir}/lib*.la # webenginecore expects icudatl.dat at this location # ln -sf %{_datadir}/icu/*/icudt*l.dat %{buildroot}%{_datadir}/qt5/icudtl.dat -# ---------- Workarounds for older Qt versions --------- -## adjust cmake dep(s) to allow for using the same Qt5 that was used to build it +# Workaround to allow using QtWE with older Qt versions sed -i -r '/ EXACT\)/d' \ %{buildroot}%{_libqt5_libdir}/cmake/Qt5WebEngine*/Qt5WebEngine*Config.cmake sed -i '/find_package/!b;n;s/'%{version}/$(rpm -q --qf %%{version} libQt5Core5)/ \ %{buildroot}%{_libqt5_libdir}/cmake/Qt5WebEngine*/Qt5WebEngine*Config.cmake -# ------------------------------------------------------ + +# Hunspell dictionaries will be converted and put here on package installation +mkdir -p %{buildroot}%{_qtwebengine_dictionaries_dir} %post -p /sbin/ldconfig %postun -p /sbin/ldconfig +# Convert Hunspell dictionaries on package installation +%filetriggerin -- %{_datadir}/hunspell +while read filename ; do + case "$filename" in + *.dic) + bdicname=%{_qtwebengine_dictionaries_dir}/`basename -s .dic "$filename"`.bdic + %{_libqt5_bindir}/qwebengine_convert_dict "$filename" "$bdicname" &> /dev/null || : + ;; + esac +done + %files %defattr(-,root,root,755) %doc LICENSE.* %{_libqt5_libdir}/libQt*Web*.so.* %{_datadir}/qt5/ %dir %{_libqt5_libexecdir} +%dir %{_qtwebengine_dictionaries_dir} %{_libqt5_libexecdir}/QtWebEngineProcess %{_libqt5_archdatadir}/qml/QtWebEngine/ %{_libqt5_plugindir}/designer/