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