DALi Version 2.0.34
[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.0.34
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: pkgconfig(dali2-core)
46 BuildRequires: pkgconfig(dali2-adaptor)
47 BuildRequires: pkgconfig(dali2-toolkit)
48 BuildRequires: pkgconfig(dali2-extension)
49 BuildRequires: pkgconfig(widget_viewer_dali)
50 BuildRequires: pkgconfig(watch_viewer_dali)
51 BuildRequires: pkgconfig(watch-holder-base)
52
53 %if 0%{?tizen_version_major} >= 5
54 BuildRequires: pkgconfig(ecore-wl2)
55 %else
56 BuildRequires:  pkgconfig(ecore-wayland)
57 %endif
58
59 # for multiprofile
60 Requires:   %{name}-compat = %{version}-%{release}
61 Recommends: %{name}-profile_common = %{version}-%{release}
62
63 %description
64 dali-csharp-binder
65
66 ###########################################
67 # Dali csharp binder for profiles
68 ###########################################
69
70 # If the profile is selected, the line below is repquired.
71 # if mobile || "undefined"
72 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
73 %package profile_mobile
74 Summary:        The DALi Tizen csharp binder for mobile
75 Provides:       %{name}-compat = %{version}-%{release}
76 Conflicts:      %{name}-profile_tv
77 Conflicts:      %{name}-profile_wearable
78 Conflicts:      %{name}-profile_ivi
79 Conflicts:      %{name}-profile_common
80 %description profile_mobile
81 The DALi Tizen csharp binder for mobile.
82 %endif
83
84 # If the profile is selected, the line below is repquired.
85 # if tv ||"undefined"
86 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
87 %package profile_tv
88 Summary:        The DALi Tizen csharp binder for tv
89 Provides:       %{name}-compat = %{version}-%{release}
90 Conflicts:      %{name}-profile_mobile
91 Conflicts:      %{name}-profile_wearable
92 Conflicts:      %{name}-profile_ivi
93 Conflicts:      %{name}-profile_common
94 %description profile_tv
95 The DALi Tizen csharp binder for tv.
96 %endif
97
98 # If the profile is selected, the line below is repquired.
99 # if wearable || "undefined"
100 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
101 %package profile_wearable
102 Summary:        The DALi Tizen csharp binder for wearable
103 Provides:       %{name}-compat = %{version}-%{release}
104 Conflicts:      %{name}-profile_mobile
105 Conflicts:      %{name}-profile_tv
106 Conflicts:      %{name}-profile_ivi
107 Conflicts:      %{name}-profile_common
108 %description profile_wearable
109 The DALi Tizen csharp binder for wearable.
110 %endif
111
112 # If the profile is selected, the line below is repquired.
113 # if ivi ||"undefined"
114 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
115 %package profile_ivi
116 Summary:        The DALi Tizen csharp binder for ivi
117 Provides:       %{name}-compat = %{version}-%{release}
118 Conflicts:      %{name}-profile_mobile
119 Conflicts:      %{name}-profile_wearable
120 Conflicts:      %{name}-profile_tv
121 Conflicts:      %{name}-profile_common
122 %description profile_ivi
123 The DALi Tizen csharp binder for ivi.
124 %endif
125
126 # If the profile is selected, the line below is repquired.
127 # if common ||"undefined"
128 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
129 # Currently Tizen Common we use does not have wayland extensions like xdg-shell
130 %package profile_common
131 %define tizen_2_2_compatibility 0
132 Summary:        The DALi Tizen csharp binder for common
133 Provides:       %{name}-compat = %{version}-%{release}
134 Conflicts:      %{name}-profile_mobile
135 Conflicts:      %{name}-profile_wearable
136 Conflicts:      %{name}-profile_tv
137 Conflicts:      %{name}-profile_ivi
138 %description profile_common
139 The DALi Tizen csharp binder for common.
140 %endif
141
142
143 ##############################
144 # devel
145 ##############################
146 %package devel
147 Summary: build dali csharp binder
148 Group: Development/Building
149 Requires: %{name} = %{version}-%{release}
150
151 %description devel
152 This package includes developer files common to all packages.
153
154 ##############################
155 # Preparation
156 ##############################
157 %prep
158 %setup -q
159
160 %define dali_data_rw_dir         %TZ_SYS_RO_SHARE/dali/
161 %define dali_data_ro_dir         %TZ_SYS_RO_SHARE/dali/
162
163 ##############################
164 # Build
165 ##############################
166 %build
167 PREFIX+="/usr"
168 CXXFLAGS+=" -Wall -g -Os -fPIC"
169 LDFLAGS+=" -Wl,--rpath=%{_libdir} "
170
171 %if %{with wayland}
172 CFLAGS+=" -DWAYLAND"
173 CXXFLAGS+=" -DWAYLAND"
174 configure_flags="--enable-wayland"
175
176 # Need Ecore-Wayland2 when Tizen version is 5.x or greater
177 %if 0%{?tizen_version_major} >= 5
178 CFLAGS+=" -DECORE_WL2 -DEFL_BETA_API_SUPPORT"
179 CXXFLAGS+=" -DECORE_WL2 -DEFL_BETA_API_SUPPORT"
180 configure_flags+=" --enable-ecore-wayland2"
181 %endif
182 %endif
183
184 # autogen
185 libtoolize --force
186 cd %{_builddir}/%{name}-%{version}/build/tizen
187 autoreconf --install
188
189 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
190 DALI_DATA_RO_DIR="%{dali_data_ro_dir}"  ; export DALI_DATA_RO_DIR
191 %if 0%{?tizen_platform_config_supported}
192 TIZEN_PLATFORM_CONFIG_SUPPORTED="%{tizen_platform_config_supported}" ; export TIZEN_PLATFORM_CONFIG_SUPPORTED
193 %endif
194
195 # added for key grab binding only for tizen
196 # Do not merge this on tizen branch!
197
198 # Set up the build via configure.
199 #######################################################################
200 # If the profile is selected, the line below is repquired.
201 # if mobile || "undefined"
202 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
203 %configure --prefix=$PREFIX --enable-profile=MOBILE \
204            --enable-tizen-major-version=%{tizen_version_major} \
205 %if 0%{?enable_debug}
206            --enable-debug \
207 %endif
208            $configure_flags --libdir=%{_libdir}
209
210 # Build.
211 make %{?jobs:-j%jobs}
212
213 pushd %{_builddir}/%{name}-%{version}/build/tizen
214 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
215 popd
216
217 pushd %{buildroot}%{_libdir}
218 for FILE in libdali2-csharp-binder*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.mobile"; done
219 mv pkgconfig/dali2-csharp-binder*pc %{_builddir}/%{name}-%{version}/build/tizen/
220 popd
221
222 make clean
223 %endif
224
225 #######################################################################
226 # If the profile is selected, the line below is repquired.
227 # if tv ||"undefined"
228 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
229 %configure --prefix=$PREFIX --enable-profile=TV \
230            --enable-tizen-major-version=%{tizen_version_major} \
231 %if 0%{?enable_debug}
232            --enable-debug \
233 %endif
234            $configure_flags --libdir=%{_libdir}
235
236 # Build.
237 make %{?jobs:-j%jobs}
238
239 pushd %{_builddir}/%{name}-%{version}/build/tizen
240 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
241 popd
242
243 pushd %{buildroot}%{_libdir}
244 for FILE in libdali2-csharp-binder*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.tv"; done
245 mv pkgconfig/dali2-csharp-binder*pc %{_builddir}/%{name}-%{version}/build/tizen/
246 popd
247
248 make clean
249 %endif
250
251 #######################################################################
252 # If the profile is selected, the line below is repquired.
253 # if wearable || "undefined"
254 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
255 %configure --prefix=$PREFIX --enable-profile=WEARABLE \
256            --enable-tizen-major-version=%{tizen_version_major} \
257 %if 0%{?enable_debug}
258            --enable-debug \
259 %endif
260            $configure_flags --libdir=%{_libdir}
261
262 # Build.
263 make %{?jobs:-j%jobs}
264
265 pushd %{_builddir}/%{name}-%{version}/build/tizen
266 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
267 popd
268
269 pushd %{buildroot}%{_libdir}
270 for FILE in libdali2-csharp-binder*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.wearable"; done
271 mv pkgconfig/dali2-csharp-binder*pc %{_builddir}/%{name}-%{version}/build/tizen/
272 popd
273
274 make clean
275 %endif
276
277 #######################################################################
278 # If the profile is selected, the line below is repquired.
279 # if ivi ||"undefined"
280 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
281 %configure --prefix=$PREFIX --enable-profile=IVI \
282            --enable-tizen-major-version=%{tizen_version_major} \
283 %if 0%{?enable_debug}
284            --enable-debug \
285 %endif
286            $configure_flags --libdir=%{_libdir}
287
288 # Build.
289 make %{?jobs:-j%jobs}
290
291 pushd %{_builddir}/%{name}-%{version}/build/tizen
292 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
293 popd
294
295 pushd %{buildroot}%{_libdir}
296 for FILE in libdali2-csharp-binder*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE.ivi"; done
297 mv pkgconfig/dali2-csharp-binder*pc %{_builddir}/%{name}-%{version}/build/tizen/
298 popd
299
300 make clean
301 %endif
302
303 #######################################################################
304 # common
305 # If the profile is selected, the line below is repquired.
306 # if common ||"undefined"
307 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
308 %configure --prefix=$PREFIX --enable-profile=COMMON \
309            --enable-tizen-major-version=%{tizen_version_major} \
310 %if 0%{?enable_debug}
311            --enable-debug \
312 %endif
313            $configure_flags --libdir=%{_libdir}
314
315 # Build.
316 make %{?jobs:-j%jobs}
317
318 pushd %{_builddir}/%{name}-%{version}/build/tizen
319 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
320 popd
321
322 pushd %{buildroot}%{_libdir}
323 for FILE in libdali2-csharp-binder*.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
324 mv pkgconfig/dali2-csharp-binder*pc %{_builddir}/%{name}-%{version}/build/tizen/
325 popd
326
327 make clean
328 %endif
329
330 ##############################
331 # Installation
332 ##############################
333 %install
334 rm -rf %{buildroot}
335
336 pushd %{_builddir}/%{name}-%{version}/build/tizen
337 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
338
339
340 # If the profile is selected, the line below is repquired.
341 # !unified && (wearable || tv || ivi || mobile)
342 %if "%{?profile}" == "wearable" || "%{?profile}" == "tv" || "%{?profile}" == "ivi" || "%{?profile}" == "mobile"
343 rm -rf %{buildroot}%{_libdir}/libdali2-csharp-binder*.so*
344 %endif
345
346 # If the profile is selected, the line below is repquired.
347 # wearable || tv || ivi || mobile || unified
348 %if "%{?profile}" != "common"
349 for FILE in libdali2-*.so*; do mv "$FILE" "%{buildroot}%{_libdir}/$FILE"; done
350 mv dali2-csharp-binder*.pc %{buildroot}%{_libdir}/pkgconfig/
351 %endif
352 popd
353
354 ################################################
355 #rename
356 ###############################################
357 pushd %{buildroot}%{_libdir}
358
359 # If the profile is selected, the line below is repquired.
360 # if common ||"undefined"
361 #%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
362 rm -rf libdali2-csharp-binder*.so
363 ln -s libdali2-csharp-binder.so.0.0.0 libdali2-csharp-binder.so
364 #%endif
365
366 # If the profile is selected, the line below is repquired.
367 # if wearable || "undefined"
368 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
369 rm -rf libdali2-csharp-binder*.so.wearable
370 ln -s libdali2-csharp-binder.so.0.0.*.wearable libdali2-csharp-binder.so.wearable
371 %endif
372
373 # If the profile is selected, the line below is repquired.
374 # if tv ||"undefined"
375 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
376 rm -rf libdali2-csharp-binder*.so.tv
377 ln -s libdali2-csharp-binder.so.0.0.*.tv libdali2-csharp-binder.so.tv
378 %endif
379
380 # If the profile is selected, the line below is repquired.
381 # if ivi ||"undefined"
382 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
383 rm -rf libdali2-csharp-binder*.so.ivi
384 ln -s libdali2-csharp-binder.so.0.0.*.ivi libdali2-csharp-binder.so.ivi
385 %endif
386
387 # If the profile is selected, the line below is repquired.
388 # if mobile || "undefined"
389 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
390 rm -rf libdali2-csharp-binder*.so.mobile
391 ln -s libdali2-csharp-binder.so.0.0.*.mobile libdali2-csharp-binder.so.mobile
392 %endif
393 popd
394
395 ##############################
396 # Upgrade order:
397 # 1 - Pre Install new package
398 # 2 - Install new package
399 # 3 - Post install new package
400 # 4 - Pre uninstall old package
401 # 5 - Remove files not overwritten by new package
402 # 6 - Post uninstall old package
403 ##############################
404
405 %pre
406 exit 0
407
408 ##############################
409 #  Post Install new package
410 ##############################
411 %post
412 /sbin/ldconfig
413 exit 0
414
415 ##############################
416 #  Pre Uninstall old package
417 ##############################
418 %preun
419 exit 0
420
421 ##############################
422 #  Post Uninstall old package
423 ##############################
424 %postun
425 /sbin/ldconfig
426 exit 0
427
428 ##############################
429
430 # If the profile is selected, the line below is repquired.
431 # if mobile || "undefined"
432 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
433 %post profile_mobile
434 pushd %{_libdir}
435 for FILE in libdali2-csharp-binder.so*.mobile; do ln -sf "$FILE" "${FILE%.mobile}"; done
436 popd
437 /sbin/ldconfig
438 exit 0
439
440 %postun profile_mobile
441 /sbin/ldconfig
442 exit 0
443 %endif
444
445 ##############################
446
447 # If the profile is selected, the line below is repquired.
448 # if tv ||"undefined"
449 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
450 %post profile_tv
451 pushd %{_libdir}
452 for FILE in libdali2-csharp-binder.so*.tv; do ln -sf "$FILE" "${FILE%.tv}"; done
453 popd
454 /sbin/ldconfig
455 exit 0
456
457 %postun profile_tv
458 /sbin/ldconfig
459 exit 0
460 %endif
461
462 ##############################
463
464 # If the profile is selected, the line below is repquired.
465 # if wearable || "undefined"
466 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
467 %post profile_wearable
468 pushd %{_libdir}
469 for FILE in libdali2-csharp-binder.so*.wearable; do ln -sf "$FILE" "${FILE%.wearable}"; done
470 popd
471 /sbin/ldconfig
472 exit 0
473
474 %postun profile_wearable
475 /sbin/ldconfig
476 exit 0
477 %endif
478
479 ##############################
480
481 # If the profile is selected, the line below is repquired.
482 # if ivi ||"undefined"
483 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
484 %post profile_ivi
485 pushd %{_libdir}
486 for FILE in libdali2-csharp-binder.so*.ivi; do ln -sf "$FILE" "${FILE%.ivi}"; done
487 popd
488 /sbin/ldconfig
489 exit 0
490
491 %postun profile_ivi
492 /sbin/ldconfig
493 exit 0
494 %endif
495
496
497 ##############################
498 # Files in Binary Packages
499 ##############################
500 %files
501 %manifest dali-csharp-binder.manifest
502 %defattr(-,root,root,-)
503 %license LICENSE
504
505 # If the profile is selected, the line below is repquired.
506 # if common ||"undefined"
507 #%if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
508 %defattr(-,root,root,-)
509 %{_libdir}/libdali2-csharp-binder.so*
510 %exclude %{_libdir}/libdali2-csharp-binder*.so*.mobile
511 %exclude %{_libdir}/libdali2-csharp-binder*.so*.wearable
512 %exclude %{_libdir}/libdali2-csharp-binder*.so*.tv
513 %exclude %{_libdir}/libdali2-csharp-binder*.so*.ivi
514 #%endif
515
516 # If the profile is selected, the line below is repquired.
517 # if common ||"undefined"
518 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
519 %files profile_common
520 # default .so files are housed in the main pkg.
521 %endif
522
523 # If the profile is selected, the line below is repquired.
524 # if mobile || "undefined"
525 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
526 %files profile_mobile
527 %manifest dali-csharp-binder.manifest
528 %defattr(-,root,root,-)
529 %{_libdir}/libdali2-csharp-binder.so.*mobile
530 %endif
531
532 # If the profile is selected, the line below is repquired.
533 # if tv ||"undefined"
534 %if "%{?profile}" != "wearable" && "%{?profile}" != "common" && "%{?profile}" != "ivi" && "%{?profile}" != "mobile"
535 %files profile_tv
536 %manifest dali-csharp-binder.manifest
537 %defattr(-,root,root,-)
538 %{_libdir}/libdali2-csharp-binder.so.*tv
539 %endif
540
541 # If the profile is selected, the line below is repquired.
542 # if wearable || "undefined"
543 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "ivi" && "%{?profile}" != "common"
544 %files profile_wearable
545 %manifest dali-csharp-binder.manifest
546 %defattr(-,root,root,-)
547 %{_libdir}/libdali2-csharp-binder.so.*wearable
548 %endif
549
550 # If the profile is selected, the line below is repquired.
551 # if ivi ||"undefined"
552 %if "%{?profile}" != "wearable" && "%{?profile}" != "tv" && "%{?profile}" != "common" && "%{?profile}" != "mobile"
553 %files profile_ivi
554 %manifest dali-csharp-binder.manifest
555 %defattr(-,root,root,-)
556 %{_libdir}/libdali2-csharp-binder.so.*ivi
557 %endif
558
559 %files devel
560 %defattr(-,root,root,-)
561 %dir %{_includedir}/dali-csharp-binder/
562 %{_includedir}/dali-csharp-binder/*
563 %{_libdir}/pkgconfig/%{name}.pc
564