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