[M47_2526] Chromium upversion to m47_2526 branch
[platform/framework/web/chromium-efl.git] / tizen_src / packaging / chromium-efl.spec
1 Name: chromium-efl
2 Summary: Chromium EFL
3 # Set by by scripts/update-chromium-version.sh
4 %define ChromiumVersion 47.2526.0
5 %define Week 43
6 Version: %{ChromiumVersion}.%{Week}
7 Release: 1
8 # The 'Group' should be specified as one of the following valid group list.
9 # https://wiki.tizen.org/wiki/Packaging/Guidelines#Group_Tag
10 Group: Web Framework/Web Engine
11 # The 'License' should be specified as some of the following known license list.
12 # http://spdx.org/licenses/
13 License: LGPL-2.1 or BSD-2-Clause
14
15 Source0: %{name}-%{version}.tar.gz
16 Source1: content_shell.in
17
18 %if 0%{?nodebug}
19 %global __debug_install_post %{nil}
20 %global debug_package %{nil}
21 %endif
22
23 %if 0%{?_enable_unittests}
24 %define _debug_mode 1
25 %endif
26
27 # Conditions for OBS build
28 # The OBS build does not support running script 'build_{target}.sh'.
29 # TODO: There is a bug regarding mismatched versions from repository.
30 #       So, the versions need to be considered as originally intended versions,
31 #       until those versions are fixed by platform team.
32 #       1) The value '2.3' of '%{tizen}' should be '2.4'.
33 #       2) The value '2.0' of '%{tizen}' should be '2.3'.
34 %if "%{tizen}" == "3.0"
35 %define chromium_efl_tizen_version 3.0
36 %endif
37 %if "%{tizen}" == "2.3" || "%{tizen}" == "2.4"
38 %define chromium_efl_tizen_version 2.4
39 %endif
40 %if "%{tizen}" == "2.0"
41 %define chromium_efl_tizen_version 2.3
42 %endif
43
44 %if %{!?TIZEN_PROFILE_TV:0}%{?TIZEN_PROFILE_TV:1} || "%{!?profile:0}%{?profile}" == "tv"
45 %define chromium_efl_tizen_profile tv
46 %else
47 %define chromium_efl_tizen_profile mobile
48 %endif
49
50 # Excluded wearable profile build
51 # Chromium-efl doesn't support the wearable profile
52 %if "%{?tizen_profile_name}" == "wearable"
53 ExcludeArch: %{arm} %ix86 x86_64
54 %endif
55
56 Requires(post): /sbin/ldconfig
57 Requires(post): xkeyboard-config
58 Requires(postun): /sbin/ldconfig
59
60 BuildRequires: bison, edje-tools, expat-devel, flex, gettext, gperf, libcap-devel
61 BuildRequires: libjpeg-turbo-devel, perl, python, python-xml, which
62 BuildRequires: pkgconfig(capi-appfw-application)
63 BuildRequires: pkgconfig(capi-location-manager)
64 BuildRequires: pkgconfig(capi-media-audio-io)
65 BuildRequires: pkgconfig(capi-media-camera)
66 BuildRequires: pkgconfig(capi-media-player)
67 BuildRequires: pkgconfig(capi-media-tool)
68 BuildRequires: pkgconfig(capi-system-device)
69 BuildRequires: pkgconfig(capi-system-info)
70 BuildRequires: pkgconfig(capi-system-system-settings)
71 BuildRequires: pkgconfig(dlog)
72 BuildRequires: pkgconfig(dbus-glib-1)
73 BuildRequires: pkgconfig(ecore)
74 BuildRequires: pkgconfig(ecore-evas)
75 BuildRequires: pkgconfig(ecore-imf)
76 BuildRequires: pkgconfig(ecore-imf-evas)
77 BuildRequires: pkgconfig(ecore-input)
78 BuildRequires: pkgconfig(elementary)
79 BuildRequires: pkgconfig(evas)
80 BuildRequires: pkgconfig(feedback)
81 BuildRequires: pkgconfig(flac)
82 BuildRequires: pkgconfig(fontconfig)
83 BuildRequires: pkgconfig(freetype2)
84 BuildRequires: pkgconfig(glib-2.0)
85 BuildRequires: pkgconfig(harfbuzz)
86 BuildRequires: pkgconfig(icu-i18n)
87 BuildRequires: pkgconfig(libdrm)
88 BuildRequires: pkgconfig(libexif)
89 BuildRequires: pkgconfig(libpci)
90 BuildRequires: pkgconfig(libpng)
91 BuildRequires: pkgconfig(libpulse)
92 BuildRequires: pkgconfig(libtbm)
93 BuildRequires: pkgconfig(libudev)
94 BuildRequires: pkgconfig(libusb-1.0)
95 BuildRequires: pkgconfig(libxml-2.0)
96 BuildRequires: pkgconfig(libxslt)
97 BuildRequires: pkgconfig(minizip)
98 BuildRequires: pkgconfig(nspr)
99 BuildRequires: pkgconfig(nss)
100 BuildRequires: pkgconfig(openssl)
101 BuildRequires: pkgconfig(scim)
102 BuildRequires: pkgconfig(speex)
103 BuildRequires: pkgconfig(sqlite3)
104 BuildRequires: pkgconfig(tts)
105 BuildRequires: pkgconfig(ui-gadget-1)
106 BuildRequires: pkgconfig(vconf)
107 BuildRequires: pkgconfig(zlib)
108
109 # Applied python acceleration for generating gyp files.
110 %if "%{chromium_efl_tizen_version}" == "3.0"
111 %ifarch armv7l
112 BuildRequires: python-accel-armv7l-cross-arm
113 %endif
114 %ifarch aarch64
115 BuildRequires: python-accel-aarch64-cross-aarch64
116 %endif
117 %endif
118
119 %if "%{?_with_wayland}" == "1"
120 BuildRequires: pkgconfig(ecore-wayland)
121 BuildRequires: pkgconfig(wayland-egl)
122 %else
123 BuildRequires: pkgconfig(ecore-x)
124 BuildRequires: pkgconfig(libdri2)
125 BuildRequires: pkgconfig(x11)
126 BuildRequires: pkgconfig(xcomposite)
127 BuildRequires: pkgconfig(xcursor)
128 BuildRequires: pkgconfig(xext)
129 BuildRequires: pkgconfig(xi)
130 BuildRequires: pkgconfig(xrandr)
131 BuildRequires: pkgconfig(xt)
132 BuildRequires: pkgconfig(xfixes)
133 BuildRequires: pkgconfig(xtst)
134 %endif
135
136 # TODO(youngsoo): The binutils-gold crashes mini_browser on the Tizen v3.0 ARM 64 bit images.
137 #                 Once fixed, use binutils-gold for all targets on Tizen v3.0.
138 %ifnarch aarch64
139 %if "%{chromium_efl_tizen_version}" == "3.0"
140 BuildRequires: binutils-gold
141 %endif
142 %endif
143
144 # Version Conditions for Each Targets
145 %if "%{?chromium_efl_tizen_profile}%{!?chromium_efl_tizen_profile:0}" == "mobile"
146 BuildRequires: bzip2-devel
147 BuildRequires: pkgconfig(efl-extension)
148 BuildRequires: pkgconfig(capi-system-sensor)
149 %if "%{?_with_wayland}" != "1"
150 BuildRequires: pkgconfig(xdamage)
151 %endif
152 %if "%{?chromium_efl_tizen_version}%{!?chromium_efl_tizen_version:0}" == "2.4"
153 BuildRequires: pkgconfig(ttrace)
154 %endif
155 %else # for TV
156 BuildRequires: pkgconfig(audio-session-mgr)
157 BuildRequires: pkgconfig(mm-session)
158 %endif
159
160 %if "%{?chromium_efl_tizen_version}%{!?chromium_efl_tizen_version:0}" == "2.4"
161 BuildRequires: pkgconfig(glesv2)
162 %endif
163
164 # Version Conditions for Every Targets
165 %if "%{?chromium_efl_tizen_version}%{!?chromium_efl_tizen_version:0}" >= "2.4"
166 BuildRequires: pkgconfig(gstreamer-1.0)
167 BuildRequires: pkgconfig(gstreamer-plugins-base-1.0)
168 BuildRequires: pkgconfig(gstreamer-app-1.0)
169 %else # <= Tizen v2.3
170 BuildRequires: pkgconfig(gstreamer-0.10)
171 BuildRequires: pkgconfig(gstreamer-plugins-base-0.10)
172 BuildRequires: pkgconfig(gstreamer-app-0.10)
173 %endif
174
175 %if 0%{?build_xwalk}
176 BuildRequires:  pkgconfig(appcore-common)
177 BuildRequires:  pkgconfig(ail)
178 BuildRequires:  pkgconfig(aul)
179 BuildRequires:  pkgconfig(haptic)
180 BuildRequires:  pkgconfig(nss)
181 BuildRequires:  pkgconfig(pkgmgr)
182 BuildRequires:  pkgconfig(pkgmgr-info)
183 BuildRequires:  pkgconfig(pkgmgr-installer)
184 BuildRequires:  pkgconfig(pkgmgr-parser)
185 BuildRequires:  pkgconfig(secure-storage)
186 BuildRequires:  pkgconfig(sensor)
187 BuildRequires:  pkgconfig(xmlsec1)
188 %endif
189
190 %description
191 Browser Engine based on Chromium EFL (Shared Library)
192
193 %package devel
194 Summary: Chromium EFL
195 Group: Development/Libraries
196 Requires: %{name} = %{version}-%{release}
197 %description devel
198 Browser Engine dev library based on Chromium EFL (development files)
199
200 %if 0%{?_enable_content_shell}
201 %package shell
202 Summary: Chromium EFL port of content_shell application
203 Group: Development/Libraries
204 Requires: %{name} = %{version}-%{release}
205 %description shell
206 Chromium EFL version of content_shell application
207 %endif
208
209 %if 0%{?build_xwalk}
210 %package -n crosswalk
211 Summary: Chromium-based app rintime
212 Group: Web Framework/Web Run Time
213 %description -n crosswalk
214 Crosswalk is an app runtime based on Chromium. It is an open source project
215 started by the Intel Open Source Technology Center (http://www.01.org).
216 %endif
217
218 %if 0%{?_enable_unittests}
219 %package unittests
220 Summary: Chromium unittests
221 Group: Development/Libraries
222 Requires: %{name} = %{version}-%{release}
223 %description unittests
224 Chromium unite tests
225 %endif
226
227 %if 0%{?build_ewk_unittests}
228 %package ewktest
229 Summary: Chromium EWK unittests
230 Group: Development/UnitTests
231 Requires: %{name} = %{version}-%{release}
232 %description ewktest
233 Chromium EFL unit test utilities
234 %endif
235
236 %if 0%{?build_chromedriver}
237 %package -n chromedriver
238 Summary: Selenium WebDriver for t-browser
239 Group: Development/Libraries
240 %description -n chromedriver
241 Selenium WebDriver for t-browser
242 %endif
243
244 %define _manifestdir %TZ_SYS_RO_PACKAGES
245 %define _manifestdir_ro %TZ_SYS_RO_PACKAGE
246 %define _desktop_icondir %TZ_SYS_RW_ICONS/default/small
247 %define _desktop_icondir_ro %TZ_SYS_RO_ICONS/default/small
248 %define _dbusservicedir /usr/share/dbus-1/services
249 %define _systemduserservicedir /usr/lib/systemd/user
250
251 # Directory for internal chromium executable components
252 %global CHROMIUM_EXE_DIR %{_libdir}/%{name}
253 # Constant read only data used by chromium-efl port
254 %global CHROMIUM_DATA_DIR %{_datadir}/%{name}
255 # Chromium unit tests install directory
256 %global CHROMIUM_UNITTESTS_DIR /opt/usr/chromium-unittests/
257 # Directory containing localization files
258 %global CHROMIUM_LOCALE_DIR %{_datadir}/%{name}/locale
259 %global CHROMIUM_WEBDB_DIR /opt/usr/apps/chromium-efl
260
261 %prep
262 %setup -q
263
264 %build
265
266 tizen_src/build/apply_patches.sh
267 trap 'tizen_src/build/apply_patches.sh -r' EXIT
268
269 # workaround for new nss library : search it in /usr/lib first, rather than /lib (system nss)
270 export LD_RUN_PATH=%{_libdir}
271 export LDFLAGS="$LDFLAGS -L/lib"
272 #/usr/lib
273 #/lib
274
275 # architecture related configuration + neon temporary workaround
276 %if %{?_skip_ninja:0}%{!?_skip_ninja:1}
277 %ifarch %{arm}
278   export ADDITION_OPTION=" -finline-limit=64 -foptimize-sibling-calls -fno-unwind-tables -fno-exceptions -Os "
279
280   export CFLAGS="$CFLAGS $ADDITION_OPTION"
281   export CXXFLAGS="$CXXFLAGS $ADDITION_OPTION"
282   export FFLAGS="$FFLAGS $ADDITION_OPTION"
283
284   export CFLAGS="$(echo $CFLAGS | sed 's/-mfpu=[a-zA-Z0-9-]*/-mfpu=neon/g')"
285   export CXXFLAGS="$(echo $CXXFLAGS | sed 's/-mfpu=[a-zA-Z0-9-]*/-mfpu=neon/g')"
286   export FFLAGS="$(echo $FFLAGS | sed 's/-mfpu=[a-zA-Z0-9-]*/-mfpu=neon/g')"
287 %else
288   export CFLAGS="$(echo $CFLAGS | sed 's/-Wl,--as-needed//g')"
289   export CXXFLAGS="$(echo $CXXFLAGS | sed 's/-Wl,--as-needed//g')"
290 %endif
291
292 %if 0%{?nodebug}
293   CFLAGS=$(echo $CFLAGS | sed 's/-g[0-9]*/ /g')
294   CXXFLAGS=$(echo $CXXFLAGS | sed 's/-g[0-9]*/ /g')
295 %endif
296
297 %if "%{!?chromium_efl_tizen_profile:0}%{?chromium_efl_tizen_profile}" == "mobile"
298   %define OUTPUT_BUILD_PROFILE_TARGET mobile
299 %else
300   %define OUTPUT_BUILD_PROFILE_TARGET tv
301 %endif
302
303 # The variable chromium-efl_tizen_version and _repository are essentially needed for build.
304 # Therefore, if the variable is not defined, it explicitly raises exception here.
305 %define OUTPUT_BASE_FOLDER out.tz_v%{chromium_efl_tizen_version}.%{OUTPUT_BUILD_PROFILE_TARGET}.%{_repository}
306 export GYP_GENERATOR_OUTPUT=$PWD/%{OUTPUT_BASE_FOLDER}
307
308 #set build mode
309 %if 0%{?_debug_mode}
310   %global OUTPUT_FOLDER %{OUTPUT_BASE_FOLDER}/Debug
311 %else
312   %global OUTPUT_FOLDER %{OUTPUT_BASE_FOLDER}/Release
313 %endif
314 %global XWALK_GEN %{OUTPUT_FOLDER}/xwalk_gen
315
316 if type ccache &> /dev/null; then
317   source tizen_src/build/ccache_env.sh %{OUTPUT_BUILD_PROFILE_TARGET}
318 fi
319
320 %if 0%{?build_xwalk}
321   mkdir -p "%{XWALK_GEN}"
322   sed "s/@VERSION@/%{version}/g" xwalk/packaging/crosswalk.xml.in > "%{XWALK_GEN}"/crosswalk.xml
323   cp -a xwalk/packaging/crosswalk-bin.manifest "%{XWALK_GEN}/crosswalk.manifest"
324   cp -a xwalk/packaging/crosswalk.png "%{XWALK_GEN}"
325   cp -a xwalk/LICENSE "%{XWALK_GEN}"/LICENSE.xwalk
326   cp -a AUTHORS "%{XWALK_GEN}"/AUTHORS.chromium
327   cp -a LICENSE "%{XWALK_GEN}"/LICENSE.chromium
328 %endif
329
330 #gyp generate
331 %if %{?_skip_gyp:0}%{!?_skip_gyp:1}
332 #run standard gyp_chromiumefl wrapper
333    ./tizen_src/build/gyp_chromiumefl.sh \
334   -Dexe_dir="%{CHROMIUM_EXE_DIR}" \
335   -Ddata_dir="%{CHROMIUM_DATA_DIR}" \
336   -Dedje_dir="%{CHROMIUM_DATA_DIR}"/themes \
337   -Dlocale_dir="%{CHROMIUM_LOCALE_DIR}" \
338 %if 0%{?_remove_webcore_debug_symbols:1}
339   -Dremove_webcore_debug_symbols=1 \
340 %endif
341 %if 0%{?chromium_efl_tizen_version:1}
342   -Dchromium_efl_tizen_version=%{chromium_efl_tizen_version} \
343 %endif
344 %if "%{?_with_wayland}" == "1"
345   -Duse_wayland=1 \
346 %endif
347 %if "%{?_repository}" == "emulator" || "%{?_repository}" == "emulator32-x11"
348   -Dtizen_emulator_support=1  \
349 %endif
350 %if 0%{?build_xwalk}
351   --xwalk \
352 %endif
353 %if 0%{?component_build}
354   -Dcomponent=shared_library \
355 %endif
356   -Dtizen_"%{OUTPUT_BUILD_PROFILE_TARGET}"=1 \
357   -Dbuilding_for_tizen_"%{OUTPUT_BUILD_PROFILE_TARGET}"=1
358 %endif
359
360 %ifarch %{arm}
361 tizen_src/build/prebuild/ninja.arm %{_smp_mflags} -C"%{OUTPUT_FOLDER}" \
362 %else
363 %ifarch aarch64
364 tizen_src/build/prebuild/ninja-linux64 %{_smp_mflags} -C"%{OUTPUT_FOLDER}" \
365 %else
366 tizen_src/build/prebuild/ninja %{_smp_mflags} -C"%{OUTPUT_FOLDER}" \
367 %endif
368 %endif
369 %if 0%{?_enable_content_shell}
370   content_shell \
371 %endif
372 %if 0%{?build_ewk_unittests}
373   ewk_unittests \
374 %endif
375 %if 0%{?build_chromedriver}
376   chromedriver_efl \
377 %endif
378 %if 0%{?build_xwalk}
379   xwalk xwalk_application_tools \
380 %endif
381   efl_webprocess chromium-ewk efl_webview_app mini_browser ubrowser
382
383 %if 0%{?_enable_unittests}
384 ninja %{_smp_mflags} -C"%{OUTPUT_FOLDER}" angle_unittests env_chromium_unittests cacheinvalidation_unittests \
385   url_unittests sandbox_linux_unittests crypto_unittests sql_unittests accessibility_unittests \
386   gfx_unittests printing_unittests events_unittests ppapi_unittests jingle_unittests \
387   flip_in_mem_edsm_server_unittests breakpad_unittests dbus_unittests libphonenumber_unittests \
388   base_unittests ffmpeg_unittests gin_unittests net_unittests snapshot_unittests \
389   google_apis_unittests
390 # TODO: Fix compilation of the following tests content_unittests cc_unittests shell_dialogs_unittests
391 # gpu_unittests compos9itor_unittests media_unittests
392 %endif
393
394 %endif
395
396 #XXX icudtl.dat is not copied by gyp. Do that manually
397 cp third_party/icu/android/icudtl.dat "%{OUTPUT_FOLDER}"
398
399 # XXX Workaround for using rpmlint with emulator build on Tizen_TV 3.0
400 #
401 # When using this repo http://download.tizen.org/snapshots/tizen/tv/latest/repos/emulator32-x11/packages/
402 # rpmlint-tizen-1.0-6.1 is installed in GBS-ROOT. So, after rpms are built
403 # gbs build script runs rpmlint to test created packages. There is some BUG in
404 # this script and directory /home/abuild/rpmbuild/OTHER/ isn't created. This
405 # directory is required for rpmlint's log file and its lack causes build error.
406 %if "%{?chromium_efl_tizen_version}%{!?chromium_efl_tizen_version:0}" == "3.0"
407 if [ ! -d %{buildroot}/../../OTHER/ -a -f /opt/testing/bin/rpmlint ]; then
408    mkdir -p %{buildroot}/../../OTHER/
409 fi
410 %endif
411
412 %install
413
414 # On Tizen 3.0, eu-strip (part of elfutils) does not play well with gold.
415 # [ XXs] extracting debug info from <path>/<package>/efl_webview_app
416 # [ XXs] eu-strip: while writing '<path>/<package>/efl_webview_app': cannot write data to file
417 #
418 # Problem is reported in various places, including:
419 # - https://bugzilla.redhat.com/show_bug.cgi?id=1174267
420 # - http://lists.gnu.org/archive/html/qemu-devel/2014-12/msg02702.html - QEMU
421 # - http://bit.ly/1E8W1Uo - Public Tizen/Crosswalk
422 #
423 # The solution applied to Tizen public requires to patch QEMU:
424 # - https://review.tizen.org/gerrit/#/c/32365/1/linux-user/syscall.c
425 # Until our Tizen 3.x QEMU is fixed, we use a home made x64 bit statically
426 # linked eu-strip, so that we can link with gold.
427 %if "%{?chromium_efl_tizen_version}%{!?chromium_efl_tizen_version:0}" == "3.0"
428 export PATH=$(pwd)/build/prebuild/tizen_3.0/:${PATH}
429 %endif
430
431 # Generate pkg-confg file
432 mkdir -p "%{OUTPUT_FOLDER}"/pkgconfig/
433 sed -e 's#?VERSION?#%{version}#' tizen_src/build/pkgconfig/chromium-efl.pc.in \
434     > "%{OUTPUT_FOLDER}"/pkgconfig/chromium-efl.pc
435
436 %if "%{?chromium_efl_tizen_version}%{!?chromium_efl_tizen_version:0}" != "3.0"
437 install -d "%{buildroot}"%{_sysconfdir}/smack/accesses2.d
438 %endif
439 install -d "%{buildroot}"%{_bindir}
440 install -d "%{buildroot}"%{_libdir}/pkgconfig
441 install -d "%{buildroot}"%{_includedir}/chromium-ewk
442 install -d "%{buildroot}"%{_includedir}/v8
443 install -d "%{buildroot}%{CHROMIUM_EXE_DIR}"
444 install -d "%{buildroot}%{CHROMIUM_EXE_DIR}/locales"
445 install -d "%{buildroot}%{CHROMIUM_DATA_DIR}"/themes
446 %if 0%{?build_chromedriver}
447 install -d "%{buildroot}"/usr/apps/com.samsung.chromedriver/bin
448 %endif
449
450 cp -r "%{OUTPUT_FOLDER}/locale" "%{buildroot}/%{CHROMIUM_LOCALE_DIR}"
451
452 install -m 0755 "%{OUTPUT_FOLDER}"/locales/*.pak      "%{buildroot}%{CHROMIUM_EXE_DIR}"/locales
453
454 install -m 0755 "%{OUTPUT_FOLDER}"/lib/libchromium-ewk.so    "%{buildroot}"%{_libdir}
455
456 # [M47_2526] Temporary disabling the codes for switching to new chromium
457 #            FIXME: http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=14520
458 #install -m 0755 "%{OUTPUT_FOLDER}"/libffmpegsumo.so  "%{buildroot}%{CHROMIUM_EXE_DIR}"
459 install -m 0755 "%{OUTPUT_FOLDER}"/efl_webprocess    "%{buildroot}%{CHROMIUM_EXE_DIR}"
460 install -m 0755 "%{OUTPUT_FOLDER}"/icudtl.dat    "%{buildroot}%{CHROMIUM_EXE_DIR}"
461 install -m 0755 "%{OUTPUT_FOLDER}"/natives_blob.bin  "%{buildroot}%{CHROMIUM_EXE_DIR}"
462 install -m 0755 "%{OUTPUT_FOLDER}"/snapshot_blob.bin "%{buildroot}%{CHROMIUM_EXE_DIR}"
463 install -m 0755 "%{OUTPUT_FOLDER}"/content_shell.pak "%{buildroot}%{CHROMIUM_EXE_DIR}"
464 install -m 0644 "%{OUTPUT_FOLDER}"/resources/*.edj   "%{buildroot}%{CHROMIUM_DATA_DIR}"/themes
465
466 # for Tizen v3.0
467 %if "%{?chromium_efl_tizen_version}%{!?chromium_efl_tizen_version:0}" == "3.0"
468 mkdir -p "%{buildroot}"/usr/apps/org.tizen.%{name}/bin
469 install -m 0755 "%{OUTPUT_FOLDER}"/efl_webview_app   "%{buildroot}"/usr/apps/org.tizen.%{name}/bin/
470 install -m 0755 "%{OUTPUT_FOLDER}"/mini_browser      "%{buildroot}"/usr/apps/org.tizen.%{name}/bin/
471 install -m 0755 "%{OUTPUT_FOLDER}"/ubrowser          "%{buildroot}"/usr/apps/org.tizen.%{name}/bin/
472
473 install -d "%{buildroot}"/usr/share/packages
474 install -m 0644 tizen_src/ewk/efl_webview_app/chromium-efl_v3.0.xml "%{buildroot}"/usr/share/packages
475 install -m 0644 tizen_src/ewk/efl_webview_app/ubrowser_v3.0.xml "%{buildroot}"/usr/share/packages
476
477 mkdir -p "%{buildroot}"/usr/apps/org.tizen.%{name}/res/icons
478 install -d "%{buildroot}"/usr/share/icons
479 install -m 0644 tizen_src/ewk/efl_webview_app/mini-browser.png "%{buildroot}"/usr/apps/org.tizen.%{name}/res/icons
480 %else # for Tizen v2.X
481 install -m 0755 "%{OUTPUT_FOLDER}"/efl_webview_app   "%{buildroot}"%{_bindir}
482 install -m 0755 "%{OUTPUT_FOLDER}"/mini_browser      "%{buildroot}"%{_bindir}
483 install -m 0755 "%{OUTPUT_FOLDER}"/ubrowser          "%{buildroot}"%{_bindir}
484
485 install -d "%{buildroot}"/opt/share/packages
486 install -m 0644 tizen_src/ewk/efl_webview_app/chromium-efl.xml "%{buildroot}"/opt/share/packages
487 install -m 0644 tizen_src/ewk/efl_webview_app/ubrowser.xml     "%{buildroot}"/opt/share/packages
488
489 install -d "%{buildroot}"/opt/share/icons
490 install -m 0644 tizen_src/ewk/efl_webview_app/mini-browser.png "%{buildroot}"/opt/share/icons
491 %endif
492
493 install -m 0644 "%{OUTPUT_FOLDER}"/pkgconfig/*.pc    "%{buildroot}"%{_libdir}/pkgconfig/
494 install -m 0644 tizen_src/ewk/efl_integration/public/*.h                  "%{buildroot}"%{_includedir}/chromium-ewk/
495 install -m 0644 v8/include/*.h "%{buildroot}"%{_includedir}/v8/
496
497 %if 0%{?build_chromedriver}
498 install -m 0755 "%{OUTPUT_FOLDER}"/chromedriver_efl "%{buildroot}"/usr/apps/com.samsung.chromedriver/bin
499 install -m 0755 tizen_src/scripts/start-chrome-driver.sh "%{buildroot}"/%{_bindir}
500 %endif
501
502 %if 0%{?_enable_content_shell}
503 install -m 0755 "%{OUTPUT_FOLDER}"/content_shell "%{buildroot}%{CHROMIUM_EXE_DIR}"/content_shell
504 sed 's#@binary@#%{CHROMIUM_EXE_DIR}/content_shell#' %{SOURCE1} > "%{buildroot}"%{_bindir}/content_shell
505 %endif
506
507 %if 0%{?_enable_unittests}
508 install -d "%{INSTALL_ROOT}%{CHROMIUM_UNITTESTS_DIR}"
509 for test in "%{OUTPUT_FOLDER}/*_unittests"; do
510   install -m 0755 ${test} "%{INSTALL_ROOT}%{CHROMIUM_UNITTESTS_DIR}"
511 done
512 %endif
513
514 %if 0%{?build_ewk_unittests}
515 mkdir -p %{buildroot}/opt/usr/resources/
516 mkdir -p %{buildroot}/opt/usr/utc_exec/
517 cp -r tizen_src/ewk/unittest/resources/* %{buildroot}/opt/usr/resources/
518 install -m 0644 "%{OUTPUT_FOLDER}"/ewk_unittests %{buildroot}/opt/usr/utc_exec/
519 install -m 0755 tizen_src/ewk/utc_gtest_run.sh %{buildroot}/opt/usr/utc_exec/
520 %endif
521
522 %if 0%{?build_xwalk}
523 install -m 0755 -p -D %{OUTPUT_FOLDER}/xwalk %{buildroot}%{_libdir}/xwalk/xwalk
524 install -m 0755 -p -D %{OUTPUT_FOLDER}/xwalk_backend %{buildroot}%{_libdir}/xwalk/xwalk_backend
525
526 # Supporting libraries and resources.
527 install -m 0644 -p -D %{OUTPUT_FOLDER}/lib/libxwalk_backend_lib.so %{buildroot}%{_libdir}/xwalk/libxwalk_backend_lib.so
528 install -m 0644 -p -D %{OUTPUT_FOLDER}/icudtl.dat %{buildroot}%{_libdir}/xwalk/icudtl.dat
529 install -m 0644 -p -D %{OUTPUT_FOLDER}/libffmpegsumo.so %{buildroot}%{_libdir}/xwalk/libffmpegsumo.so
530 install -m 0644 -p -D %{OUTPUT_FOLDER}/xwalk.pak %{buildroot}%{_libdir}/xwalk/xwalk.pak
531 install -d %{buildroot}%{_datadir}/xwalk
532 install -m 0644 -p -D xwalk/application/common/tizen/configuration/*.xsd %{buildroot}%{_datadir}/xwalk
533
534 # PNaCl
535 %if %{?_disable_nacl}%{!?_disable_nacl:1} == 0
536 install -m 0755 -p -D %{OUTPUT_FOLDER}/nacl_bootstrap_raw %{buildroot}%{_libdir}/xwalk/nacl_bootstrap_raw
537 install -m 0755 -p -D %{OUTPUT_FOLDER}/nacl_helper %{buildroot}%{_libdir}/xwalk/nacl_helper
538 install -m 0755 -p -D %{OUTPUT_FOLDER}/nacl_helper_bootstrap %{buildroot}%{_libdir}/xwalk/nacl_helper_bootstrap
539 install -m 0644 -p -D %{OUTPUT_FOLDER}/nacl_irt_*.nexe %{buildroot}%{_libdir}/xwalk
540 install -d %{buildroot}%{_libdir}/xwalk/pnacl
541 install -m 0644 -p -D %{OUTPUT_FOLDER}/pnacl/* %{buildroot}%{_libdir}/xwalk/pnacl
542 %endif
543
544 # Register xwalk to the package manager.
545 install -m 0644 -p -D %{XWALK_GEN}/crosswalk.xml %{buildroot}%{_manifestdir}/crosswalk.xml
546 install -m 0644 -p -D %{XWALK_GEN}/crosswalk.png %{buildroot}%{_desktop_icondir}/crosswalk.png
547 %endif
548
549 %post
550 # apply smack rule
551 smack_reload.sh
552
553 # CHROMIUM_WEBDB_DIR is a default path when application doesn't have own installation path.
554 # For example, mini-browser doesn't have own install path, in that case, mini-browser will
555 # use "/opt/usr/apps/chromium-efl/data" for HTML5 File System, Local Storage and so on.
556 # However, reference browser should have own installation path (e.g. /opt/usr/apps/com.samsung.browser/data),
557 # the reference browser should process similar work in order to support HTML5 Local Storage,
558 # File System and so on.
559
560 mkdir -p %{CHROMIUM_WEBDB_DIR}/data/
561 chown -R app:app %{CHROMIUM_WEBDB_DIR}/data
562
563 mkdir -p %{_desktop_icondir_ro}
564 mkdir -p %{_manifestdir_ro}
565
566 %postun
567
568 %files
569 # for Tizen v3.0
570 %if "%{?chromium_efl_tizen_version}%{!?chromium_efl_tizen_version:0}" == "3.0"
571 %manifest packaging/chromium-efl_v3.0.manifest
572 /usr/apps/org.tizen.%{name}/bin/efl_webview_app
573 /usr/apps/org.tizen.%{name}/bin/mini_browser
574 /usr/apps/org.tizen.%{name}/bin/ubrowser
575 /usr/share/packages/chromium-efl_v3.0.xml
576 /usr/share/packages/ubrowser_v3.0.xml
577 /usr/apps/org.tizen.%{name}/res/icons/mini-browser.png
578 %else # for Tizen v2.X
579 %manifest packaging/%{name}.manifest
580 %{_bindir}/efl_webview_app
581 %{_bindir}/mini_browser
582 %{_bindir}/ubrowser
583 /opt/share/packages/chromium-efl.xml
584 /opt/share/packages/ubrowser.xml
585 /opt/share/icons/mini-browser.png
586 %endif
587 %defattr(-,root,root,-)
588 %{_libdir}/libchromium-ewk.so
589 %{CHROMIUM_EXE_DIR}/efl_webprocess
590 # [M47_2526] Temporary disabling the codes for switching to new chromium
591 #            FIXME: http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=14520
592 #%{CHROMIUM_EXE_DIR}/libffmpegsumo.so
593 %{CHROMIUM_EXE_DIR}/icudtl.dat
594 %{CHROMIUM_EXE_DIR}/natives_blob.bin
595 %{CHROMIUM_EXE_DIR}/snapshot_blob.bin
596 %{CHROMIUM_EXE_DIR}/content_shell.pak
597 %{CHROMIUM_EXE_DIR}/locales/*.pak
598 %{CHROMIUM_DATA_DIR}/themes/*.edj
599 %{CHROMIUM_LOCALE_DIR}
600
601 %files devel
602 %defattr(-,root,root,-)
603 %{_includedir}/chromium-ewk/*.h
604 %{_libdir}/pkgconfig/*.pc
605 %{_includedir}/v8/*
606
607 %if 0%{?_enable_content_shell}
608 %files shell
609 %defattr(0755,root,root,-)
610 %{CHROMIUM_EXE_DIR}/content_shell
611 %{_bindir}/content_shell
612 %endif
613
614 %if 0%{?_enable_unittests}
615 %files unittests
616 %defattr(-,root,root,-)
617 %{CHROMIUM_UNITTESTS_DIR}/*
618 %endif
619
620 %if 0%{?build_ewk_unittests}
621 %files ewktest
622 %defattr(-,root,root,-)
623 %manifest ./packaging/chromium-ewktest.manifest
624 /opt/usr/utc_exec/*
625 /opt/usr/resources/*
626 %endif
627
628 %if 0%{?build_chromedriver}
629 %files -n chromedriver
630 /usr/bin/start-chrome-driver.sh
631 /usr/apps/com.samsung.chromedriver
632 %endif
633
634 %if 0%{?build_xwalk}
635 %files -n crosswalk
636 %manifest %{XWALK_GEN}/crosswalk.manifest
637 %license %{XWALK_GEN}/AUTHORS.chromium %{XWALK_GEN}/LICENSE.chromium %{XWALK_GEN}/LICENSE.xwalk
638 %{_libdir}/xwalk/icudtl.dat
639 %{_libdir}/xwalk/libffmpegsumo.so
640 %if %{?_disable_nacl}%{!?_disable_nacl:1} == 0
641 %{_libdir}/xwalk/nacl_bootstrap_raw
642 %{_libdir}/xwalk/nacl_helper
643 %{_libdir}/xwalk/nacl_helper_bootstrap
644 %{_libdir}/xwalk/nacl_irt_*.nexe
645 %{_libdir}/xwalk/pnacl/*
646 %endif
647 %{_libdir}/xwalk/xwalk
648 %{_libdir}/xwalk/xwalk.pak
649 %{_libdir}/xwalk/libxwalk_backend_lib.so
650 %{_libdir}/xwalk/xwalk_backend
651 %{_manifestdir}/crosswalk.xml
652 %{_desktop_icondir}/crosswalk.png
653 %{_datadir}/xwalk/*
654 %endif