1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
|
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%{!?gtk2_binary_version: %define gtk2_binary_version %(pkg-config --variable=gtk_binary_version gtk+-2.0)}
%{!?gtk3_binary_version: %define gtk3_binary_version %(pkg-config --variable=gtk_binary_version gtk+-3.0)}
# Build flags
%define build_python_library 0
%define glib_ver %([ -a %{_libdir}/pkgconfig/glib-2.0.pc ] && pkg-config --modversion glib-2.0 | cut -d. -f 1,2 || echo -n "999")
%define gconf2_version 2.12.0
%define dbus_python_version 0.83.0
%define im_chooser_version 1.2.5
Name: ibus
Version: @IBUS_VERSION@
Release: 1%{?dist}
Summary: Intelligent Input Bus for Linux OS
License: LGPLv2+
Group: System Environment/Libraries
URL: http://code.google.com/p/ibus/
Source0: http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz
Source1: xinput-ibus
# Patch0: ibus-HEAD.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: cvs
BuildRequires: gettext-devel
BuildRequires: libtool
BuildRequires: python
BuildRequires: gtk2-devel
BuildRequires: gtk3-devel
BuildRequires: dbus-glib-devel
BuildRequires: dbus-python-devel >= %{dbus_python_version}
BuildRequires: desktop-file-utils
BuildRequires: gtk-doc
BuildRequires: GConf2-devel
BuildRequires: dconf-devel
BuildRequires: pygobject2-devel
BuildRequires: intltool
BuildRequires: iso-codes-devel
Requires: %{name}-libs = %{version}-%{release}
Requires: %{name}-gtk2 = %{version}-%{release}
Requires: %{name}-gtk3 = %{version}-%{release}
Requires: %{name}-conf = %{version}-%{release}
Requires: pygtk2
Requires: iso-codes
Requires: dbus-python >= %{dbus_python_version}
Requires: im-chooser >= %{im_chooser_version}
Requires: notify-python
Requires: librsvg2
Requires(post): desktop-file-utils
Requires(postun): desktop-file-utils
Requires(post): %{_sbindir}/alternatives
Requires(postun): %{_sbindir}/alternatives
Obsoletes: ibus-qt < 1.1.0
%define _xinputconf %{_sysconfdir}/X11/xinit/xinput.d/ibus.conf
%description
IBus means Intelligent Input Bus. It is an input framework for Linux OS.
%package libs
Summary: IBus libraries
Group: System Environment/Libraries
Requires: glib2 >= %{glib_ver}
Requires: dbus >= 1.2.4
%description libs
This package contains the libraries for IBus
%package gconf
Summary: IBus configuration module using GConf
Group: System Environment/Libraries
Provides: %{name}-conf = %{version}-%{release}
Requires: %{name} = %{version}-%{release}
Requires: GConf2 >= %{gconf2_version}
Requires(pre): GConf2 >= %{gconf2_version}
Requires(post): GConf2 >= %{gconf2_version}
Requires(preun): GConf2 >= %{gconf2_version}
%description gconf
This package contains ibus configuration module using GConf
%package dconf
Summary: IBus configuration module using DConf
Group: System Environment/Libraries
Provides: %{name}-conf = %{version}-%{release}
Requires: %{name} = %{version}-%{release}
Requires(posttrans): dconf
%description dconf
This package contains ibus configuration module using DConf
%package gtk2
Summary: IBus im module for gtk2
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
Requires(post): glib2 >= %{glib_ver}
%description gtk2
This package contains ibus im module for gtk2
%package gtk3
Summary: IBus im module for gtk3
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
Requires(post): glib2 >= %{glib_ver}
%description gtk3
This package contains ibus im module for gtk3
%package devel
Summary: Development tools for ibus
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: glib2-devel
Requires: dbus-devel
%description devel
The ibus-devel package contains the header files and developer
docs for ibus.
%package devel-docs
Summary: Developer documents for ibus
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: gtk-doc
%description devel-docs
The ibus-devel-docs package contains developer documentation for ibus
%prep
%setup -q
# %patch0 -p1
%build
OPTIONS="--disable-static --enable-gtk2 --enable-gtk3 --enable-xim --disable-gtk-doc --enable-introspection --enable-gconf"
%if %{build_python_library}
OPTIONS="$OPTIONS --enable-python-library"
%else
OPTIONS="$OPTIONS --disable-python-library"
%endif
%configure $OPTIONS
# make -C po update-gmo
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
rm -f $RPM_BUILD_ROOT%{_libdir}/libibus-1.0.la
rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-2.0/%{gtk2_binary_version}/immodules/im-ibus.la
rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-3.0/%{gtk3_binary_version}/immodules/im-ibus.la
# install xinput config file
install -pm 644 -D %{SOURCE1} $RPM_BUILD_ROOT%{_xinputconf}
# install .desktop files
echo "NoDisplay=true" >> $RPM_BUILD_ROOT%{_datadir}/applications/ibus.desktop
echo "NoDisplay=true" >> $RPM_BUILD_ROOT%{_datadir}/applications/ibus-setup.desktop
desktop-file-install --delete-original \
--dir $RPM_BUILD_ROOT%{_datadir}/applications \
$RPM_BUILD_ROOT%{_datadir}/applications/*
%find_lang %{name}10
%clean
rm -rf $RPM_BUILD_ROOT
%post
# recreate icon cache
touch --no-create %{_datadir}/icons/hicolor || :
[ -x %{_bindir}/gtk-update-icon-cache ] && \
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
%{_sbindir}/alternatives --install %{_sysconfdir}/X11/xinit/xinputrc xinputrc %{_xinputconf} 83 || :
%post gconf
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/ibus.schemas >& /dev/null || :
%pre gconf
if [ "$1" -gt 1 ]; then
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-uninstall-rule %{_sysconfdir}/gconf/schemas/ibus.schemas >& /dev/null || :
fi
%preun gconf
if [ "$1" -eq 0 ]; then
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-uninstall-rule %{_sysconfdir}/gconf/schemas/ibus.schemas >& /dev/null || :
fi
%postun
# recreate icon cache
touch --no-create %{_datadir}/icons/hicolor || :
[ -x %{_bindir}/gtk-update-icon-cache ] && \
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
if [ "$1" = "0" ]; then
%{_sbindir}/alternatives --remove xinputrc %{_xinputconf} || :
# if alternative was set to manual, reset to auto
[ -L %{_sysconfdir}/alternatives/xinputrc -a "`readlink %{_sysconfdir}/alternatives/xinputrc`" = "%{_xinputconf}" ] && %{_sbindir}/alternatives --auto xinputrc || :
fi
%postun dconf
if [ "$1" -eq 0 ] ; then
/usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
rm -f %{_sysconfdir}/dconf/db/ibus
fi
%posttrans dconf
/usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
dconf update &> /dev/null || :
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%post gtk2
%{_bindir}/update-gtk-immodules %{_host}
%postun gtk2
%{_bindir}/update-gtk-immodules %{_host}
%post gtk3
%{_bindir}/gtk-query-immodules-3.0-%{__isa_bits} --update-cache
%postun gtk3
%{_bindir}/gtk-query-immodules-3.0-%{__isa_bits} --update-cache
%files -f %{name}10.lang
%defattr(-,root,root,-)
%doc AUTHORS COPYING README
%if %{build_python_library}
%dir %{python_sitelib}/ibus
%{python_sitelib}/ibus/*
%endif
%{python_sitearch}/gi/overrides/IBus.py*
%dir %{_datadir}/ibus/
%{_bindir}/ibus
%{_bindir}/ibus-daemon
%{_bindir}/ibus-setup
%{_datadir}/ibus/component/gtkpanel.xml
%{_datadir}/ibus/component/simple.xml
%{_datadir}/ibus/keymaps/*
%{_datadir}/ibus/setup/*
%{_datadir}/applications/*
%{_datadir}/icons/hicolor/*/apps/*
%if %{build_python_library}
%{_libexecdir}/ibus-ui-gtk
%endif
%{_libexecdir}/ibus-ui-gtk3
%{_libexecdir}/ibus-x11
%{_libexecdir}/ibus-engine-simple
# %{_sysconfdir}/xdg/autostart/ibus.desktop
%{_datadir}/bash-completion/completions/ibus.bash
%config %{_xinputconf}
%files libs
%defattr(-,root,root,-)
%{_libdir}/libibus-1.0.so.*
%{_libdir}/girepository-1.0/IBus-1.0.typelib
%files gconf
%defattr(-,root,root,-)
%{_datadir}/ibus/component/gconf.xml
%{_libexecdir}/ibus-gconf
%{_sysconfdir}/gconf/schemas/ibus.schemas
%files dconf
%defattr(-,root,root,-)
%{_datadir}/ibus/component/dconf.xml
%{_libexecdir}/ibus-dconf
%{_sysconfdir}/dconf/db/ibus.d
%{_sysconfdir}/dconf/profile/ibus
%{_datadir}/GConf/gsettings/ibus.convert
%{_datadir}/glib-2.0/schemas/org.freedesktop.ibus.gschema.xml
%files gtk2
%defattr(-,root,root,-)
%{_libdir}/gtk-2.0/%{gtk2_binary_version}/immodules/im-ibus.so
%files gtk3
%defattr(-,root,root,-)
%{_libdir}/gtk-3.0/%{gtk3_binary_version}/immodules/im-ibus.so
%files devel
%defattr(-,root,root,-)
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*
%{_includedir}/*
%{_datadir}/gir-1.0/IBus-1.0.gir
%{_datadir}/vala/vapi/ibus-1.0.vapi
%{_datadir}/vala/vapi/ibus-1.0.deps
%files devel-docs
%defattr(-,root,root,-)
%{_datadir}/gtk-doc/html/*
%changelog
* @DATE_DISPLAY@ Peng Huang <shawn.p.huang@gmail.com> - @IBUS_VERSION@-1
- Current version.
|