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