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