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