File ibus.spec of Package ibus.12524

# spec file for package ibus
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# 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

%if 0%{?is_opensuse}
%define with_wayland 1
%define with_kde 1
%define with_emoji 1
%define with_wayland 0
%define with_kde 0
%define with_emoji 0
Name:           ibus
Version:        1.5.19
Release:        0
Summary:        The "Intelligent Input Bus" input method
License:        LGPL-2.1-or-later
Group:          System/I18n/Chinese
Source2:        README.SUSE
Source3:        xim.ibus.suse.template
Source4:        xim.d-ibus-121
Source7:        macros.ibus
Source10:       ibus-autostart
Source11:       ibus-autostart.desktop
Source99:       baselibs.conf
# PATCH-FIX-OPENSUSE ibus-python-install-dir.patch
Patch0:         ibus-python-install-dir.patch
# PATFH-FIX-OPENSUSE ibus-xim-fix-re-focus-after-lock.patch bnc#874869 -- Fix lost XIM input after screenlock
Patch4:         ibus-xim-fix-re-focus-after-lock.patch
# Select an IM engine at the first login
Patch8:         im-engines-precede-xkb.patch
Patch9:         ibus-fix-check-abs-icon-path-support.patch
# PATCH-FIX-SLE hide-setup-menu.patch bnc#899259
# ibus-setup should not launch from main menu.
Patch10:        hide-setup-menu.patch
# PATCH-FIX-SLE setup-switch-im.patch bnc#899259
# switch to ibus when ibus not running.
Patch11:        setup-switch-im.patch
# PATCH-FIX-SLE ibus-disable-engines-preload-in-GNOME.patch bnc#1036729
# Disable ibus engines preload in GNOME for These works are handled by gnome-shell.
Patch12:        ibus-disable-engines-preload-in-GNOME.patch
# PATCH-FIX-SLE ibus-CVE-2019-14822.patch CVE-2019-14822 bnc#1150011
# Fix the misconfiguration of the DBus server allows to unprivileged user could monitor and send method calls to the ibus bus of another user.
Patch13:        ibus-CVE-2019-14822.patch
BuildRequires:  dbus-1-glib-devel
BuildRequires:  dconf-devel >= 0.7.5
BuildRequires:  fdupes
BuildRequires:  gettext-devel
BuildRequires:  glib2-devel >= 2.34.0
BuildRequires:  gobject-introspection-devel >= 0.9.6
BuildRequires:  gtk-doc >= 1.9
BuildRequires:  gtk2-devel
BuildRequires:  intltool
BuildRequires:  iso-codes-devel
BuildRequires:  libnotify-devel >= 0.7
BuildRequires:  libtool
BuildRequires:  pkgconfig
BuildRequires:  python3-dbus-python-devel
BuildRequires:  python3-devel
BuildRequires:  python3-gobject-devel
BuildRequires:  unicode-ucd
BuildRequires:  update-desktop-files
# copy_deep method is supported since 0.31.1
BuildRequires:  vala >= 0.31.1
BuildRequires:  x11-tools
BuildRequires:  pkgconfig(json-glib-1.0)
BuildRequires:  pkgconfig(libnotify)
BuildRequires:  pkgconfig(vapigen)
BuildRequires:  pkgconfig(xkbcommon)
Requires:       dconf
Requires:       iso-codes
Requires:       libibus-1_0-5 = %{version}
Requires:       python3-dbus-python
Requires:       python3-gobject
Requires:       python3-gobject-Gdk
# ibus-setup will require typelib(Gdk) typelib(GdkX11), typelib(Gtk)
# which are provided by two packages in openSUSE, so we limit their
# versions to 3.0 only.
Requires:       typelib-1_0-Gtk-3_0
Recommends:     %{name}-lang
Supplements:    packageand(libreoffice:libreoffice-gnome)
Provides:       locale(ja;ko;zh)
Obsoletes:      ibus-gnome-shell
%if %{with_kde}
BuildRequires:  libqt5-qtbase-devel
%if %{with_wayland}
BuildRequires:  pkgconfig(wayland-client) >= 1.2.0
%if %{with_emoji}
BuildRequires:  nodejs-emojione
BuildRequires:  unicode-emoji
BuildRequires:  pkgconfig(cldr-emoji-annotation)
# Add conflict with fcitx to keep old IMF for people who update from SLE-12 SP0 to SP1.
%if !0%{?is_opensuse}
Conflicts:      fcitx

IBus, short for Intelligent Input Bus, is an input framework. IBus
plugins then provide the particular logic how to translate keypresses
to input characters and possibly show disambiguation windows around
the text cursor.

%package -n libibus-1_0-5
Summary:        IBus libraries
Group:          System/Libraries
Obsoletes:      libibus-1_0-0

%description -n libibus-1_0-5
This package contains the libraries for IBus

%package -n typelib-1_0-IBus-1_0
Summary:        Introspection bindings for IBus
Group:          System/Libraries

