e743bc96dff8c6728615ade29f9b77bd8df79987
[platform/core/system/sensord.git] / packaging / sensord.spec
1 Name:       sensord
2 Summary:    Sensor daemon
3 Version:    2.0.5
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(libxml-2.0)
16 BuildRequires:  pkgconfig(glib-2.0)
17 BuildRequires:  pkgconfig(vconf)
18 BuildRequires:  pkgconfig(libsystemd-daemon)
19 BuildRequires:  pkgconfig(cynara-creds-socket)
20 BuildRequires:  pkgconfig(cynara-client)
21 BuildRequires:  pkgconfig(cynara-session)
22 Requires:   libsensord = %{version}-%{release}
23
24 %ifarch %{ix86} x86_64
25 %define BUILD_ARCH EMULATOR
26 %endif
27
28 %description
29 Sensor daemon
30
31 %package -n libsensord
32 Summary:    Sensord library
33 Group:      System/Libraries
34 Requires:   %{name} = %{version}-%{release}
35
36 %description -n libsensord
37 Sensord library
38
39 %package -n libsensord-devel
40 Summary:    Sensord shared library
41 Group:      System/Development
42 Requires:   libsensord = %{version}-%{release}
43
44 %description -n libsensord-devel
45 Sensord shared library
46
47 %package -n sensor-hal-devel
48 Summary:    Sensord HAL interface
49 Group:      System/Development
50
51 %description -n sensor-hal-devel
52 Sensord HAL interface
53
54 %package -n sensor-test
55 Summary:    Sensord library
56 Group:      System/Testing
57
58 %description -n sensor-test
59 Sensor functional testing
60
61 %prep
62 %setup -q
63 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
64
65 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DMAJORVER=${MAJORVER} -DFULLVER=%{version} \
66         -DARCH=%{BUILD_ARCH}
67
68 %build
69 make %{?jobs:-j%jobs}
70
71 %install
72 rm -rf %{buildroot}
73 %make_install
74
75 mkdir -p %{buildroot}%{_unitdir}
76
77 install -m 0644 %SOURCE1 %{buildroot}%{_unitdir}
78 install -m 0644 %SOURCE2 %{buildroot}%{_unitdir}
79 install -m 0644 %SOURCE3 %{buildroot}%{_unitdir}
80
81 %install_service multi-user.target.wants sensord.service
82 %install_service sockets.target.wants sensord_event.socket
83 %install_service sockets.target.wants sensord_command.socket
84
85 %post
86 systemctl daemon-reload
87
88 %postun
89 systemctl daemon-reload
90
91 %post -n libsensord
92 ln -sf %{_libdir}/libsensor.so.%{version} %{_libdir}/libsensor.so.1
93 /sbin/ldconfig
94
95 %postun -n libsensord
96 /sbin/ldconfig
97
98 %files
99 %manifest packaging/sensord.manifest
100 %{_bindir}/sensord
101 %{_unitdir}/sensord.service
102 %{_unitdir}/sensord_command.socket
103 %{_unitdir}/sensord_event.socket
104 %{_unitdir}/multi-user.target.wants/sensord.service
105 %{_unitdir}/sockets.target.wants/sensord_command.socket
106 %{_unitdir}/sockets.target.wants/sensord_event.socket
107 %license LICENSE.APLv2
108
109 %files -n libsensord
110 %defattr(-,root,root,-)
111 %manifest packaging/libsensord.manifest
112 %{_libdir}/libsensor.so.*
113 %{_libdir}/libsensord-shared.so
114 %license LICENSE.APLv2
115
116 %files -n libsensord-devel
117 %defattr(-,root,root,-)
118 %{_includedir}/sensor/*.h
119 %{_libdir}/libsensor.so
120 %{_libdir}/pkgconfig/sensor.pc
121 %license LICENSE.APLv2
122
123 %files -n sensor-hal-devel
124 %defattr(-,root,root,-)
125 %{_includedir}/sensor/sensor_hal.h
126 %{_includedir}/sensor/sensor_hal_types.h
127 %license LICENSE.APLv2
128
129 %files -n sensor-test
130 %defattr(-,root,root,-)
131 %{_bindir}/api-test
132 %{_bindir}/sensor-test
133 %{_bindir}/multi-thread-performance-test
134 %{_bindir}/multi-process-performance-test
135 %{_bindir}/fusion-data-collection
136 %license LICENSE.APLv2