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