585cf5786d18bd1efb73b0bc0e26f60fbdf20531
[platform/core/system/sensord.git] / packaging / sensord.spec
1 Name:       sensord
2 Summary:    Sensor daemon
3 Version:    4.0.0
4 Release:    1
5 Group:      System/Sensor Framework
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1:    sensord.service
9 Source2:    sensord.socket
10
11 BuildRequires:  cmake
12 BuildRequires:  libattr-devel
13 BuildRequires:  pkgconfig(dlog)
14 BuildRequires:  pkgconfig(glib-2.0)
15 BuildRequires:  pkgconfig(vconf)
16 BuildRequires:  pkgconfig(libsystemd-daemon)
17 BuildRequires:  pkgconfig(cynara-creds-socket)
18 BuildRequires:  pkgconfig(cynara-client)
19 BuildRequires:  pkgconfig(cynara-session)
20
21 Requires:   %{name}-dummy = %{version}-%{release}
22 Provides:   %{name}-profile_mobile = %{version}-%{release}
23 Provides:   %{name}-profile_wearable = %{version}-%{release}
24 Provides:   %{name}-profile_ivi = %{version}-%{release}
25 Provides:   %{name}-profile_common = %{version}-%{release}
26 %global __provides_exclude ^.*-genuine\\.so.*$
27
28 %description
29 This package provides the fully functional internal API library and the service daemon
30 of the Sensor Framework. The library replaces the dummy library installed by %{name}-dummy.
31
32
33 %package    dummy
34 Summary:    Sensor Framework 'dummy' library
35 Provides:   %{name}-profile_tv = %{version}-%{release}
36 Provides:   libsensor.so.2
37
38 %description dummy
39 This package provides the dummy library of the sensor internal API.
40 Installing %{name} replaces this dummy library with the actually functional library.
41
42
43 %package    devel
44 Summary:    Internal Sensor API (Development)
45 Group:      System/Development
46 Requires:   %{name}-dummy = %{version}-%{release}
47
48 %description devel
49 Internal Sensor API (Development)
50
51
52 %package -n sensor-hal-devel
53 Summary:    Sensord HAL interface
54 Group:      System/Development
55
56 %description -n sensor-hal-devel
57 Sensord HAL interface
58
59
60 %package -n sensor-test
61 Summary:    Sensord library
62 Group:      System/Testing
63
64 %description -n sensor-test
65 Sensor functional testing
66
67
68 %prep
69 %setup -q
70
71 %build
72 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
73
74 %cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version}
75 make %{?_smp_mflags}
76
77 %install
78 %make_install
79
80 mkdir -p %{buildroot}%{_unitdir}
81
82 install -m 0644 %SOURCE1 %{buildroot}%{_unitdir}
83 install -m 0644 %SOURCE2 %{buildroot}%{_unitdir}
84
85 %install_service multi-user.target.wants sensord.service
86 %install_service sockets.target.wants sensord.socket
87
88 ln -s libsensor.so.%{version} %{buildroot}/%{_libdir}/libsensor.so.2
89 ln -s libsensor.so.%{version} %{buildroot}/%{_libdir}/libsensor.so.1
90
91 %post
92 pushd %{_libdir}
93 ln -sf libsensor-genuine.so.%{version} libsensor.so.%{version}
94 chsmack -a "_" libsensor.so.%{version}
95 popd
96 /sbin/ldconfig
97
98 %preun
99 echo "You need to reinstall %{name}-dummy to keep using the APIs after uninstalling this."
100
101 %files
102 %manifest packaging/sensord.manifest
103 %{_libdir}/libsensor-genuine.so.*
104 %{_libdir}/libsensord-shared.so
105 %{_libdir}/sensor/fusion/libsensor-fusion.so
106 %{_bindir}/sensord
107 %{_unitdir}/sensord.service
108 %{_unitdir}/sensord.socket
109 %{_unitdir}/multi-user.target.wants/sensord.service
110 %{_unitdir}/sockets.target.wants/sensord.socket
111 %license LICENSE.APLv2
112
113
114 %post   dummy
115 /sbin/ldconfig
116
117 %files  dummy
118 %manifest packaging/sensord.manifest
119 %{_libdir}/libsensor.so.*
120 %license LICENSE.APLv2
121
122
123 %files  devel
124 %manifest packaging/sensord.manifest
125 %exclude %{_includedir}/sensor/sensor_hal.h
126 %{_includedir}/sensor/*.h
127 %{_libdir}/libsensor.so
128 %{_libdir}/pkgconfig/sensor.pc
129
130
131 %files -n sensor-hal-devel
132 %manifest packaging/sensord.manifest
133 %{_includedir}/sensor/sensor_hal*.h
134
135
136 %files -n sensor-test
137 %{_bindir}/sensorctl