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