sensord: add sensorctl instead of original sensor-test
[platform/core/system/sensord.git] / packaging / sensord.spec
1 Name:       sensord
2 Summary:    Sensor daemon
3 Version:    2.0.8
4 Release:    0
5 Group:      System/Sensor Framework
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1:    sensord.service
9 Source2:    sensord_command.socket
10 Source3:    sensord_event.socket
11
12 BuildRequires:  cmake
13 BuildRequires:  libattr-devel
14 BuildRequires:  pkgconfig(dlog)
15 BuildRequires:  pkgconfig(glib-2.0)
16 BuildRequires:  pkgconfig(vconf)
17 BuildRequires:  pkgconfig(libsystemd-daemon)
18 BuildRequires:  pkgconfig(cynara-creds-socket)
19 BuildRequires:  pkgconfig(cynara-client)
20 BuildRequires:  pkgconfig(cynara-session)
21 Requires:   libsensord = %{version}-%{release}
22
23 %description
24 Sensor daemon
25
26 %package -n libsensord
27 Summary:    Sensord library
28 Group:      System/Libraries
29 Requires:   %{name} = %{version}-%{release}
30
31 %description -n libsensord
32 Sensord library
33
34 %package -n libsensord-devel
35 Summary:    Sensord shared library
36 Group:      System/Development
37 Requires:   libsensord = %{version}-%{release}
38
39 %description -n libsensord-devel
40 Sensord shared library
41
42 %package -n sensor-hal-devel
43 Summary:    Sensord HAL interface
44 Group:      System/Development
45
46 %description -n sensor-hal-devel
47 Sensord HAL interface
48
49 %package -n sensor-test
50 Summary:    Sensord library
51 Group:      System/Testing
52
53 %description -n sensor-test
54 Sensor functional testing
55
56 %prep
57 %setup -q
58 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
59
60 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DLIBDIR=%{_libdir} \
61         -DMAJORVER=${MAJORVER} -DFULLVER=%{version}
62
63 %build
64 make %{?jobs:-j%jobs}
65
66 %install
67 rm -rf %{buildroot}
68 %make_install
69
70 mkdir -p %{buildroot}%{_unitdir}
71
72 install -m 0644 %SOURCE1 %{buildroot}%{_unitdir}
73 install -m 0644 %SOURCE2 %{buildroot}%{_unitdir}
74 install -m 0644 %SOURCE3 %{buildroot}%{_unitdir}
75
76 %install_service multi-user.target.wants sensord.service
77 %install_service sockets.target.wants sensord_event.socket
78 %install_service sockets.target.wants sensord_command.socket
79
80 %post
81 systemctl daemon-reload
82
83 %postun
84 systemctl daemon-reload
85
86 %post -n libsensord
87 ln -sf %{_libdir}/libsensor.so.%{version} %{_libdir}/libsensor.so.1
88 /sbin/ldconfig
89
90 %postun -n libsensord
91 /sbin/ldconfig
92
93 %files
94 %manifest packaging/sensord.manifest
95 %{_bindir}/sensord
96 %{_unitdir}/sensord.service
97 %{_unitdir}/sensord_command.socket
98 %{_unitdir}/sensord_event.socket
99 %{_unitdir}/multi-user.target.wants/sensord.service
100 %{_unitdir}/sockets.target.wants/sensord_command.socket
101 %{_unitdir}/sockets.target.wants/sensord_event.socket
102 %license LICENSE.APLv2
103
104 %files -n libsensord
105 %defattr(-,root,root,-)
106 %manifest packaging/libsensord.manifest
107 %{_libdir}/libsensor.so.*
108 %{_libdir}/libsensord-shared.so
109 %license LICENSE.APLv2
110
111 %files -n libsensord-devel
112 %defattr(-,root,root,-)
113 %{_includedir}/sensor/*.h
114 %{_libdir}/libsensor.so
115 %{_libdir}/pkgconfig/sensor.pc
116 %license LICENSE.APLv2
117
118 %files -n sensor-hal-devel
119 %defattr(-,root,root,-)
120 %{_includedir}/sensor/sensor_hal.h
121 %{_includedir}/sensor/sensor_hal_types.h
122 %license LICENSE.APLv2
123
124 %files -n sensor-test
125 %defattr(-,root,root,-)
126 %{_bindir}/sensorctl
127 %license LICENSE.APLv2