sensor-plugin-tm1: plugins for tm1
[platform/adaptation/tm1/sensor-hal-tm1.git] / packaging / sensor-hal.spec
1 Name:       sensor-hal
2 Summary:    Sensor HAL Plugins
3 Version:    1.0.0
4 Release:    0
5 Group:      System/Sensor HAL
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1:    sensor-hal.manifest
9
10 BuildRequires:  cmake
11 BuildRequires:  pkgconfig(dlog)
12 BuildRequires:  pkgconfig(libxml-2.0)
13
14 %define accel_state ON
15 %define gyro_state OFF
16 %define proxi_state ON
17 %define light_state OFF
18 %define geo_state OFF
19 %define pressure_state OFF
20 %define temperature_state OFF
21 %define ultraviolet_state OFF
22 %define rv_state OFF
23 %define bio_led_red_state OFF
24
25 %description
26 Sensor HAL Plugins
27
28 %package sensor-hal
29 Summary:    Sensor HAL Plugins
30 Group:      System/Sensor Framework
31 Requires:   %{name} = %{version}-%{release}
32
33 %description sensor-hal
34 Sensor HAL Plugins
35
36 %prep
37 %setup -q
38 cp %{SOURCE1} .
39
40 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DACCEL=%{accel_state} \
41 -DGYRO=%{gyro_state} -DPROXI=%{proxi_state} -DLIGHT=%{light_state} \
42 -DGEO=%{geo_state} -DPRESSURE=%{pressure_state} -DTEMPERATURE=%{temperature_state} \
43 -DRV=%{rv_state} -DULTRAVIOLET=%{ultraviolet_state} \
44 -DBIO_LED_RED=%{bio_led_red_state} \
45 -DLIBDIR=%{_libdir} -DINCLUDEDIR=%{_includedir}
46
47 %build
48 make %{?jobs:-j%jobs}
49
50 %install
51 rm -rf %{buildroot}
52 %make_install
53
54 %post -n sensor-hal -p /sbin/ldconfig
55
56 %postun -n sensor-hal -p /sbin/ldconfig
57
58 %files -n sensor-hal
59 %manifest sensor-hal.manifest
60 %attr(0644,root,root)/usr/etc/sensors.xml
61 %{_libdir}/sensor-hal/libsensor-hal.so