5 Group: System/Sensor Framework
7 Source0: %{name}-%{version}.tar.gz
8 Source1: sensord.service
9 Source2: sensord_command.socket
10 Source3: sensord_event.socket
11 Source4: 99-sensor.rules
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}
26 %define auto_rotation_state ON
27 %define orientation_state OFF
28 %define gravity_state OFF
29 %define linear_accel_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
40 %package -n libsensord
41 Summary: Sensord library
42 Group: System/Libraries
43 Requires: %{name} = %{version}-%{release}
45 %description -n libsensord
48 %package -n libsensord-devel
49 Summary: Sensord shared library
50 Group: System/Development
51 Requires: libsensord = %{version}-%{release}
53 %description -n libsensord-devel
54 Sensord shared library
56 %package -n sensor-hal-devel
57 Summary: Sensord HAL interface
58 Group: System/Development
60 %description -n sensor-hal-devel
63 %if %{build_test_suite} == "ON"
64 %package -n sensor-test
65 Summary: Sensord library
68 %description -n sensor-test
69 Sensor functional testing
76 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
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}
92 mkdir -p %{buildroot}%{_unitdir}
93 mkdir -p %{buildroot}%{_libdir}/udev/rules.d
95 install -m 0644 %SOURCE1 %{buildroot}%{_unitdir}
96 install -m 0644 %SOURCE2 %{buildroot}%{_unitdir}
97 install -m 0644 %SOURCE3 %{buildroot}%{_unitdir}
98 install -m 0644 %SOURCE4 %{buildroot}%{_libdir}/udev/rules.d
100 %install_service multi-user.target.wants sensord.service
101 %install_service sockets.target.wants sensord_event.socket
102 %install_service sockets.target.wants sensord_command.socket
105 systemctl daemon-reload
108 systemctl daemon-reload
111 ln -sf %{_libdir}/libsensor.so.%{version} %{_libdir}/libsensor.so.1
114 %postun -n libsensord
118 %manifest packaging/sensord.manifest
120 %{_unitdir}/sensord.service
121 %{_unitdir}/sensord_command.socket
122 %{_unitdir}/sensord_event.socket
123 %{_unitdir}/multi-user.target.wants/sensord.service
124 %{_unitdir}/sockets.target.wants/sensord_command.socket
125 %{_unitdir}/sockets.target.wants/sensord_event.socket
126 %{_libdir}/udev/rules.d/99-sensor.rules
127 %license LICENSE.APLv2
130 %defattr(-,root,root,-)
131 %manifest packaging/libsensord.manifest
132 %{_libdir}/libsensor.so.*
133 %{_libdir}/libsensord-shared.so
134 %license LICENSE.APLv2
136 %files -n libsensord-devel
137 %defattr(-,root,root,-)
138 %{_includedir}/sensor/*.h
139 %{_libdir}/libsensor.so
140 %{_libdir}/pkgconfig/sensor.pc
141 %license LICENSE.APLv2
143 %files -n sensor-hal-devel
144 %defattr(-,root,root,-)
145 %{_includedir}/sensor/sensor_hal.h
146 %{_includedir}/sensor/sensor_hal_types.h
147 %license LICENSE.APLv2
149 %if %{build_test_suite} == "ON"
150 %files -n sensor-test
151 %defattr(-,root,root,-)
153 %{_bindir}/sensor-test
154 %{_bindir}/multi-thread-performance-test
155 %{_bindir}/multi-process-performance-test
156 %{_bindir}/fusion-data-collection
157 %license LICENSE.APLv2