1 %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
2 %{!?gtk_binary_version: %define gtk_binary_version %(pkg-config --variable=gtk_binary_version gtk+-2.0)}
4 %define glib_ver %([ -a %{_libdir}/pkgconfig/glib-2.0.pc ] && pkg-config --modversion glib-2.0 | cut -d. -f 1,2 || echo -n "999")
5 %define gconf2_version 2.12.0
6 %define dbus_python_version 0.83.0
7 %define im_chooser_version 1.2.5
10 Version: @PACKAGE_VERSION@
12 Summary: Intelligent Input Bus for Linux OS
14 Group: System Environment/Libraries
15 URL: http://code.google.com/p/ibus/
16 Source0: http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz
18 # Patch0: ibus-HEAD.patch
20 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
24 BuildRequires: gettext-devel
25 BuildRequires: libtool
27 BuildRequires: gtk2-devel
28 BuildRequires: dbus-glib-devel
29 BuildRequires: dbus-python-devel >= %{dbus_python_version}
30 BuildRequires: desktop-file-utils
31 BuildRequires: gtk-doc
32 BuildRequires: GConf2-devel
33 BuildRequires: pygobject2-devel
34 BuildRequires: intltool
36 Requires: %{name}-libs = %{version}-%{release}
37 Requires: %{name}-gtk = %{version}-%{release}
42 Requires: dbus-python >= %{dbus_python_version}
43 Requires: im-chooser >= %{im_chooser_version}
44 Requires: GConf2 >= %{gconf2_version}
45 Requires: notify-python
47 Requires(post): desktop-file-utils
48 Requires(postun): desktop-file-utils
50 Requires(pre): GConf2 >= %{gconf2_version}
51 Requires(post): GConf2 >= %{gconf2_version}
52 Requires(preun): GConf2 >= %{gconf2_version}
54 Requires(post): %{_sbindir}/alternatives
55 Requires(postun): %{_sbindir}/alternatives
57 Obsoletes: ibus-qt < 1.1.0
59 %define _xinputconf %{_sysconfdir}/X11/xinit/xinput.d/ibus.conf
62 IBus means Intelligent Input Bus. It is an input framework for Linux OS.
65 Summary: IBus libraries
66 Group: System Environment/Libraries
68 Requires: glib2 >= %{glib_ver}
69 Requires: dbus >= 1.2.4
72 This package contains the libraries for IBus
75 Summary: IBus im module for gtk2
76 Group: System Environment/Libraries
77 Requires: %{name} = %{version}-%{release}
78 Requires(post): glib2 >= %{glib_ver}
81 This package contains ibus im module for gtk2
84 Summary: Development tools for ibus
85 Group: Development/Libraries
86 Requires: %{name} = %{version}-%{release}
91 The ibus-devel package contains the header files and developer
95 Summary: Developer documents for ibus
96 Group: Development/Libraries
97 Requires: %{name} = %{version}-%{release}
100 %description devel-docs
101 The ibus-devel-docs package contains developer documentation for ibus
109 %configure --disable-static \
110 --disable-iso-codes-check \
112 # make -C po update-gmo
116 rm -rf $RPM_BUILD_ROOT
117 make DESTDIR=$RPM_BUILD_ROOT install
118 rm -f $RPM_BUILD_ROOT%{_libdir}/libibus.la
119 rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-2.0/%{gtk_binary_version}/immodules/im-ibus.la
121 # install xinput config file
122 install -pm 644 -D %{SOURCE1} $RPM_BUILD_ROOT%{_xinputconf}
124 # install .desktop files
125 echo "NoDisplay=true" >> $RPM_BUILD_ROOT%{_datadir}/applications/ibus.desktop
126 echo "NoDisplay=true" >> $RPM_BUILD_ROOT%{_datadir}/applications/ibus-setup.desktop
127 echo "X-GNOME-Autostart-enabled=false" >> $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart/ibus.desktop
128 rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart/ibus.desktop
129 desktop-file-install --delete-original \
130 --dir $RPM_BUILD_ROOT%{_datadir}/applications \
131 $RPM_BUILD_ROOT%{_datadir}/applications/*
136 rm -rf $RPM_BUILD_ROOT
139 # recreate icon cache
140 touch --no-create %{_datadir}/icons/hicolor || :
141 [ -x %{_bindir}/gtk-update-icon-cache ] && \
142 %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
144 %{_sbindir}/alternatives --install %{_sysconfdir}/X11/xinit/xinputrc xinputrc %{_xinputconf} 83 || :
146 export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
147 gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/ibus.schemas >& /dev/null || :
150 if [ "$1" -gt 1 ]; then
151 export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
152 gconftool-2 --makefile-uninstall-rule %{_sysconfdir}/gconf/schemas/ibus.schemas >& /dev/null || :
156 if [ "$1" -eq 0 ]; then
157 export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
158 gconftool-2 --makefile-uninstall-rule %{_sysconfdir}/gconf/schemas/ibus.schemas >& /dev/null || :
162 # recreate icon cache
163 touch --no-create %{_datadir}/icons/hicolor || :
164 [ -x %{_bindir}/gtk-update-icon-cache ] && \
165 %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
167 if [ "$1" = "0" ]; then
168 %{_sbindir}/alternatives --remove xinputrc %{_xinputconf} || :
169 # if alternative was set to manual, reset to auto
170 [ -L %{_sysconfdir}/alternatives/xinputrc -a "`readlink %{_sysconfdir}/alternatives/xinputrc`" = "%{_xinputconf}" ] && %{_sbindir}/alternatives --auto xinputrc || :
173 %post libs -p /sbin/ldconfig
175 %postun libs -p /sbin/ldconfig
178 %{_bindir}/update-gtk-immodules %{_host} || :
181 %{_bindir}/update-gtk-immodules %{_host} || :
183 %files -f %{name}.lang
184 %defattr(-,root,root,-)
185 %doc AUTHORS COPYING README
186 %dir %{python_sitelib}/ibus
187 %{python_sitelib}/ibus/*
188 %dir %{_datadir}/ibus/
189 %{_bindir}/ibus-daemon
190 %{_bindir}/ibus-setup
192 %{_datadir}/applications/*
193 %{_datadir}/icons/hicolor/*/apps/*
194 %{_libexecdir}/ibus-gconf
195 %{_libexecdir}/ibus-ui-gtk
196 %{_libexecdir}/ibus-x11
197 # %{_sysconfdir}/xdg/autostart/ibus.desktop
198 %{_sysconfdir}/gconf/schemas/ibus.schemas
199 %config %{_xinputconf}
202 %defattr(-,root,root,-)
203 %{_libdir}/libibus.so.*
206 %defattr(-,root,root,-)
207 %{_libdir}/gtk-2.0/%{gtk_binary_version}/immodules/im-ibus.so
210 %defattr(-,root,root,-)
213 %{_libdir}/pkgconfig/*
216 %defattr(-,root,root,-)
217 %{_datadir}/gtk-doc/html/*
220 * @DATE_DISPLAY@ Peng Huang <shawn.p.huang@gmail.com> - @VERSION@-1