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
|
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?gtk_binary_version: %define gtk_binary_version %(pkg-config --variable=gtk_binary_version gtk+-2.0)}
%define mod_path ibus-@PACKAGE_VERSION_MAJOR@.@PACKAGE_VERSION_MINOR@
%define host_vendor %(if [[ "%{_host_vendor}" == "unknown" ]]; then echo redhat; else echo %{_host_vendor}; fi)
%define host %{_host_cpu}-%{host_vendor}-%{_host_os}
Name: ibus
Version: @PACKAGE_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
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%define glib_ver %([ -a %{_libdir}/pkgconfig/glib-2.0.pc ] && pkg-config --modversion glib-2.0 | cut -d. -f 1,2 || echo -n "999")
BuildRequires: gettext-devel
BuildRequires: libtool
BuildRequires: python
BuildRequires: gtk2-devel
BuildRequires: dbus-devel
# BuildRequires: qt-devel
BuildRequires: dbus-glib-devel
BuildRequires: desktop-file-utils
Requires(post): desktop-file-utils
Requires(post): %{_sbindir}/alternatives
Requires(postun): desktop-file-utils
Requires(postun): %{_sbindir}/alternatives
Requires: %{name}-libs = %{version}-%{release}
Requires: glib2 >= %{glib_ver}
Requires: pygtk2
Requires: dbus-python >= 0.83.0
Requires: notification-daemon
Requires: pyxdg
Requires: iso-codes
%define _xinputconf %{_sysconfdir}/X11/xinit/xinput.d/ibus.conf
%description
IBus means Intelligent Input Bus. It is a new input framework for Linux OS. It provides
full featured and user friendly input method user interface. It also may help
developers to develop input method easily.
%package libs
Summary: IBus libraries
Group: System Environment/Libraries
%description libs
This package contains ibus libraries.
%package gtk
Summary: IBus im module for gtk2
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
%description gtk
This package contains ibus im module for gtk2
# %package qt
# Summary: IBus im module for qt4
# Group: System Environment/Libraries
# Requires: %{name} = %{version}-%{release}
# Requires: qt >= 4.4.2
#
# %description qt
# This package contains ibus im module for qt4
%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.
%prep
%setup -q
%build
%configure --disable-static --disable-iso-codes-check
# 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.la
rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-2.0/%{gtk_binary_version}/immodules/im-ibus.la
# install xinput config file
mkdir -pm 755 ${RPM_BUILD_ROOT}/%{_sysconfdir}/X11/xinit/xinput.d
install -pm 644 %{SOURCE1} ${RPM_BUILD_ROOT}/%{_xinputconf}
# install .desktop files
desktop-file-install --delete-original \
--dir $RPM_BUILD_ROOT%{_datadir}/applications \
$RPM_BUILD_ROOT%{_datadir}/applications/*
%find_lang %{name}
%clean
rm -rf $RPM_BUILD_ROOT
%pre
if [ "$1" -gt 1 ] ; then
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-uninstall-rule \
%{_sysconfdir}/gconf/schemas/%{name}.schemas >/dev/null || :
fi
%post
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-install-rule \
%{_sysconfdir}/gconf/schemas/%{name}.schemas > /dev/null || :
%preun
if [ "$1" -eq 0 ] ; then
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-uninstall-rule \
%{_sysconfdir}/gconf/schemas/%{name}.schemas > /dev/null || :
fi
%post libs
/sbin/ldconfig
update-desktop-database -q
%{_sbindir}/alternatives --install %{_sysconfdir}/X11/xinit/xinputrc xinputrc %{_xinputconf} 83 || :
%post gtk
%{_bindir}/update-gtk-immodules %{host} || :
%postun libs
/sbin/ldconfig
update-desktop-database -q
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 gtk
%{_bindir}/update-gtk-immodules %{host} || :
%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS COPYING README
%{python_sitelib}/ibus
%{_bindir}/ibus-daemon
%{_bindir}/ibus-setup
%{_datadir}/ibus
%{_datadir}/applications/*
%{_datadir}/pixmaps/*
%{_libexecdir}/ibus-gconf
%{_libexecdir}/ibus-ui-gtk
%{_libexecdir}/ibus-x11
%config(noreplace) %{_xinputconf}
%config(noreplace) %{_sysconfdir}/gconf/schemas/%{name}.schemas
%config(noreplace) %{_sysconfdir}/xdg/autostart/ibus.desktop
%files libs
%defattr(-,root,root,-)
%{_libdir}/libibus.so*
%files gtk
%defattr(-,root,root,-)
%{_libdir}/gtk-2.0/%{gtk_binary_version}/immodules/im-ibus.so
# %files qt
# %defattr(-,root,root,-)
# %{_libdir}/qt4/plugins/inputmethods/libibus.so
%files devel
%defattr(-,root,root,-)
%{_libdir}/lib*.so
%{_includedir}/*
%{_datadir}/gtk-doc/html/*
%{_libdir}/pkgconfig/*
%changelog
* @DATE_DISPLAY@ Huang Peng <shawn.p.huang@gmail.com> - @VERSION@-1
- Current version.
* Thu Aug 07 2008 Huang Peng <shawn.p.huang@gmail.com> - 0.1.0.20080810-1
- The first version.
|