%description -n typelib-1_0-IBus-1_0
This package contains the introspection bindings for the IBus library.

%package gtk
Summary:        IBus input method support for gtk2 applications
Group:          System/I18n/Chinese
Requires:       %{name} = %{version}
Supplements:    packageand(ibus:gtk2)

%description gtk
This package contains ibus im module for use by gtk2.

%package gtk3
Summary:        IBus input method support for gtk3 applications
Group:          System/I18n/Chinese
BuildRequires:  gtk3-devel
Requires:       %{name} = %{version}
Supplements:    packageand(ibus:gtk3)

%description gtk3
This package contains ibus im module for use by gtk3.

%package devel
Summary:        Development tools for ibus
Group:          Development/Libraries/Other
Requires:       dbus-1-devel
Requires:       glib2-devel
Requires:       gtk-doc
Requires:       ibus = %{version}
Requires:       libibus-1_0-5 = %{version}
Requires:       typelib-1_0-IBus-1_0 = %{version}

%description devel
The ibus-devel package contains the header files and developer
docs for ibus.


%setup -q
%patch0 -p1
%patch4 -p1
%patch8 -p1
%patch9 -p1

cp -r %{SOURCE2} .
cp -r %{SOURCE3} .
cp -r %{SOURCE4} .
sed -i 1i"SYS_LIB=%{_lib}" xim.d-ibus-121
cp -r %{SOURCE10} .
cp -r %{SOURCE11} .

%if !0%{?is_opensuse}
%patch10 -p1
%patch11 -p1
%patch12 -p1

%patch13 -p1

autoreconf -fi
intltoolize -f
%configure --disable-static \
           --enable-gtk3 \
           --enable-vala \
%if %{with_emoji}
           --enable-emoji-dict \
           --disable-emoji-dict \
%if %{with_kde}
           --enable-appindicator \
           --disable-appindicator \
           --with-python=python3 \
           --disable-python2 \
           --enable-python-library \
           --enable-introspection \
           --disable-gconf \
           --enable-dconf \
           --enable-gtk-doc \
%if %{with_wayland}
           --enable-wayland \
           --enable-surrounding-text \
           --enable-appindicator_engine_icon \

make %{?_smp_mflags}


# autostart
mkdir -p %{buildroot}%{_sysconfdir}/X11/xim.d/
install -m 644 xim.d-ibus-121 %{buildroot}%{_sysconfdir}/X11/xim.d/ibus
mkdir -p %{buildroot}%{_bindir}
install -c -m 0755 ibus-autostart %{buildroot}%{_bindir}/ibus-autostart
mkdir -p %{buildroot}%{_sysconfdir}/xdg/autostart
install -c -m 0644 ibus-autostart.desktop %{buildroot}%{_sysconfdir}/xdg/autostart/ibus-autostart.desktop

pushd %{buildroot}%{_sysconfdir}/X11/xim.d/
    for lang in am ar as bn el fa gu he hi hr ja ka kk kn ko lo ml my \
                pa ru sk vi zh_TW zh_CN zh_HK zh_SG \
                de fr it es nl cs pl da nn nb fi en sv
        mkdir $lang
        pushd $lang
            ln -s ../ibus $PRIORITY-ibus

# remove static libs
find %{buildroot} -type f -name "*.la" -delete -print

mkdir -p %{buildroot}%{_datadir}/pixmaps
ln -sf %{_datadir}/icons/hicolor/48x48/apps/ibus-keyboard.png \

# touch for %%ghost
touch %{buildroot}/%{_sysconfdir}/dconf/db/ibus

# install macros
mkdir -p %{buildroot}%{_sysconfdir}/rpm
install -m 644 %{SOURCE7} %{buildroot}%{_sysconfdir}/rpm

%suse_update_desktop_file -r %{name}-setup Settings DesktopSettings X-SuSE-Core-System

%fdupes %{buildroot}

%find_lang ibus10 %{?no_lang_C}


dconf update

dconf update

%post gtk

%postun gtk

%post -n libibus-1_0-5 -p /sbin/ldconfig
%postun -n libibus-1_0-5 -p /sbin/ldconfig
%post gtk3

%postun gtk3

%doc AUTHORS README README.SUSE xim.ibus.suse.template
%license COPYING
%config %{_sysconfdir}/rpm/macros.ibus
%config %{_sysconfdir}/X11/xim.d/*
# This file is generated by dconf update
%ghost %{_sysconfdir}/dconf/db/ibus
%dir %{_sysconfdir}/dconf/db/ibus.d
# This file is not a config file. Users may not modify it.
%config %{_sysconfdir}/dconf/db/ibus.d/00-upstream-settings
%config %{_sysconfdir}/dconf/profile/ibus

%if %{with_emoji}

%files lang -f ibus10.lang

%files -n libibus-1_0-5

%files -n typelib-1_0-IBus-1_0

%files gtk

%files gtk3

%files devel

openSUSE Build Service is sponsored by