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