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