sensord: hal: splite sensor_hal.h into sensor_hal interface and hal
[platform/core/system/sensord.git] / packaging / sensord.spec
1 Name:       sensord
2 Summary:    Sensor daemon
3 Version:    2.0.3
4 Release:    0
5 Group:      System/Sensor Framework
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1:    sensord.service
9 Source2:    sensord_command.socket
10 Source3:    sensord_event.socket
11
12
13 BuildRequires:  cmake
14 BuildRequires:  libattr-devel
15 BuildRequires:  pkgconfig(dlog)
16 BuildRequires:  pkgconfig(libxml-2.0)
17 BuildRequires:  pkgconfig(glib-2.0)
18 BuildRequires:  pkgconfig(vconf)
19 BuildRequires:  pkgconfig(libsystemd-daemon)
20 BuildRequires:  pkgconfig(capi-system-info)
21 BuildRequires:  pkgconfig(cynara-creds-socket)
22 BuildRequires:  pkgconfig(cynara-client)
23 BuildRequires:  pkgconfig(cynara-session)
24 Requires:   libsensord = %{version}-%{release}
25
26 %define auto_rotation_state ON
27 %define orientation_state OFF
28 %define gravity_state OFF
29 %define linear_accel_state OFF
30 %define rv_state OFF
31 %define geomagnetic_rv_state OFF
32 %define gaming_rv_state OFF
33 %define tilt_state OFF
34 %define gyroscope_uncal_state OFF
35 %define build_test_suite ON
36
37 %description
38 Sensor daemon
39
40 %package -n libsensord
41 Summary:    Sensord library
42 Group:      System/Libraries
43 Requires:   %{name} = %{version}-%{release}
44
45 %description -n libsensord
46 Sensord library
47
48 %package -n libsensord-devel
49 Summary:    Sensord shared library
50 Group:      System/Development
51 Requires:   libsensord = %{version}-%{release}
52
53 %description -n libsensord-devel
54 Sensord shared library
55
56 %package -n sensor-hal-devel
57 Summary:    Sensord HAL interface
58 Group:      System/Development
59
60 %description -n sensor-hal-devel
61 Sensord HAL interface
62
63 %if %{build_test_suite} == "ON"
64 %package -n sensor-test
65 Summary:    Sensord library
66 Group:      System/Testing
67
68 %description -n sensor-test
69 Sensor functional testing
70
71 %endif
72
73 %prep
74 %setup -q
75
76 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
77
78 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DMAJORVER=${MAJORVER} -DFULLVER=%{version} \
79         -DORIENTATION=%{orientation_state} -DGRAVITY=%{gravity_state} \
80         -DLINEAR_ACCEL=%{linear_accel_state} -DRV=%{rv_state} \
81         -DGEOMAGNETIC_RV=%{geomagnetic_rv_state} -DGAMING_RV=%{gaming_rv_state} \
82         -DGYROSCOPE_UNCAL=%{gyroscope_uncal_state} -DAUTO_ROTATION=%{auto_rotation_state} \
83         -DTILT=%{tilt_state} -DTEST_SUITE=%{build_test_suite}
84
85 %build
86 make %{?jobs:-j%jobs}
87
88 %install
89 rm -rf %{buildroot}
90 %make_install
91
92 mkdir -p %{buildroot}%{_unitdir}
93
94 install -m 0644 %SOURCE1 %{buildroot}%{_unitdir}
95 install -m 0644 %SOURCE2 %{buildroot}%{_unitdir}
96 install -m 0644 %SOURCE3 %{buildroot}%{_unitdir}
97
98 %install_service multi-user.target.wants sensord.service
99 %install_service sockets.target.wants sensord_event.socket
100 %install_service sockets.target.wants sensord_command.socket
101
102 %post
103 systemctl daemon-reload
104
105 %postun
106 systemctl daemon-reload
107
108 %post -n libsensord
109 ln -sf %{_libdir}/libsensor.so.%{version} %{_libdir}/libsensor.so.1
110 /sbin/ldconfig
111
112 %postun -n libsensord
113 /sbin/ldconfig
114
115 %files
116 %attr(0644,root,root)/usr/etc/virtual_sensors.xml
117 %manifest packaging/sensord.manifest
118 %{_bindir}/sensord
119 %{_unitdir}/sensord.service
120 %{_unitdir}/sensord_command.socket
121 %{_unitdir}/sensord_event.socket
122 %{_unitdir}/multi-user.target.wants/sensord.service
123 %{_unitdir}/sockets.target.wants/sensord_command.socket
124 %{_unitdir}/sockets.target.wants/sensord_event.socket
125 %license LICENSE.APLv2
126
127 %files -n libsensord
128 %defattr(-,root,root,-)
129 %manifest packaging/libsensord.manifest
130 %{_libdir}/libsensor.so.*
131 %{_libdir}/libsensord-shared.so
132 %license LICENSE.APLv2
133
134 %files -n libsensord-devel
135 %defattr(-,root,root,-)
136 %{_includedir}/sensor/*.h
137 %{_libdir}/libsensor.so
138 %{_libdir}/pkgconfig/sensor.pc
139 %license LICENSE.APLv2
140
141 %files -n sensor-hal-devel
142 %defattr(-,root,root,-)
143 %{_includedir}/sensor/sensor_hal.h
144 %{_includedir}/sensor/sensor_hal_types.h
145 %license LICENSE.APLv2
146
147 %if %{build_test_suite} == "ON"
148 %files -n sensor-test
149 %defattr(-,root,root,-)
150 %{_bindir}/api-test
151 %{_bindir}/sensor-test
152 %{_bindir}/multi-thread-performance-test
153 %{_bindir}/multi-process-performance-test
154 %{_bindir}/fusion-data-collection
155 %license LICENSE.APLv2
156 %endif