Fix build error in 64bit environment
[platform/core/api/sensor.git] / packaging / capi-system-sensor.spec
1 Name:       capi-system-sensor
2 Summary:    A Sensor library in TIZEN C API
3 Version:    0.2.5
4 Release:    1
5 Group:      System/API
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8
9 %if "%{?profile}" != "tv"
10 %define SENSOR_RECORDER on
11 %else
12 %define SENSOR_RECORDER off
13 %endif
14
15 BuildRequires:  cmake
16 BuildRequires:  pkgconfig(dlog)
17 BuildRequires:  pkgconfig(sensor)
18 BuildRequires:  pkgconfig(capi-base-common)
19 BuildRequires:  pkgconfig(hal-api-sensor)
20 %if "%{?SENSOR_RECORDER}" == "on"
21 BuildRequires:  pkgconfig(context-sensor-recorder-client)
22 %endif
23 Requires(post): /sbin/ldconfig
24 Requires(postun): /sbin/ldconfig
25
26 Provides: %{name}-profile_common = %{version}-%{release}
27 Provides: %{name}-profile_mobile = %{version}-%{release}
28 Provides: %{name}-profile_wearable = %{version}-%{release}
29 Provides: %{name}-profile_tv = %{version}-%{release}
30 Provides: %{name}-profile_ivi = %{version}-%{release}
31
32 %description
33 A Sensor Library in TIZEN C API package.
34
35 %package devel
36 Summary:  A Sensor library in TIZEN C API (Development)
37 Group:    System/Development
38 Requires: %{name} = %{version}-%{release}
39
40 %description devel
41 A Sensor library in TIZEN C API package (Development).
42 %devel_desc
43
44 %package test
45 Summary:    Tizen Sensor Test Programs (test)
46 Group:      System & System Tools/Testing
47 Requires:   %{name} = %{version}-%{release}
48
49 %description test
50 Tizen Sensor Test Programs (test)
51
52 %package tools
53 Summary:  Sensor command line tool package
54 Group:    System & System Tools
55 Requires: %{name} = %{version}-%{release}
56
57 %description tools
58 Sensor command line tools
59
60 %if 0%{?gcov:1}
61 %package gcov
62 Summary:    Tizen Sensor Library API (gcov)
63 Group:      Service Framework/Testing
64
65 %description gcov
66 gcov objects for coverage test
67 %endif
68
69 %prep
70 %setup -q
71
72 %build
73 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
74
75 %if 0%{?gcov:1}
76 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
77 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
78 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
79 export LDFLAGS+=" -lgcov"
80 %endif
81
82 %cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DSENSOR_RECORDER=%{SENSOR_RECORDER}
83 %__make %{?_smp_mflags}
84 %if 0%{?gcov:1}
85 mkdir -p gcov-obj
86 find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
87 %endif
88
89 %install
90 %make_install
91
92 %if 0%{?gcov:1}
93 mkdir -p %{buildroot}%{_datadir}/gcov/obj/%{name}
94 install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj/%{name}
95 %endif
96
97 %post -p /sbin/ldconfig
98
99 %postun -p /sbin/ldconfig
100
101 %files
102 %manifest packaging/capi-system-sensor.manifest
103 %{_libdir}/libcapi-system-sensor.so.*
104 %license LICENSE.APLv2
105
106 %files devel
107 %manifest packaging/capi-system-sensor.manifest
108 %{_libdir}/pkgconfig/*.pc
109 %{_includedir}/sensor/*.h
110 %{_libdir}/libcapi-system-sensor.so
111
112 %files test
113 %manifest packaging/capi-system-sensor.manifest
114 %defattr(-,root,root,-)
115 %{_bindir}/sensor-test
116
117 %files tools
118 %{_bindir}/sensor-tool
119
120 %if 0%{?gcov:1}
121 %files gcov
122 %{_datadir}/gcov/obj/*
123 %endif