packaging: Modify the installation of sensord and sensord-dummy 32/287032/1
authorSangYoun Kwak <sy.kwak@samsung.com>
Tue, 17 Jan 2023 08:37:03 +0000 (17:37 +0900)
committerSangYoun Kwak <sy.kwak@samsung.com>
Thu, 19 Jan 2023 01:39:13 +0000 (01:39 +0000)
Previously, sensor-dummy was installed with sensord due to the
providence of the name 'libsensor.so.<major version>', which is a
reference for expanding the "package dependency".
In this patch, sensord will be installed independently and it will
provide the name "libsensor.so.<major version>". According to this,
sensor-dummy will be installed with sensord due to the providence of the
name.

Since the sensord daemon is not necessary on the target which uses
sensord-dummy, the post script of sensord-dummy will remove the files
which are installed by the sensord package.

The sensord-dummy package is not required explicitly in the tv profile.
(previously, sensord-dummy was required by the name "libsensor.so.<major
 version>", it was not necessary to require sensord-dummy explicitly)
Thus, this patch should be applied with the modification of
.ks(kickstart) file.
("sensord-profile_tv" which provided by the sensord-dummy can be used)

Change-Id: I0c56af9f6e9f35a35fc0b3b5074400d94ebd5ebe
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
(cherry picked from commit eb5f2daafcec9510fb62cd946563036c5f2cf28c)

packaging/sensord.spec

index 643863c..72b4aa2 100644 (file)
@@ -22,7 +22,6 @@ BuildRequires:  pkgconfig(cynara-session)
 BuildRequires:  pkgconfig(hal-api-sensor)
 BuildRequires:  pkgconfig(hal-api-common)
 
-Requires:   %{name}-dummy = %{version}-%{release}
 Provides:   %{name}-profile_mobile = %{version}-%{release}
 Provides:   %{name}-profile_wearable = %{version}-%{release}
 Provides:   %{name}-profile_ivi = %{version}-%{release}
@@ -37,11 +36,9 @@ of the Sensor Framework. The library replaces the dummy library installed by %{n
 %package    dummy
 Summary:    Sensor Framework 'dummy' library
 Provides:   %{name}-profile_tv = %{version}-%{release}
+Requires:   %{name} = %{version}-%{release}
 # To support old-snapshot-based package builds
 Provides:   libsensor.so.2
-# For targets which uses only dummy
-# Prevent to install sensord by providing libsensor.so.<major version>
-Provides:   libsensor.so.%(echo %{version} | cut -d'.' -f1)
 
 
 %description dummy
@@ -103,7 +100,7 @@ echo "You need to reinstall %{name}-dummy to keep using the APIs after uninstall
 
 %files
 %manifest packaging/sensord.manifest
-%{_libdir}/libsensor.so.%{version}
+%{_libdir}/libsensor.so.*
 %{_libdir}/libsensord-shared.so
 %{_libdir}/sensor/fusion/libsensor-fusion.so
 %{_libdir}/sensor/physical/libsensor-physical.so
@@ -121,12 +118,20 @@ pushd %{_libdir}
 ln -sf libsensor-dummy.so libsensor.so.%{version}
 chsmack -a "_" libsensor.so.%{version}
 popd
+# Remove sensord files
+rm -f %{_libdir}/libsensord-shared.so
+rm -f %{_libdir}/sensor/fusion/libsensor-fusion.so
+rm -f %{_libdir}/sensor/physical/libsensor-physical.so
+rm -f %{_bindir}/sensord
+rm -f %{_unitdir}/sensord.service
+rm -f %{_unitdir}/sensord.socket
+rm -f %{_unitdir}/multi-user.target.wants/sensord.service
+rm -f %{_unitdir}/sockets.target.wants/sensord.socket
 /sbin/ldconfig
 
+
 %files  dummy
 %manifest packaging/sensord.manifest
-%exclude %{_libdir}/libsensor.so.%{version}
-%{_libdir}/libsensor.so.*
 %{_libdir}/libsensor-dummy.so
 %license LICENSE.APLv2