DALi Version 2.2.16
[platform/core/uifw/dali-csharp-binder.git] / packaging / dali-csharp-binder.spec
1 # NOTES
2 # This spec file is used to build DALi C# binder for different Tizen Profiles
3 # Current profiles are:  Mobile, TV, Wearable, Common
4 #
5 # The profile variable is defined outside of the spec file in a build.conf file.
6 # It will contain the profile and whether or not to build with X11 or Wayland
7 #
8 # gbs will try to download the build.conf for the platform automatically from the repo location when
9 # performing a gbs build ( use gbs build -v to see it download location) E.g.
10 # http://download.tizen.org/snapshots/tizen/tv/tizen-tv/repos/arm-wayland/packages/repodata/xxxx-build.conf.gz
11
12 # This if statement is for backward compatibility with GBM/Obsolete build systems
13 %if "%{?profile}" != "wearable" && "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
14 %global __provides_exclude_from ^.*\\.(wearable|mobile|tv|ivi|common)$
15 %endif
16
17 %bcond_with wayland
18
19 #please update nui_internal_version below, if you changed version-check.cpp
20 %define nui_internal_version nui550
21
22 Name: dali2-csharp-binder
23 Summary: The DALI Csharp Binder
24 Version: 2.2.16
25 Release: 1
26 Group: uifw/graphic
27 License: Apache-2.0 and BSD-3-Clause and MIT
28 Source: %{name}-%{version}.tar.xz
29
30 Requires(post): /sbin/ldconfig
31 Requires(postun): /sbin/ldconfig
32
33 %define tizen_platform_config_supported 1
34 BuildRequires:  pkgconfig(libtzplatform-config)
35
36 # If the profile is selected, the line below is repquired.
37 # if wearable || "undefined"
38 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
39 BuildRequires:  pkgconfig(capi-appfw-watch-application)
40 BuildRequires:  pkgconfig(appcore-watch)
41 BuildRequires:  pkgconfig(screen_connector_provider)
42 %endif
43
44 BuildRequires: pkgconfig
45 BuildRequires: cmake
46 BuildRequires: gawk
47 BuildRequires: pkgconfig(dali2-core)
48 BuildRequires: pkgconfig(dali2-adaptor)
49 BuildRequires: pkgconfig(dali2-toolkit)
50 BuildRequires: pkgconfig(dali2-scene3d)
51 %if "%{_vd_cfg_product_type}" != "AUDIO" && "%{_vd_cfg_product_type}" !="AV"
52 %define rive_animation_view 1
53 BuildRequires: pkgconfig(dali2-extension-rive-animation-view)
54 %endif
55
56
57 BuildRequires: pkgconfig(widget_viewer_dali)
58 BuildRequires: pkgconfig(watch_viewer_dali)
59 BuildRequires: pkgconfig(watch-holder-base)
60
61 %if 0%{?tizen_version_major} >= 5
62 BuildRequires: pkgconfig(ecore-wl2)
63 %else
64 BuildRequires:  pkgconfig(ecore-wayland)
65 %endif
66
67 # for multiprofile
68 Requires:   %{name}-compat = %{version}-%{release}
69 Recommends: %{name}-profile_common = %{version}-%{release}
70
71 %description
72 dali-csharp-binder
73
74 ###########################################
75 # Dali csharp binder for profiles
76 ###########################################
77
78 # If the profile is selected, the line below is repquired.
79 # if mobile || "undefined"
80 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
81 %package profile_mobile
82 Summary:        The DALi Tizen csharp binder for mobile
83 Provides:       %{name}-compat = %{version}-%{release}
84 Conflicts:      %{name}-profile_tv
85 Conflicts:      %{name}-profile_wearable
86 Conflicts:      %{name}-profile_ivi
87 Conflicts:      %{name}-profile_common
88 %description profile_mobile
89 The DALi Tizen csharp binder for mobile.
90 %endif
91
92 # If the profile is selected, the line below is repquired.
93 # if tv ||"undefined"
94 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
95 %package profile_tv
96 Summary:        The DALi Tizen csharp binder for tv
97 Provides:       %{name}-compat = %{version}-%{release}
98 Conflicts:      %{name}-profile_mobile
99 Conflicts:      %{name}-profile_wearable
100 Conflicts:      %{name}-profile_ivi
101 Conflicts:      %{name}-profile_common
102 %description profile_tv
103 The DALi Tizen csharp binder for tv.
104 %endif
105
106 # If the profile is selected, the line below is repquired.
107 # if wearable || "undefined"
108 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
109 %package profile_wearable
110 Summary:        The DALi Tizen csharp binder for wearable
111 Provides:       %{name}-compat = %{version}-%{release}
112 Conflicts:      %{name}-profile_mobile
113 Conflicts:      %{name}-profile_tv
114 Conflicts:      %{name}-profile_ivi
115 Conflicts:      %{name}-profile_common
116 %description profile_wearable
117 The DALi Tizen csharp binder for wearable.
118 %endif
119
120 # If the profile is selected, the line below is repquired.
121 # if ivi ||"undefined"
122 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
123 %package profile_ivi
124 Summary:        The DALi Tizen csharp binder for ivi
125 Provides:       %{name}-compat = %{version}-%{release}
126 Conflicts:      %{name}-profile_mobile
127 Conflicts:      %{name}-profile_wearable
128 Conflicts:      %{name}-profile_tv
129 Conflicts:      %{name}-profile_common
130 %description profile_ivi
131 The DALi Tizen csharp binder for ivi.
132 %endif
133
134 # If the profile is selected, the line below is repquired.
135 # if common ||"undefined"
136 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
137 # Currently Tizen Common we use does not have wayland extensions like xdg-shell
138 %package profile_common
139 %define tizen_2_2_compatibility 0
140 Summary:        The DALi Tizen csharp binder for common
141 Provides:       %{name}-compat = %{version}-%{release}
142 Conflicts:      %{name}-profile_mobile
143 Conflicts:      %{name}-profile_wearable
144 Conflicts:      %{name}-profile_tv
145 Conflicts:      %{name}-profile_ivi
146 %description profile_common
147 The DALi Tizen csharp binder for common.
148 %endif
149
150
151 ##############################
152 # devel
153 ##############################
154 %package devel
155 Summary: build dali csharp binder
156 Group: Development/Building
157 Requires: %{name} = %{version}-%{release}
158
159 %description devel
160 This package includes developer files common to all packages.
161
162
163 ##############################
164 # Dali Scene3D
165 ##############################
166 %package scene3d
167 Summary:    build dali csharp binder scene3d
168 Group:      System/Libraries
169 Requires:   %{name} = %{version}-%{release}
170 %description scene3d
171 Scene 3D for Dali
172
173
174 ##############################
175 # Preparation
176 ##############################
177 %prep
178 %setup -q
179
180 # %define dali_data_rw_dir         %TZ_SYS_RO_SHARE/dali/
181 # %define dali_data_ro_dir         %TZ_SYS_RO_SHARE/dali/
182
183 ##############################
184 # Build
185 ##############################
186 %build
187 PREFIX+="/usr"
188 CXXFLAGS+=" -Wall -g -Os -fPIC"
189 LDFLAGS+=" -Wl,--rpath=%{_libdir} "
190
191 %if %{with wayland}
192 CFLAGS+=" -DWAYLAND"
193 CXXFLAGS+=" -DWAYLAND"
194 cmake_flags=" -DENABLE_WAYLAND=ON"
195
196 # Use this conditional when Tizen version is 5.x or greater
197 %if 0%{?tizen_version_major} >= 5
198 CXXFLAGS+=" -DOVER_TIZEN_VERSION_5"
199
200 # Need Ecore-Wayland2 when Tizen version is 5.x or greater
201 CFLAGS+=" -DECORE_WL2 -DEFL_BETA_API_SUPPORT"
202 CXXFLAGS+=" -DECORE_WL2 -DEFL_BETA_API_SUPPORT"
203 cmake_flags+=" -DENABLE_ECORE_WAYLAND2=ON"
204 %endif
205
206 # Use this conditional when Tizen version is 7.x or greater
207 %if 0%{?tizen_version_major} >= 7
208 CXXFLAGS+=" -DOVER_TIZEN_VERSION_7"
209 %endif
210
211 %endif
212
213 %if 0%{?enable_debug}
214 cmake_flags+=" -DCMAKE_BUILD_TYPE=Debug"
215 %endif
216
217 %if 0%{?rive_animation_view}
218 cmake_flags+=" -DENABLE_RIVE_ANIMATION=ON"
219 %endif
220
221 # autogen
222 libtoolize --force
223 cd %{_builddir}/%{name}-%{version}/build/tizen
224
225 # DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
226 # DALI_DATA_RO_DIR="%{dali_data_ro_dir}"  ; export DALI_DATA_RO_DIR
227 %if 0%{?tizen_platform_config_supported}
228 TIZEN_PLATFORM_CONFIG_SUPPORTED="%{tizen_platform_config_supported}" ; export TIZEN_PLATFORM_CONFIG_SUPPORTED
229 %endif
230
231 cmake_flags+=" -DCMAKE_INSTALL_PREFIX=$PREFIX"
232 cmake_flags+=" -DCMAKE_INSTALL_LIBDIR=%{_libdir}"
233 cmake_flags+=" -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir}"
234 cmake_flags+=" -DENABLE_TIZEN_MAJOR_VERSION=%{tizen_version_major}"
235 cmake_flags+=" -DENABLE_SCENE3D=ON"
236
237 # Set up the build via Cmake
238 #######################################################################
239 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
240 # if mobile || "undefined"
241 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
242
243 mkdir -p mobile
244 pushd mobile
245
246 cmake -DENABLE_PROFILE=MOBILE $cmake_flags ..
247
248 # Build.
249 make %{?jobs:-j%jobs}
250 popd
251
252 %endif
253
254 #######################################################################
255 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
256 # if tv ||"undefined"
257 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
258
259 mkdir -p tv
260 pushd tv
261
262 cmake -DENABLE_PROFILE=TV $cmake_flags ..
263
264 # Build.
265 make %{?jobs:-j%jobs}
266 popd
267
268 %endif
269
270 #######################################################################
271 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
272 # if wearable || "undefined"
273 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
274
275 mkdir -p wearable
276 pushd wearable
277
278 cmake -DENABLE_PROFILE=WEARABLE $cmake_flags ..
279
280 # Build.
281 make %{?jobs:-j%jobs}
282 popd
283
284 %endif
285
286 #######################################################################
287 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
288 # if ivi ||"undefined"
289 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
290
291 mkdir -p ivi
292 pushd ivi
293
294 cmake -DENABLE_PROFILE=IVI $cmake_flags ..
295
296 # Build.
297 make %{?jobs:-j%jobs}
298 popd
299
300 %endif
301
302 #######################################################################
303 # common
304 # This is for backward-compatibility. This does not deteriorate 4.0 Configurability
305 # if common ||"undefined"
306 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
307
308 mkdir -p common
309 pushd common
310
311 cmake -DENABLE_PROFILE=COMMON $cmake_flags ..
312
313 # Build.
314 make %{?jobs:-j%jobs}
315 popd
316
317 %endif
318
319 ##############################
320 # Installation
321 ##############################
322 %install
323 rm -rf %{buildroot}
324
325 pushd %{_builddir}/%{name}-%{version}/build/tizen
326
327 # if mobile || "undefined"
328 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
329 pushd mobile
330 %make_install
331 %if "%{?profile}" != "mobile"
332 pushd  %{buildroot}%{_libdir}
333 cp libdali2-csharp-binder.so.*.*.* libdali2-csharp-binder.so.mobile # If we're only building this profile, then there's no need to copy the lib
334 popd
335 make clean # So that we can gather symbol/size information for only one profile if we're building all profiles
336 %endif
337 popd
338 %endif
339
340 # if tv ||"undefined"
341 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
342 pushd tv
343 %make_install
344 %if "%{?profile}" != "tv"
345 pushd  %{buildroot}%{_libdir}
346 cp libdali2-csharp-binder.so.*.*.* libdali2-csharp-binder.so.tv # If we're only building this profile, then there's no need to copy the lib
347 popd
348 make clean # So that we can gather symbol/size information for only one profile if we're building all profiles
349 %endif
350 popd
351 %endif
352
353 # if wearable || "undefined"
354 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
355 pushd wearable
356 %make_install
357 %if "%{?profile}" != "wearable"
358 pushd  %{buildroot}%{_libdir}
359 cp libdali2-csharp-binder.so.*.*.* libdali2-csharp-binder.so.wearable # If we're only building this profile, then there's no need to copy the lib
360 popd
361 make clean # So that we can gather symbol/size information for only one profile if we're building all profiles
362 %endif
363 popd
364 %endif
365
366 # if ivi ||"undefined"
367 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
368 pushd ivi
369 %make_install
370 %if "%{?profile}" != "ivi"
371 pushd  %{buildroot}%{_libdir}
372 cp libdali2-csharp-binder.so.*.*.* libdali2-csharp-binder.so.ivi # If we're only building this profile, then there's no need to copy the lib
373 popd
374 make clean # So that we can gather symbol/size information for only one profile if we're building all profiles
375 %endif
376 popd
377 %endif
378
379 # if common ||"undefined"
380 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
381 pushd common
382 %make_install
383 # No clean so we can gather symbol/size information for the common profile
384 popd
385 %endif
386
387 ##############################
388 # Upgrade order:
389 # 1 - Pre Install new package
390 # 2 - Install new package
391 # 3 - Post install new package
392 # 4 - Pre uninstall old package
393 # 5 - Remove files not overwritten by new package
394 # 6 - Post uninstall old package
395 ##############################
396
397 %pre
398 exit 0
399
400 ##############################
401 #  Post Install new package
402 ##############################
403 %post
404 pushd %{_libdir}
405 for i in mobile tv wearable ivi; do [[ -f libdali2-csharp-binder.so.$i ]] && ln -sf libdali2-csharp-binder.so.$i libdali2-csharp-binder.so.2.0.0; done
406 popd
407 /sbin/ldconfig
408 exit 0
409
410 ##############################
411 #  Pre Uninstall old package
412 ##############################
413 %preun
414 exit 0
415
416 ##############################
417 #  Post Uninstall old package
418 ##############################
419 %postun
420 /sbin/ldconfig
421 exit 0
422
423 ##############################
424 # Mobile Profile Commands
425 # No need to create a symbolic link on install required if only building this profile
426 # if mobile || "undefined"
427 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
428 %post profile_mobile
429 %if "%{?profile}" != "mobile"
430 pushd %{_libdir}
431 ln -sf libdali2-csharp-binder.so.mobile libdali2-csharp-binder.so.2.0.0
432 popd
433 %endif
434 /sbin/ldconfig
435 exit 0
436
437 %postun profile_mobile
438 /sbin/ldconfig
439 exit 0
440 %endif
441
442 ##############################
443 # TV Profile Commands
444 # No need to create a symbolic link on install required if only building this profile
445 # if tv ||"undefined"
446 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
447 %post profile_tv
448 %if "%{?profile}" != "tv"
449 pushd %{_libdir}
450 ln -sf libdali2-csharp-binder.so.tv libdali2-csharp-binder.so.2.0.0
451 popd
452 %endif
453 /sbin/ldconfig
454 exit 0
455
456 %postun profile_tv
457 /sbin/ldconfig
458 exit 0
459 %endif
460
461 ##############################
462 # Wearable Profile Commands
463 # No need to create a symbolic link on install required if only building this profile
464 # if wearable || "undefined"
465 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
466 %post profile_wearable
467 %if "%{?profile}" != "wearable"
468 pushd %{_libdir}
469 ln -sf libdali2-csharp-binder.so.wearable libdali2-csharp-binder.so.2.0.0
470 popd
471 %endif
472 /sbin/ldconfig
473 exit 0
474
475 %postun profile_wearable
476 /sbin/ldconfig
477 exit 0
478 %endif
479
480 ##############################
481 # IVI Profile Commands
482 # No need to create a symbolic link on install required if only building this profile
483 # if ivi ||"undefined"
484 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
485 %post profile_ivi
486 %if "%{?profile}" != "ivi"
487 pushd %{_libdir}
488 ln -sf libdali2-csharp-binder.so.ivi libdali2-csharp-binder.so.2.0.0
489 popd
490 %endif
491 /sbin/ldconfig
492 exit 0
493
494 %postun profile_ivi
495 /sbin/ldconfig
496 exit 0
497 %endif
498
499 ##############################
500 # Common Profile Commands
501 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
502 %post profile_common
503 /sbin/ldconfig
504 exit 0
505
506 %postun profile_common
507 /sbin/ldconfig
508 exit 0
509 %endif
510
511 ##############################
512 # Files in Binary Packages
513 ##############################
514 %files
515 %manifest dali-csharp-binder.manifest
516 %license LICENSE
517 %defattr(-,root,root,-)
518 %{_libdir}/libdali2-csharp-binder.so
519 %{_libdir}/libdali2-csharp-binder.so.2
520 %{_libdir}/libdali2-csharp-binder.so.2.0.0
521
522 #################################################
523
524 %files scene3d
525 %manifest dali-csharp-binder.manifest
526 %defattr(-,root,root,-)
527 %{_libdir}/libdali2-csharp-binder-scene3d.so*
528
529 #################################################
530
531 # If the profile is selected, the line below is repquired.
532 # if common ||"undefined"
533 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
534 %files profile_common
535 %manifest dali-csharp-binder.manifest
536 # default .so files are housed in the main pkg.
537 %endif
538
539 # If the profile is selected, the line below is repquired.
540 # if mobile || "undefined"
541 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
542 %files profile_mobile
543 %manifest dali-csharp-binder.manifest
544 %defattr(-,root,root,-)
545 %if "%{?profile}" != "mobile"
546 %{_libdir}/libdali2-csharp-binder.so.*mobile
547 %endif
548 %endif
549
550 # If the profile is selected, the line below is repquired.
551 # if tv ||"undefined"
552 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
553 %files profile_tv
554 %manifest dali-csharp-binder.manifest
555 %defattr(-,root,root,-)
556 %if "%{?profile}" != "tv"
557 %{_libdir}/libdali2-csharp-binder.so.*tv
558 %endif
559 %endif
560
561 # If the profile is selected, the line below is repquired.
562 # if wearable || "undefined"
563 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
564 %files profile_wearable
565 %manifest dali-csharp-binder.manifest
566 %defattr(-,root,root,-)
567 %if "%{?profile}" != "wearable"
568 %{_libdir}/libdali2-csharp-binder.so.*wearable
569 %endif
570 %endif
571
572 # If the profile is selected, the line below is repquired.
573 # if ivi ||"undefined"
574 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
575 %files profile_ivi
576 %manifest dali-csharp-binder.manifest
577 %defattr(-,root,root,-)
578 %if "%{?profile}" != "ivi"
579 %{_libdir}/libdali2-csharp-binder.so.*ivi
580 %endif
581 %endif
582
583 %files devel
584 %defattr(-,root,root,-)
585 %dir %{_includedir}/dali-csharp-binder/
586 %{_includedir}/dali-csharp-binder/*
587 %{_libdir}/pkgconfig/%{name}.pc
588