unified-system-plugin: Change to include files in sensord package by flag 74/324374/3 accepted/tizen/unified/20250530.090416 accepted/tizen/unified/x/20250531.232937
authorSangYoun Kwak <sy.kwak@samsung.com>
Fri, 16 May 2025 04:53:37 +0000 (13:53 +0900)
committerSangYoun Kwak <sy.kwak@samsung.com>
Fri, 16 May 2025 10:24:14 +0000 (19:24 +0900)
Instead of separating unified-system-plugin files into a package, files
are included in the main package 'sensord' according to a flag named
enable_unified_system_service.

If flag is 1 then:
    libunified-system-sensor.so is included
    Unnecessary files for unified-system-plugin(sensord executable,
    service files, socket files) are excluded

If flag is not 1 then:
    libunified-system-sensor.so is excluded
    sensord executable, service files, socket files are included

Change-Id: I82ef689e00b85da81dbd39819dac4921921861e6
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
packaging/sensord.spec
src/server/CMakeLists.txt

index 7b2a409df862e312e0eeca49c14d056c8bf6c43d..6253bdf8a15e19ec967d365411840da799b6ffc1 100644 (file)
@@ -1,3 +1,5 @@
+%define enable_unified_system_service 0
+
 Name:       sensord
 Summary:    Sensor daemon
 Version:    4.0.54
@@ -63,12 +65,6 @@ Group:      System/Testing
 %description -n sensor-test
 Sensor functional testing
 
-%package unified-system-plugin
-Summary:    Package for unified-system-plugin plugin
-
-%description unified-system-plugin
-Package for unified-system-service plugin
-
 %isu_package
 
 %prep
@@ -77,7 +73,10 @@ Package for unified-system-service plugin
 %build
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 
-%cmake . -DMAJORVER=${MAJORVER} -DFULLVER=%{version} -DCMAKE_HAL_LIBDIR_PREFIX=%{_hal_libdir}
+%cmake . -DMAJORVER=${MAJORVER} \
+         -DFULLVER=%{version} \
+         -DCMAKE_HAL_LIBDIR_PREFIX=%{_hal_libdir} \
+         -DENABLE_UNIFIED_SYSTEM_SERVICE=%{enable_unified_system_service}
 make %{?_smp_mflags}
 
 %install
@@ -85,14 +84,15 @@ make %{?_smp_mflags}
 
 mkdir -p %{buildroot}%{_unitdir}
 
-install -m 0644 %SOURCE1 %{buildroot}%{_unitdir}
-install -m 0644 %SOURCE2 %{buildroot}%{_unitdir}
-
 mkdir -p %{buildroot}%{_sysconfdir}/sensord
 install -m 644 conf/auto_rotation.conf   %{buildroot}/etc/sensord/auto_rotation.conf
 
+%if %{enable_unified_system_service} != 1
+install -m 0644 %SOURCE1 %{buildroot}%{_unitdir}
+install -m 0644 %SOURCE2 %{buildroot}%{_unitdir}
 %install_service multi-user.target.wants sensord.service
 %install_service sockets.target.wants sensord.socket
+%endif
 
 ln -s libsensor.so.%{version} %{buildroot}/%{_libdir}/libsensor.so.2
 ln -s libsensor.so.%{version} %{buildroot}/%{_libdir}/libsensor.so.1
@@ -112,11 +112,15 @@ echo "You need to reinstall %{name}-dummy to keep using the APIs after uninstall
 %{_libdir}/libsensord-shared.so
 %{_libdir}/sensor/fusion/libsensor-fusion.so
 %{_libdir}/sensor/physical/libsensor-physical.so
+%if %{enable_unified_system_service}
+%{_libdir}/system/plugin/libunified-system-service-sensord.so
+%else
 %{_bindir}/sensord
 %{_unitdir}/sensord.service
 %{_unitdir}/sensord.socket
 %{_unitdir}/multi-user.target.wants/sensord.service
 %{_unitdir}/sockets.target.wants/sensord.socket
+%endif
 %config %{_sysconfdir}/sensord/auto_rotation.conf
 %license LICENSE.APLv2
 
@@ -135,6 +139,9 @@ 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
+%if %{enable_unified_system_service}
+rm -f %{_libdir}/system/plugin/libunified-system-service-sensord.so
+%endif
 /sbin/ldconfig
 
 
@@ -155,16 +162,6 @@ rm -f %{_unitdir}/sockets.target.wants/sensord.socket
 %files -n sensor-test
 %{_bindir}/sensorctl
 
-%files unified-system-plugin
-%manifest packaging/sensord.manifest
-%{_libdir}/libsensor.so.*
-%{_libdir}/libsensord-shared.so
-%{_libdir}/sensor/fusion/libsensor-fusion.so
-%{_libdir}/sensor/physical/libsensor-physical.so
-%{_libdir}/system/plugin/libunified-system-service-sensord.so
-%config %{_sysconfdir}/sensord/auto_rotation.conf
-%license LICENSE.APLv2
-
 
 # Dummy packages for Tizen 3.0.
 # When building other packages on Tizen 3.0, after building sensord first,
index e7045340de7f261a81e425e9af2d7a5726975f2a..9191430c4f4de5920178eda068720790319d33a5 100644 (file)
@@ -36,12 +36,15 @@ INCLUDE_DIRECTORIES(
 )
 
 FILE(GLOB SERVER_SRCS *.cpp)
-ADD_EXECUTABLE(${PROJECT_NAME} ${SENSOR_SRCS} ${SERVER_SRCS})
-SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${SERVER_PKGS_LDFLAGS} ${CMAKE_DL_LIBS} "sensord-shared")
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
 
+if(${ENABLE_UNIFIED_SYSTEM_SERVICE})
 SET(LIBRARY_NAME "unified-system-service-sensord")
 ADD_LIBRARY(${LIBRARY_NAME} SHARED ${SERVER_SRCS})
 TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${SERVER_PKGS_LDFLAGS} ${CMAKE_DL_LIBS} "sensord-shared")
 INSTALL(TARGETS ${LIBRARY_NAME} DESTINATION ${LIB_INSTALL_DIR}/system/plugin COMPONENT RuntimeLibraries)
+else()
+ADD_EXECUTABLE(${PROJECT_NAME} ${SENSOR_SRCS} ${SERVER_SRCS})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${SERVER_PKGS_LDFLAGS} ${CMAKE_DL_LIBS} "sensord-shared")
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
+endif()