ibus-table/ibus-table.spec

147 lines
4.6 KiB
RPMSpec
Raw Normal View History

2008-08-24 22:35:16 +00:00
Name: ibus-table
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
URL: https://github.com/mike-fabian/ibus-table
Source0: https://github.com/mike-fabian/ibus-table/releases/download/%{version}/%{name}-%{version}.tar.gz
Requires: ibus > 1.3.0
%{?__python3:Requires: %{__python3}}
# To play a sound on error:
Recommends: python3-simpleaudio
BuildRequires: gcc
BuildRequires: ibus-devel > 1.3.0
BuildRequires: python3-devel >= 3.6.0
# for the unit tests
%if 0%{?fedora}
BuildRequires: appstream
%endif
BuildRequires: docbook-utils
BuildRequires: libappstream-glib
BuildRequires: desktop-file-utils
BuildRequires: python3-gobject
BuildRequires: python3-gobject-base
BuildRequires: dbus-x11
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
BuildRequires: ibus-table-tv
BuildRequires: make
Obsoletes: ibus-table-additional < 1.2.0.20100111-5
2008-08-24 22:35:16 +00:00
BuildArch: noarch
%description
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
Development files for %{name}.
2010-01-29 07:33:05 +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
%setup -q
2008-08-24 22:35:16 +00:00
%build
export PYTHON=%{__python3}
%configure --disable-static --disable-additional --enable-installed-tests
%make_build
2008-08-24 22:35:16 +00:00
%install
2009-08-04 04:34:29 +00:00
%__rm -rf $RPM_BUILD_ROOT
export PYTHON=%{__python3}
%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}
%check
%if 0%{?fedora}
appstreamcli validate --pedantic --explain --no-net %{buildroot}/%{_datadir}/metainfo/*.appdata.xml
%endif
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/*.appdata.xml
desktop-file-validate \
$RPM_BUILD_ROOT%{_datadir}/applications/ibus-setup-table.desktop
pushd engine
# run doctests
python3 table.py
# 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
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 /
make check && rc=0 || rc=1
cat tests/*.log
if [ $rc != 0 ] ; then
exit $rc
fi
2008-08-24 22:35:16 +00:00
%files -f %{name}.lang
%doc AUTHORS COPYING README
%{_datadir}/%{name}
%{_datadir}/metainfo/*.appdata.xml
%{_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
%{_datadir}/applications/ibus-setup-table.desktop
%{_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
%{_libexecdir}/ibus-setup-table
%{_mandir}/man1/*
2008-08-29 09:10:13 +00:00
2010-01-29 07:33:05 +00:00
%files devel
%{_datadir}/pkgconfig/%{name}.pc
%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
%autochangelog