sensord: change group of sensord from sensor to input
[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 Source4:    99-sensor.rules
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 mkdir -p %{buildroot}%{_libdir}/udev/rules.d
94
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
99
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
103
104 %post
105 systemctl daemon-reload
106
107 %postun
108 systemctl daemon-reload
109
110 %post -n libsensord
111 ln -sf %{_libdir}/libsensor.so.%{version} %{_libdir}/libsensor.so.1
112 /sbin/ldconfig
113
114 %postun -n libsensord
115 /sbin/ldconfig
116
117 %files
118 %attr(0644,root,root)/usr/etc/virtual_sensors.xml
119 %manifest packaging/sensord.manifest
120 %{_bindir}/sensord
121 %{_unitdir}/sensord.service
122 %{_unitdir}/sensord_command.socket
123 %{_unitdir}/sensord_event.socket
124 %{_unitdir}/multi-user.target.wants/sensord.service
125 %{_unitdir}/sockets.target.wants/sensord_command.socket
126 %{_unitdir}/sockets.target.wants/sensord_event.socket
127 %{_libdir}/udev/rules.d/99-sensor.rules
128 %license LICENSE.APLv2
129
130 %files -n libsensord
131 %defattr(-,root,root,-)
132 %manifest packaging/libsensord.manifest
133 %{_libdir}/libsensor.so.*
134 %{_libdir}/libsensord-shared.so
135 %license LICENSE.APLv2
136
137 %files -n libsensord-devel
138 %defattr(-,root,root,-)
139 %{_includedir}/sensor/*.h
140 %{_libdir}/libsensor.so
141 %{_libdir}/pkgconfig/sensor.pc
142 %license LICENSE.APLv2
143
144 %files -n sensor-hal-devel
145 %defattr(-,root,root,-)
146 %{_includedir}/sensor/sensor_hal.h
147 %{_includedir}/sensor/sensor_hal_types.h
148 %license LICENSE.APLv2
149
150 %if %{build_test_suite} == "ON"
151 %files -n sensor-test
152 %defattr(-,root,root,-)
153 %{_bindir}/api-test
154 %{_bindir}/sensor-test
155 %{_bindir}/multi-thread-performance-test
156 %{_bindir}/multi-process-performance-test
157 %{_bindir}/fusion-data-collection
158 %license LICENSE.APLv2
159 %endif