Make a gcov package for measuring coverage easier
[platform/core/api/camera.git] / packaging / capi-media-camera.spec
1 Name:       capi-media-camera
2 Summary:    A Camera API
3 Version:    0.4.25
4 Release:    1
5 Group:      Multimedia/API
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 BuildRequires:  cmake
9 BuildRequires:  pkgconfig(dlog)
10 BuildRequires:  pkgconfig(glib-2.0)
11 BuildRequires:  pkgconfig(gio-2.0)
12 BuildRequires:  pkgconfig(muse-client)
13 BuildRequires:  pkgconfig(mm-common)
14 BuildRequires:  pkgconfig(mm-display-interface)
15 BuildRequires:  pkgconfig(capi-base-common)
16 BuildRequires:  pkgconfig(mmsvc-camera)
17 BuildRequires:  pkgconfig(capi-media-tool)
18 BuildRequires:  pkgconfig(libtbm)
19 BuildRequires:  pkgconfig(appcore-efl)
20 BuildRequires:  pkgconfig(elementary)
21 BuildRequires:  pkgconfig(ecore)
22 BuildRequires:  pkgconfig(evas)
23
24 Requires(post): /sbin/ldconfig
25 Requires(postun): /sbin/ldconfig
26
27 %description
28 A Camera library in Tizen Native API.
29
30
31 %package devel
32 Summary:  A Camera API (Development)
33 Requires: %{name} = %{version}-%{release}
34 Requires: pkgconfig(libtbm)
35 Requires: pkgconfig(capi-media-tool)
36
37 %description devel
38 Development related files for a Camera library in Tizen Native API.
39
40
41 %package tool
42 Summary:  A Camera API testsuite
43 Requires: %{name} = %{version}-%{release}
44
45 %description tool
46 Tizen Native camera API testsuite.
47
48 %if 0%{?gcov:1}
49 %package gcov
50 Summary: Line Coverage of Camera library in Tizen Native API
51 Group: Development/Multimedia
52
53 %description gcov
54 Collection of files related to Line Coverage. It is teseted as gcov for a camera library in Tizen native API
55 %endif
56
57
58 %prep
59 %setup -q
60
61
62 %build
63 %if 0%{?sec_build_binary_debug_enable}
64 export CFLAGS+=" -DTIZEN_DEBUG_ENABLE"
65 %endif
66 %if 0%{?gcov:1}
67 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
68 export LDFLAGS+=" -lgcov"
69 %endif
70 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
71 %cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
72
73 make %{?jobs:-j%jobs}
74
75 %if 0%{?gcov:1}
76 mkdir -p gcov-obj
77 find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
78 %endif
79
80 %install
81 rm -rf %{buildroot}
82 %make_install
83
84 %if 0%{?gcov:1}
85 mkdir -p %{buildroot}%{_datadir}/gcov/obj
86 install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
87 %endif
88
89 %post -p /sbin/ldconfig
90
91
92 %postun -p /sbin/ldconfig
93
94
95 %files
96 %manifest capi-media-camera.manifest
97 %license LICENSE.APLv2
98 %{_libdir}/libcapi-media-camera.so.*
99
100 %files devel
101 %{_includedir}/media/camera.h
102 %{_includedir}/media/camera_internal.h
103 %{_libdir}/pkgconfig/*.pc
104 %{_libdir}/libcapi-media-camera.so
105
106 %files tool
107 %manifest capi-media-camera-tool.manifest
108 %license LICENSE.APLv2
109 %{_bindir}/*
110
111 %if 0%{?gcov:1}
112 %files gcov
113 %{_datadir}/gcov/obj/*
114 %endif
115