Merge branch 'tizen_3.0' into tizen
[platform/core/uifw/isf.git] / packaging / isf.spec
1 %global __provides_exclude_from ^(.*\\.(wearable|tv|mobile|ivi))$
2
3 %bcond_with wayland
4 Name:       isf
5 Summary:    Input Service Framework
6 Version:    3.0.171
7 Release:    1
8 Group:      Graphics & UI Framework/Input
9 License:    LGPL-2.1+
10 Source0:    %{name}-%{version}.tar.gz
11 BuildRequires:  edje-bin
12 BuildRequires:  gettext-tools
13 BuildRequires:  pkgconfig(appcore-efl)
14 BuildRequires:  pkgconfig(elementary)
15 BuildRequires:  pkgconfig(vconf)
16 %if %{with wayland}
17 BuildRequires:  pkgconfig(ecore-wayland)
18 BuildRequires:  pkgconfig(xkbcommon) >= 0.3.0
19 BuildRequires:  pkgconfig(text-client)
20 BuildRequires:  pkgconfig(input-method-client)
21 %else
22 BuildRequires:  pkgconfig(ecore-x)
23 BuildRequires:  pkgconfig(x11)
24 BuildRequires:  pkgconfig(tts)
25 %endif
26 BuildRequires:  pkgconfig(eina)
27 BuildRequires:  pkgconfig(ecore)
28 BuildRequires:  pkgconfig(evas)
29 BuildRequires:  pkgconfig(edje)
30 BuildRequires:  pkgconfig(dlog)
31 BuildRequires:  pkgconfig(edbus)
32 BuildRequires:  pkgconfig(glib-2.0)
33 BuildRequires:  pkgconfig(capi-network-bluetooth)
34 BuildRequires:  pkgconfig(feedback)
35 BuildRequires:  efl-extension-devel
36 BuildRequires:  pkgconfig(libtzplatform-config)
37 BuildRequires:  pkgconfig(pkgmgr-info)
38 BuildRequires:  pkgconfig(db-util)
39 BuildRequires:  pkgconfig(aul)
40 BuildRequires:  pkgconfig(capi-appfw-app-control)
41 BuildRequires:  pkgconfig(capi-appfw-application)
42 BuildRequires:  pkgconfig(cynara-client)
43 BuildRequires:  pkgconfig(cynara-creds-socket)
44 BuildRequires:  pkgconfig(cynara-session)
45 BuildRequires:  capi-appfw-package-manager-devel
46 Requires(postun): /sbin/ldconfig
47 Requires:       %{name}-compat = %{version}-%{release}
48 Recommends:     %{name}-profile_common = %{version}-%{release}
49 Requires:       org.tizen.isf-kbd-mode-changer
50
51 # Mobile/Common ONLY
52 BuildRequires:  pkgconfig(notification)
53 # TV ONLY
54 BuildRequires:  pkgconfig(libwebsockets)
55
56 %define APP_PREFIX %{TZ_SYS_RO_APP}/org.tizen.isf-kbd-mode-changer/bin/
57
58 %description
59 Input Service Framewok (ISF) is an input method (IM) platform, and it has been derived from SCIM.
60
61 # For product build optimization only. Not for Tizen 4.0 Unified.
62 # if wearble or ivi or unified
63 %if "%{?profile}" != "tv" && "%{?profile}" != "mobile" && "%{?profile}" != "common"
64 %package profile_wearable
65 Summary:        ISF bin for wearable/ivi
66 Provides:       %{name}-compat = %{version}-%{release}
67 Provides:       %{name}-profile_ivi = %{version}-%{release}
68 Conflicts:      %{name}-profile_common
69 Conflicts:      %{name}-profile_tv
70 %description profile_wearable
71 Compile isf with --disable-include-notification and --disable-include-libwebsocket
72 %endif
73
74 # For product build optimization only. Not for Tizen 4.0 Unified.
75 # if common or mobile or unified
76 %if "%{?profile}" != "tv" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
77 %package profile_common
78 Summary:        ISF bin for mobile/common
79 Provides:       %{name}-compat = %{version}-%{release}
80 Provides:       %{name}-profile_mobile = %{version}-%{release}
81 Conflicts:      %{name}-profile_wearable
82 Conflicts:      %{name}-profile_tv
83 %description profile_common
84 Compile isf with --disable-include-libwebsocket
85 %endif
86
87 # For product build optimization only. Not for Tizen 4.0 Unified.
88 # if tv or unified
89 %if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "ivi"
90 %package profile_tv
91 Summary:        ISF bin for TV
92 Provides:       %{name}-compat = %{version}-%{release}
93 Conflicts:      %{name}-profile_common
94 Conflicts:      %{name}-profile_wearable
95 %description profile_tv
96 Compile isf with --disable-include-notification
97 %endif
98
99 %package devel
100 Summary:    ISF header files
101 Requires:   %{name} = %{version}-%{release}
102
103 %description devel
104 This package contains ISF header files for ISE development.
105
106 %package -n org.tizen.isf-kbd-mode-changer
107 Summary: Keyboard mode changer
108 Group: Graphics & UI Framework/Input
109 Requires: %{name} = %{version}-%{release}
110
111 %description -n org.tizen.isf-kbd-mode-changer
112 Keyboard mode changer application
113
114 %prep
115 %setup -q
116
117 %build
118 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
119 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
120 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
121 %if %{with wayland}
122 export CFLAGS="$CFLAGS -DWAYLAND"
123 export CXXFLAGS="$CXXFLAGS -DWAYLAND"
124 %endif
125
126 %if "%{profile}" == "wearable"
127 CFLAGS+=" -D_WEARABLE";
128 CXXFLAGS+=" -D_WEARABLE";
129 %endif
130
131 %if "%{profile}" == "mobile" || "%{profile}" == "common"
132 CFLAGS+=" -D_MOBILE";
133 CXXFLAGS+=" -D_MOBILE";
134 %endif
135
136 %if "%{profile}" == "tv"
137 CFLAGS+=" -D_TV -DENABLE_REMOTE_INPUT=1";
138 CXXFLAGS+=" -D_TV -DENABLE_REMOTE_INPUT=1";
139 %endif
140
141 export GC_SECTIONS_FLAGS="-fdata-sections -ffunction-sections -Wl,--gc-sections"
142 export CFLAGS="$CFLAGS -fvisibility=hidden ${GC_SECTIONS_FLAGS} "
143 export CXXFLAGS="$CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden ${GC_SECTIONS_FLAGS} "
144 export CFLAGS_BASIS="$CFLAGS"
145 export CXXFLAGS_BASIS="$CXXFLAGS"
146
147 %autogen
148
149 # For product build optimization only. Not for Tizen 4.0 Unified.
150 # if tv or unified
151 %if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "ivi"
152 mkdir -p build_tv
153 export CFLAGS="$CFLAGS_BASIS -D_TV -DENABLE_REMOTE_INPUT=1";
154 export CXXFLAGS="$CFLAGS_BASIS -D_TV -DENABLE_REMOTE_INPUT=1";
155 %configure --disable-static \
156                 --disable-tray-icon \
157                 --disable-filter-sctc \
158                 --disable-include-notification \
159 %if %{with wayland}
160         --disable-efl-immodule \
161 %endif
162                 --disable-frontend-x11 \
163                 --disable-multiwindow-support \
164                 --disable-ime-embed-app \
165                 --with-ro-app-dir=%{TZ_SYS_RO_APP} \
166                 --with-ro-packages-dir=%{TZ_SYS_RO_PACKAGES}
167 make %{?_smp_mflags}
168 # Install essential profile-tv files into build_tv
169 %make_install
170 mkdir -p build_tv/bin
171 mkdir -p build_tv/lib
172 mv %{buildroot}%{_bindir}/* build_tv/bin/
173 mv %{buildroot}%{_libdir}/* build_tv/lib/
174 mv %{buildroot}%{_datadir}/scim/remote-input build_tv/
175 ls -la build_tv/bin/
176 ls -la build_tv/lib/
177 ls -la build_tv/
178 # if unified
179 %if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "ivi" && "%{?profile}" != "tv"
180 make clean
181 %endif
182
183 %endif
184
185 # For product build optimization only. Not for Tizen 4.0 Unified.
186 # if wearble or ivi or unified
187 %if "%{?profile}" != "tv" && "%{?profile}" != "mobile" && "%{?profile}" != "common"
188 mkdir -p build_wearable
189 export CFLAGS="$CFLAGS_BASIS -D_WEARABLE -DENABLE_HIDE_PANEL_KEY=1";
190 export CXXFLAGS="$CXXFLAGS_BASIS -D_WEARABLE -DENABLE_HIDE_PANEL_KEY=1";
191 %configure --disable-static \
192                 --disable-tray-icon \
193                 --disable-filter-sctc \
194                 --disable-include-libwebsocket \
195                 --disable-include-notification \
196 %if %{with wayland}
197         --disable-efl-immodule \
198 %endif
199                 --disable-frontend-x11 \
200                 --disable-multiwindow-support \
201                 --disable-ime-embed-app \
202                 --with-ro-app-dir=%{TZ_SYS_RO_APP} \
203                 --with-ro-packages-dir=%{TZ_SYS_RO_PACKAGES}
204 make %{?_smp_mflags}
205 # Install essential profile-wearable files into build_wearable
206 %make_install
207 mkdir -p build_wearable/bin
208 mkdir -p build_wearable/lib
209 mv %{buildroot}%{_bindir}/* build_wearable/bin/
210 mv %{buildroot}%{_libdir}/* build_wearable/lib/
211 ls -la build_wearable/bin/
212 ls -la build_wearable/lib/
213
214 # if unified
215 %if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "ivi" && "%{?profile}" != "tv"
216 make clean
217 %endif
218
219 %endif
220
221 # For product build optimization only. Not for Tizen 4.0 Unified.
222 # if common or mobile or unified
223 %if "%{?profile}" != "tv" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
224 # mobile/common
225 export CFLAGS="$CFLAGS_BASIS -D_MOBILE -DENABLE_HIDE_PANEL_KEY=1";
226 export CXXFLAGS="$CXXFLAGS_BASIS -D_MOBILE -DENABLE_HIDE_PANEL_KEY=1";
227 %configure --disable-static \
228                 --disable-tray-icon \
229                 --disable-filter-sctc \
230                 --disable-include-libwebsocket \
231 %if %{with wayland}
232         --disable-efl-immodule \
233 %endif
234                 --disable-frontend-x11 \
235                 --disable-multiwindow-support \
236                 --disable-ime-embed-app \
237                 --with-ro-app-dir=%{TZ_SYS_RO_APP} \
238                 --with-ro-packages-dir=%{TZ_SYS_RO_PACKAGES}
239 make %{?_smp_mflags}
240 %endif
241
242 %install
243 rm -rf %{buildroot}
244
245 %make_install
246 mkdir -p %{buildroot}/%{TZ_SYS_ETC}/dump.d/module.d
247 cp -af ism/dump/isf_log_dump.sh %{buildroot}/%{TZ_SYS_ETC}/dump.d/module.d
248 mkdir -p %{buildroot}/etc/scim/conf
249 mkdir -p %{buildroot}/usr/share/upgrade/scripts/
250 cp 500.isf_upgrade_24to30.sh %{buildroot}/usr/share/upgrade/scripts/
251
252
253 # For product build optimization only. Not for Tizen 4.0 Unified.
254 # if tv or unified
255 %if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "ivi"
256 mv build_tv/bin/isf-demo-efl %{buildroot}%{_bindir}/isf-demo-efl.tv
257 mv build_tv/bin/isf-panel-efl %{buildroot}%{_bindir}/isf-panel-efl.tv
258 mv build_tv/bin/isf-log %{buildroot}%{_bindir}/isf-log.tv
259 rm -rf %{buildroot}%{_datadir}/scim/remote-input
260 mkdir -p %{buildroot}%{_datadir}/scim
261 mv -f build_tv/remote-input %{buildroot}%{_datadir}/scim/
262 #mv build_tv/lib/libscim-*.so* %{buildroot}%{_libdir}/libscim-*.so*.tv
263 pushd build_tv/lib/
264 for FILE in libscim-*.so*; do mv "$FILE" "%{buildroot}%{_libdir}/$FILE.tv"; done
265 popd
266 mv build_tv/lib/scim-1.0/scim-launcher %{buildroot}%{_libdir}/scim-1.0/scim-launcher.tv
267 mv build_tv/lib/scim-1.0/scim-helper-launcher %{buildroot}%{_libdir}/scim-1.0/scim-helper-launcher.tv
268 %endif
269
270 # For product build optimization only. Not for Tizen 4.0 Unified.
271 # if wearble or ivi or unified
272 %if "%{?profile}" != "tv" && "%{?profile}" != "mobile" && "%{?profile}" != "common"
273 mv build_wearable/bin/isf-demo-efl %{buildroot}%{_bindir}/isf-demo-efl.wearable
274 mv build_wearable/bin/isf-panel-efl %{buildroot}%{_bindir}/isf-panel-efl.wearable
275 mv build_wearable/bin/isf-log %{buildroot}%{_bindir}/isf-log.wearable
276 #mv build_wearable/lib/libscim-*.so* %{buildroot}%{_libdir}/libscim-*.so*.wearable
277 pushd build_wearable/lib/
278 for FILE in libscim-*.so*; do mv "$FILE" "%{buildroot}%{_libdir}/$FILE.wearable"; done
279 popd
280 mv build_wearable/lib/scim-1.0/scim-launcher %{buildroot}%{_libdir}/scim-1.0/scim-launcher.wearable
281 mv build_wearable/lib/scim-1.0/scim-helper-launcher %{buildroot}%{_libdir}/scim-1.0/scim-helper-launcher.wearable
282 %endif
283
284 # For product build optimization only. Not for Tizen 4.0 Unified.
285 # If common/mobile is not required
286 %if "%{?profile}" == "tv" || "%{?profile}" == "wearable" || "%{?profile}" == "ivi"
287 rm %{buildroot}%{_bindir}/isf-demo-efl
288 rm %{buildroot}%{_bindir}/isf-panel-efl
289 rm %{buildroot}%{_bindir}/isf-log
290 rm %{buildroot}%{_libdir}/scim-1.0/scim-launcher
291 rm %{buildroot}%{_libdir}/scim-1.0/scim-helper-launcher
292 %endif
293
294 %find_lang scim
295
296 cat scim.lang > isf.lang
297 %post
298 ln -sf %{_libdir}/ecore_imf/modules/wayland/v-1.16/module.so %{_libdir}/ecore_imf/modules/wayland/v-1.16/libwltextinputmodule.so
299 /sbin/ldconfig
300
301
302 %postun -p /sbin/ldconfig
303
304 # For product build optimization only. Not for Tizen 4.0 Unified.
305 # if wearble or ivi or unified
306 %if "%{?profile}" != "tv" && "%{?profile}" != "mobile" && "%{?profile}" != "common"
307 %post profile_wearable
308 ln -sf isf-demo-efl.wearable %{_bindir}/isf-demo-efl
309 ln -sf isf-panel-efl.wearable %{_bindir}/isf-panel-efl
310 ln -sf isf-log.wearable %{_bindir}/isf-log
311 ln -sf scim-launcher.wearable %{_libdir}/scim-1.0/scim-launcher
312 ln -sf scim-helper-launcher.wearable %{_libdir}/scim-1.0/scim-helper-launcher
313 pushd %{_libdir}
314 for FILE in libscim-*.so*.wearable; do ln -sf "$FILE" "${FILE%.wearable}"; done
315 popd
316
317 %preun profile_wearable
318 # Do not execute if upgrade
319 if [ $1 -gt 0 ]; then
320 rm %{_bindir}/isf-demo-efl
321 rm %{_bindir}/isf-panel-efl
322 rm %{_bindir}/isf-log
323 rm %{_libdir}/scim-1.0/scim-launcher
324 rm %{_libdir}/scim-1.0/scim-helper-launcher
325 pushd %{_libdir}
326 for FILE in libscim-*.so*; do rm "$FILE"; done
327 popd
328 fi
329
330 %files profile_wearable
331 %manifest %{name}.manifest
332 # files in bindir and libdir may differ.
333 %{_bindir}/isf-demo-efl.wearable
334 %{_bindir}/isf-panel-efl.wearable
335 %{_bindir}/isf-log.wearable
336 %{_libdir}/scim-1.0/scim-launcher.wearable
337 %{_libdir}/scim-1.0/scim-helper-launcher.wearable
338 %{_libdir}/libscim-*.so*.wearable
339
340 %endif
341
342 # For product build optimization only. Not for Tizen 4.0 Unified.
343 # if tv or unified
344 %if "%{?profile}" != "common" && "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "ivi"
345 %post profile_tv
346 ln -sf isf-demo-efl.tv %{_bindir}/isf-demo-efl
347 ln -sf isf-panel-efl.tv %{_bindir}/isf-panel-efl
348 ln -sf isf-log.tv %{_bindir}/isf-log
349 ln -sf scim-launcher.tv %{_libdir}/scim-1.0/scim-launcher
350 ln -sf scim-helper-launcher.tv %{_libdir}/scim-1.0/scim-helper-launcher
351 pushd %{_libdir}
352 for FILE in libscim-*.so*.tv; do ln -sf "$FILE" "${FILE%.tv}"; done
353 popd
354 %preun profile_tv
355 # Do not execute if upgrade
356 if [ $1 -gt 0 ]; then
357 rm %{_bindir}/isf-demo-efl
358 rm %{_bindir}/isf-panel-efl
359 rm %{_bindir}/isf-log
360 rm %{_libdir}/scim-1.0/scim-launcher
361 rm %{_libdir}/scim-1.0/scim-helper-launcher
362 pushd %{_libdir}
363 for FILE in libscim-*.so*; do rm "$FILE"; done
364 popd
365 fi
366
367 %files profile_tv
368 %manifest %{name}.manifest
369 # files in bindir, lib/libscim*.so.*, lib/scim-1.0/scim-launcher are different
370 %{_bindir}/isf-demo-efl.tv
371 %{_bindir}/isf-panel-efl.tv
372 %{_bindir}/isf-log.tv
373 %{_libdir}/scim-1.0/scim-launcher.tv
374 %{_libdir}/scim-1.0/scim-helper-launcher.tv
375 %{_libdir}/libscim-*.so*.tv
376 # TV Only: remote-input
377 %attr(755,root,root) %{_datadir}/scim/remote-input/*
378 %endif
379
380 %files -f isf.lang
381 %manifest %{name}.manifest
382 %defattr(-,root,root,-)
383 %dir /etc/scim/conf
384 %attr(755,root,root) %{_sysconfdir}/profile.d/isf.sh
385 %{_sysconfdir}/scim/global
386 %{_sysconfdir}/scim/config
387 %{_datadir}/scim/isf_candidate_theme1.edj
388 %{_datadir}/scim/icons/*
389 %{_libdir}/ecore_imf/modules/*/*/*.so
390 %{_libdir}/scim-1.0/1.4.0/IMEngine/socket.so
391 %{_libdir}/scim-1.0/1.4.0/PanelAgent/*.so
392 %{_libdir}/scim-1.0/1.4.0/Config/simple.so
393 %{_libdir}/scim-1.0/1.4.0/Config/socket.so
394 %{_libdir}/scim-1.0/1.4.0/FrontEnd/*.so
395 # Fortunately imeparser is not fragemented.
396 %{TZ_SYS_RO_ETC}/package-manager/parserlib/category/libimeparser.so
397 %license COPYING
398 %{TZ_SYS_ETC}/dump.d/module.d/*
399 /usr/share/upgrade/scripts/*
400 # files in bindir, lib/libscim*.so.*, lib/scim-1.0/scim-launcher are different
401 %exclude %{_libdir}/libscim-*.so*.tv
402 %exclude %{_libdir}/libscim-*.so*.wearable
403 %{_libdir}/libscim-*.so*
404 # All .so files that are required by other packages should be housed in the main package
405 # although they might be overwritten by subpackages unless there is no possibilities of
406 # have-choice issues.
407
408 # For product build optimization only. Not for Tizen 4.0 Unified.
409 # if common or mobile or unified
410 %if "%{?profile}" != "tv" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
411 %files profile_common
412 %manifest %{name}.manifest
413 # files in bindir, lib/libscim*.so.*, lib/scim-1.0/scim-launcher are different
414 %{_bindir}/isf-demo-efl
415 %{_bindir}/isf-panel-efl
416 %{_bindir}/isf-log
417 %{_libdir}/scim-1.0/scim-launcher
418 %{_libdir}/scim-1.0/scim-helper-launcher
419 # default .so are housed in the main pkg.
420 %endif
421
422 %files devel
423 %defattr(-,root,root,-)
424 %{_includedir}/scim-1.0/*
425 %{_libdir}/libscim-*.so
426 %{_libdir}/pkgconfig/isf.pc
427 %{_libdir}/pkgconfig/scim.pc
428
429 %post -n org.tizen.isf-kbd-mode-changer
430 mkdir -p %{TZ_SYS_RO_APP}/org.tizen.isf-kbd-mode-changer
431
432 %files -n org.tizen.isf-kbd-mode-changer
433 %manifest org.tizen.isf-kbd-mode-changer.manifest
434 %{TZ_SYS_RO_PACKAGES}/org.tizen.isf-kbd-mode-changer.xml
435 %{APP_PREFIX}/*