Updated to 1.5.8, fix daemon launching (merge changes from zombie/ibus)

This commit is contained in:
Denis Silakov 2014-10-22 08:26:26 +04:00
parent 70e400a7aa
commit cc1265579e
3 changed files with 52 additions and 38 deletions

View file

@ -1,2 +1,4 @@
sources: removed_sources:
ibus-1.5.7.tar.gz: 09720755dcf3ee38282a7a0da335a812d6874b08 ibus-1.5.7.tar.gz: 09720755dcf3ee38282a7a0da335a812d6874b08
sources:
ibus-1.5.8.tar.gz: 97d2ca6a4e095ae5db4a538ca73280ea49357940

View file

@ -1,34 +1,30 @@
#============================================================ #============================================================
# usage: %post_ibus_register_engine pinyin zh # usage: %post_ibus_register_engine pinyin zh
#============================================================ #============================================================
%post_ibus_register_engine() \ %post_ibus_register_engine() %{nil}
key="/desktop/ibus/general/preload_engines" \
if [ "$1" = "1" -a `locale -a|grep %{2} |wc -l` -gt 0 ]; then \ #if [ "$1" = "1" -a `locale -a|grep %{2} |wc -l` -gt 0 ]; then \
current_value=$(%{_gconftool_bin} --get ${key} 2>/dev/null); \ # current_value=$(%{_bindir}/gsettings get org.freedesktop.ibus.general preload-engines 2>/dev/null); \
current_value=${current_value/[/}; \ # current_value=${current_value/[/}; \
current_value=${current_value/]/}; \ # current_value=${current_value/]/}; \
if [ -n "${current_value}" ]; then \ # if [ -n "${current_value}" ]; then \
new_value="${current_value},"; \ # new_value="${current_value},"; \
fi \ # fi \
new_value="${new_value}%{1}"; \ # new_value="${new_value}%{1}"; \
new_value="[${new_value}]"; \ # new_value="[${new_value}]"; \
%{_gconftool_bin} --direct --config-source xml:readwrite:%{_sysconfdir}/gconf/gconf.xml.defaults --set $key --type list --list-type=string "${new_value}"; \ # %{_bindir}/gsettings set org.freedesktop.ibus.general preload-engines "${new_value}"; \
fi #fi
#============================================================ #============================================================
# usage: %preun_ibus_unregister_engine pinyin # usage: %preun_ibus_unregister_engine pinyin
#============================================================ #============================================================
%preun_ibus_unregister_engine() \ %preun_ibus_unregister_engine() %{nil}
key="/desktop/ibus/general/preload_engines" \
if [ "$1" = "0" ]; then \ #if [ "$1" = "0" ]; then \
current_value=$(%{_gconftool_bin} --get ${key} 2>/dev/null); \ # current_value=$(%{_bindir}/gsettings get org.freedesktop.ibus.general preload-engines 2>/dev/null); \
current_value=${current_value/[/}; \ # current_value=${current_value/[/}; \
current_value=${current_value/]/}; \ # current_value=${current_value/]/}; \
new_value=$(echo $current_value | tr ',' '\\n' | grep -v ^%{1}$ |tr '\\n' ',' | sed 's/,$//'); \ # new_value=$(echo $current_value | tr ',' '\\n' | grep -v ^%{1}$ |tr '\\n' ',' | sed 's/,$//'); \
if [ -z ${new_value} ]; then \ # new_value="[${new_value}]"; \
%{_gconftool_bin} --direct --config-source xml:readwrite:%{_sysconfdir}/gconf/gconf.xml.defaults --unset $key; \ # %{_bindir}/gsettings set org.freedesktop.ibus.general preload-engines "${new_value}"; \
else \ #fi
new_value="[${new_value}]"; \
%{_gconftool_bin} --direct --config-source xml:readwrite:%{_sysconfdir}/gconf/gconf.xml.defaults --set $key --type list --list-type=string "${new_value}"; \
fi \
fi

View file

@ -6,8 +6,8 @@
Summary: A next generation input framework Summary: A next generation input framework
Name: ibus Name: ibus
Version: 1.5.7 Version: 1.5.8
Release: 2 Release: 1
License: GPLv2+ License: GPLv2+
Group: System/Internationalization Group: System/Internationalization
Url: http://code.google.com/p/ibus/ Url: http://code.google.com/p/ibus/
@ -65,7 +65,7 @@ IBus is a next generation input framework.
%{_mandir}/man1/ibus-daemon.1.* %{_mandir}/man1/ibus-daemon.1.*
%{_mandir}/man1/ibus-setup.1.* %{_mandir}/man1/ibus-setup.1.*
%{_mandir}/man1/ibus.1.* %{_mandir}/man1/ibus.1.*
%{python_sitelib}/* %{py_puresitedir}/*
%preun %preun
%preun_uninstall_gconf_schemas ibus %preun_uninstall_gconf_schemas ibus
@ -155,21 +155,37 @@ IBus gtk module.
%build %build
%configure2_5x \ %configure2_5x \
--enable-vala=yes \
--enable-gtk3 \ --enable-gtk3 \
--disable-dbus-python-check \ --enable-gtk2 \
--enable-python-library \ --enable-dconf \
--enable-gconf \ --enable-gconf \
--enable-vala=yes --enable-python-library \
--enable-dbus-python-check \
--enable-surrounding-text \
%make %make
%install %install
%makeinstall_std %makeinstall_std
%find_lang %{name}10
# install rpm macro # install rpm macro
mkdir -p %{buildroot}%{_sysconfdir}/rpm/macros.d/ mkdir -p %{buildroot}%{_sysconfdir}/rpm/macros.d/
install -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/rpm/macros.d/%{name}.macros install -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/rpm/macros.d/%{name}.macros
rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/ibus.desktop rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/ibus.desktop
# install ui automatic selector wrapper
mv %{buildroot}%{_bindir}/%{name}-daemon %{buildroot}%{_bindir}/%{name}-daemon-real
cat >%{buildroot}%{_bindir}/%{name}-daemon <<EOF
#!/bin/bash
if [ "\$DESKTOP" = "KDE" -a -x %{_kde_libdir}/kde4/libexec/kimpanel-ibus-panel ]
then
exec %{_bindir}/ibus-daemon-real --panel=%{_kde_libdir}/kde4/libexec/kimpanel-ibus-panel "\$@".
else
exec %{_bindir}/ibus-daemon-real "\$@"
fi
EOF
chmod 0755 %{buildroot}%{_bindir}/%{name}-daemon
%find_lang %{name}10