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