2008-08-24 22:35:16 +00:00
|
|
|
Name: ibus-table
|
2024-06-19 16:59:32 +00:00
|
|
|
Version: 1.17.5
|
|
|
|
Release: %autorelease
|
2008-08-24 22:35:16 +00:00
|
|
|
Summary: The Table engine for IBus platform
|
2022-11-25 22:26:14 +00:00
|
|
|
License: LGPL-2.1-or-later
|
2022-06-13 16:40:59 +00:00
|
|
|
URL: https://github.com/mike-fabian/ibus-table
|
2021-05-21 18:05:02 +00:00
|
|
|
Source0: https://github.com/mike-fabian/ibus-table/releases/download/%{version}/%{name}-%{version}.tar.gz
|
2010-06-21 05:54:10 +00:00
|
|
|
Requires: ibus > 1.3.0
|
2018-10-09 14:56:44 +00:00
|
|
|
%{?__python3:Requires: %{__python3}}
|
2021-07-14 09:20:32 +00:00
|
|
|
# To play a sound on error:
|
|
|
|
Recommends: python3-simpleaudio
|
2019-02-12 06:22:43 +00:00
|
|
|
BuildRequires: gcc
|
2010-06-21 05:54:10 +00:00
|
|
|
BuildRequires: ibus-devel > 1.3.0
|
2022-06-13 16:40:59 +00:00
|
|
|
BuildRequires: python3-devel >= 3.6.0
|
2019-02-12 06:22:43 +00:00
|
|
|
# for the unit tests
|
2021-02-17 08:45:47 +00:00
|
|
|
%if 0%{?fedora}
|
2020-07-15 12:17:26 +00:00
|
|
|
BuildRequires: appstream
|
2021-02-17 08:45:47 +00:00
|
|
|
%endif
|
2021-07-14 09:20:32 +00:00
|
|
|
BuildRequires: docbook-utils
|
2020-07-15 12:17:26 +00:00
|
|
|
BuildRequires: libappstream-glib
|
|
|
|
BuildRequires: desktop-file-utils
|
|
|
|
BuildRequires: python3-gobject
|
|
|
|
BuildRequires: python3-gobject-base
|
2019-02-12 06:22:43 +00:00
|
|
|
BuildRequires: dbus-x11
|
2018-08-29 07:49:43 +00:00
|
|
|
BuildRequires: ibus-table-chinese-wubi-jidian
|
|
|
|
BuildRequires: ibus-table-chinese-cangjie
|
|
|
|
BuildRequires: ibus-table-chinese-stroke5
|
|
|
|
BuildRequires: ibus-table-code
|
|
|
|
BuildRequires: ibus-table-latin
|
|
|
|
BuildRequires: ibus-table-translit
|
2020-01-22 15:25:35 +00:00
|
|
|
BuildRequires: ibus-table-tv
|
2020-12-19 00:39:50 +00:00
|
|
|
BuildRequires: make
|
2009-07-01 06:31:47 +00:00
|
|
|
|
2010-03-10 07:29:47 +00:00
|
|
|
Obsoletes: ibus-table-additional < 1.2.0.20100111-5
|
|
|
|
|
2008-08-24 22:35:16 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description
|
2010-01-11 01:03:42 +00:00
|
|
|
The Table engine for IBus platform.
|
2009-09-21 02:28:02 +00:00
|
|
|
|
2010-01-29 07:33:05 +00:00
|
|
|
%package -n %{name}-devel
|
|
|
|
Summary: Development files for %{name}
|
|
|
|
Requires: %{name} = %{version}-%{release}, pkgconfig
|
|
|
|
|
|
|
|
%description -n %{name}-devel
|
2010-09-01 07:35:19 +00:00
|
|
|
Development files for %{name}.
|
2010-01-29 07:33:05 +00:00
|
|
|
|
2020-07-15 12:17:26 +00:00
|
|
|
%package tests
|
|
|
|
Summary: Tests for the %{name} package
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
|
|
|
%description tests
|
|
|
|
The %{name}-tests package contains tests that can be used to verify
|
|
|
|
the functionality of the installed %{name} package.
|
|
|
|
|
2008-08-24 22:35:16 +00:00
|
|
|
%prep
|
2009-03-06 02:07:54 +00:00
|
|
|
%setup -q
|
2008-08-24 22:35:16 +00:00
|
|
|
|
|
|
|
%build
|
2014-03-06 13:41:27 +00:00
|
|
|
export PYTHON=%{__python3}
|
2020-07-15 12:17:26 +00:00
|
|
|
%configure --disable-static --disable-additional --enable-installed-tests
|
2021-05-05 10:00:22 +00:00
|
|
|
%make_build
|
2008-08-24 22:35:16 +00:00
|
|
|
|
|
|
|
%install
|
2009-08-04 04:34:29 +00:00
|
|
|
%__rm -rf $RPM_BUILD_ROOT
|
2014-03-06 13:41:27 +00:00
|
|
|
export PYTHON=%{__python3}
|
2021-05-05 10:00:22 +00:00
|
|
|
%make_install NO_INDEX=true pkgconfigdir=%{_datadir}/pkgconfig
|
2021-06-29 17:50:32 +00:00
|
|
|
%py_byte_compile %{python3} %{buildroot}/usr/share/ibus-table/engine
|
|
|
|
%py_byte_compile %{python3} %{buildroot}/usr/share/ibus-table/setup
|
2008-08-24 22:35:16 +00:00
|
|
|
|
|
|
|
%find_lang %{name}
|
|
|
|
|
2017-08-02 07:40:38 +00:00
|
|
|
%check
|
2021-02-17 08:45:47 +00:00
|
|
|
%if 0%{?fedora}
|
2020-07-15 12:17:26 +00:00
|
|
|
appstreamcli validate --pedantic --explain --no-net %{buildroot}/%{_datadir}/metainfo/*.appdata.xml
|
2021-02-17 08:45:47 +00:00
|
|
|
%endif
|
2017-08-02 07:40:38 +00:00
|
|
|
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/*.appdata.xml
|
2018-08-29 07:49:43 +00:00
|
|
|
desktop-file-validate \
|
|
|
|
$RPM_BUILD_ROOT%{_datadir}/applications/ibus-setup-table.desktop
|
|
|
|
pushd engine
|
|
|
|
# run doctests
|
|
|
|
python3 table.py
|
2024-06-19 16:59:32 +00:00
|
|
|
# Function to compare two version strings
|
|
|
|
version_ge() {
|
|
|
|
[ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" = "$2" ]
|
|
|
|
}
|
|
|
|
# Get the installed version of ibus-devel
|
|
|
|
installed_version=$(rpm -q --qf '%%{VERSION}-%%{RELEASE}' ibus-devel)
|
|
|
|
# Define the minimum required version for the test
|
|
|
|
required_version="1.5.31-1"
|
|
|
|
# Compare versions
|
|
|
|
if version_ge "$installed_version" "$required_version"; then
|
|
|
|
echo "Running test: ibus-devel version is greater than or equal to $required_version"
|
|
|
|
python3 it_util.py
|
|
|
|
else
|
|
|
|
echo "Skipping python3 it_util.py: ibus-devel version is less than $required_version"
|
|
|
|
fi
|
2018-08-29 07:49:43 +00:00
|
|
|
popd
|
|
|
|
mkdir -p /tmp/glib-2.0/schemas/
|
|
|
|
cp org.freedesktop.ibus.engine.table.gschema.xml \
|
|
|
|
/tmp/glib-2.0/schemas/org.freedesktop.ibus.engine.table.gschema.xml
|
|
|
|
glib-compile-schemas /tmp/glib-2.0/schemas #&>/dev/null || :
|
|
|
|
export XDG_DATA_DIRS=/tmp
|
|
|
|
eval $(dbus-launch --sh-syntax)
|
|
|
|
dconf dump /
|
|
|
|
dconf write /org/freedesktop/ibus/engine/table/wubi-jidian/chinesemode 1
|
|
|
|
dconf write /org/freedesktop/ibus/engine/table/wubi-jidian/spacekeybehavior false
|
|
|
|
dconf dump /
|
2020-07-15 12:17:26 +00:00
|
|
|
|
|
|
|
make check && rc=0 || rc=1
|
|
|
|
cat tests/*.log
|
|
|
|
if [ $rc != 0 ] ; then
|
|
|
|
exit $rc
|
|
|
|
fi
|
2018-08-29 07:49:43 +00:00
|
|
|
|
2008-08-24 22:35:16 +00:00
|
|
|
%files -f %{name}.lang
|
|
|
|
%doc AUTHORS COPYING README
|
2014-03-06 13:41:27 +00:00
|
|
|
%{_datadir}/%{name}
|
2017-08-02 07:40:38 +00:00
|
|
|
%{_datadir}/metainfo/*.appdata.xml
|
2009-03-03 23:03:11 +00:00
|
|
|
%{_datadir}/ibus/component/table.xml
|
2022-08-02 17:59:14 +00:00
|
|
|
%{_datadir}/icons/hicolor/16x16/apps/ibus-table.png
|
|
|
|
%{_datadir}/icons/hicolor/22x22/apps/ibus-table.png
|
|
|
|
%{_datadir}/icons/hicolor/32x32/apps/ibus-table.png
|
|
|
|
%{_datadir}/icons/hicolor/48x48/apps/ibus-table.png
|
|
|
|
%{_datadir}/icons/hicolor/64x64/apps/ibus-table.png
|
|
|
|
%{_datadir}/icons/hicolor/128x128/apps/ibus-table.png
|
|
|
|
%{_datadir}/icons/hicolor/256x256/apps/ibus-table.png
|
|
|
|
%{_datadir}/icons/hicolor/scalable/apps/ibus-table.svg
|
2014-03-11 14:32:58 +00:00
|
|
|
%{_datadir}/applications/ibus-setup-table.desktop
|
2018-08-29 07:49:43 +00:00
|
|
|
%{_datadir}/glib-2.0/schemas/org.freedesktop.ibus.engine.table.gschema.xml
|
2009-08-03 07:14:29 +00:00
|
|
|
%{_bindir}/%{name}-createdb
|
|
|
|
%{_libexecdir}/ibus-engine-table
|
2014-02-03 10:49:12 +00:00
|
|
|
%{_libexecdir}/ibus-setup-table
|
2013-04-19 10:03:33 +00:00
|
|
|
%{_mandir}/man1/*
|
2008-08-29 09:10:13 +00:00
|
|
|
|
2010-01-29 07:33:05 +00:00
|
|
|
%files devel
|
|
|
|
%{_datadir}/pkgconfig/%{name}.pc
|
|
|
|
|
2020-07-15 12:17:26 +00:00
|
|
|
%files tests
|
|
|
|
%dir %{_libexecdir}/installed-tests
|
|
|
|
%{_libexecdir}/installed-tests/%{name}
|
|
|
|
%dir %{_datadir}/installed-tests
|
|
|
|
%{_datadir}/installed-tests/%{name}
|
|
|
|
|
2008-08-24 22:35:16 +00:00
|
|
|
%changelog
|
2024-06-19 16:59:32 +00:00
|
|
|
%autochangelog
|