########################################################
SET(CMAKE_VERBOSE_MAKEFILE OFF)
-SET(LIBRARY_NAME "unified-system-service-deviced")
IF("${ARCH}" STREQUAL "arm")
OPTION(USE_ARM "Use Arm" ON)
# Build libdeviced-common-private.so
ADD_SUBDIRECTORY(src/shared)
-ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
SET(deviced_LDFLAGS ${REQUIRED_PKGS_LDFLAGS})
+
+if(${ENABLE_UNIFIED_SYSTEM_SERVICE})
+SET(LIBRARY_NAME "unified-system-service-deviced")
+ADD_LIBRARY(${LIBRARY_NAME} SHARED ${SRCS})
+TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${REQUIRED_PKGS_LDFLAGS} "-lrt -ldl -lm" deviced-common-private)
+INSTALL(TARGETS ${LIBRARY_NAME} DESTINATION ${LIB_INSTALL_DIR}/system/plugin/ COMPONENT RuntimeLibraries)
+else()
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${REQUIRED_PKGS_LDFLAGS} "-lrt -ldl -lm" deviced-common-private)
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
+endif()
INSTALL(DIRECTORY DESTINATION ${MAKE_INSTALL_PREFIX}${DD_PLUGIN_PATH})
-ADD_LIBRARY(${LIBRARY_NAME} SHARED ${SRCS})
-TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${REQUIRED_PKGS_LDFLAGS} "-lrt -ldl -lm" deviced-common-private)
-INSTALL(TARGETS ${LIBRARY_NAME} DESTINATION ${LIB_INSTALL_DIR}/system/plugin/ COMPONENT RuntimeLibraries)
IF(POWER_MODULE STREQUAL on)
ADD_EXECUTABLE(deviced-shutdown src/power-shutdown/shutdown.c src/shared/common.c)
CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/conf/org.tizen.system.deviced.conf DESTINATION /etc/dbus-1/system.d)
+if(${ENABLE_UNIFIED_SYSTEM_SERVICE})
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/conf/org.tizen.system.deviced-unified-system-service.conf DESTINATION /etc/dbus-1/system.d)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/org.tizen.system.deviced.service DESTINATION /usr/share/dbus-1/system-services)
+else()
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/conf/org.tizen.system.deviced.conf DESTINATION /etc/dbus-1/system.d)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/deviced.service DESTINATION /usr/lib/systemd/system)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/org.tizen.system.deviced.service DESTINATION /usr/share/dbus-1/system-services)
+endif()
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/usb-host-ffs-test-daemon.service DESTINATION /usr/lib/systemd/system)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/usb-host-test.socket DESTINATION /usr/lib/systemd/system)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/strs DESTINATION /etc/mtp-responder-dummy)
#Just For debugging
%define sdb_prestart off
+%define enable_unified_system_service 0
Name: deviced
Summary: Deviced
%description
Deviced
-%package unified-system-plugin
-License: Apache-2.0 and MIT
-Summary: unified-system plugin
-Requires: %{name} = %{version}-%{release}
-
-%description unified-system-plugin
-unified-system-service plugin
-
%package -n libdeviced
Summary: Deviced library
Group: Development/Libraries
-DDEVICE_BOARD_MODULE=on \
-DDEVICE_INPUT_MODULE=on \
-DCRITICAL_LOG_MODULE=on \
+ -DENABLE_UNIFIED_SYSTEM_SERVICE=%{enable_unified_system_service} \
#eol
%build
rm -rf %{buildroot}
%make_install
+%if %{enable_unified_system_service} != 1
%install_service multi-user.target.wants deviced.service
+%endif
# usb_module condition is removed because it is always on
%if %{?sdb_prestart} == on
%install_service basic.target.wants sdb-prestart.service
install -m 775 scripts/dump_pmstate_log.sh %{buildroot}%{TZ_SYS_DUMPGEN}/dump_pmstate_log.sh
%post
+%if %{enable_unified_system_service}
+mv %{_sysconfdir}/dbus-1/system.d/org.tizen.system.deviced-unified-system-service.conf \
+ %{_sysconfdir}/dbus-1/system.d/org.tizen.system.deviced.conf
+%endif
# Assume power module is on (-DPOWER_MODULE=on)
update-alternatives --install %{_prefix}/lib/systemd/systemd-shutdown systemd-shutdown %{_prefix}/lib/systemd/deviced-shutdown 500
mkdir -p %{_libdir}/deviced
mv %{_libdir}/tv-display.so %{_libdir}/deviced/display.so
-%post unified-system-plugin
-mv %{_sysconfdir}/dbus-1/system.d/org.tizen.system.deviced-unified-system-service.conf \
- %{_sysconfdir}/dbus-1/system.d/org.tizen.system.deviced.conf
-
%files
%manifest %{name}.manifest
%license LICENSE.Apache-2.0
%license LICENSE.MIT
-%{_bindir}/deviced
%{_libdir}/libdeviced-common-private.so
+%if %{enable_unified_system_service}
+%{_libdir}/system/plugin/libunified-system-service-deviced.so
+%config %{_sysconfdir}/dbus-1/system.d/org.tizen.system.deviced-unified-system-service.conf
+%else
+%{_bindir}/deviced
%{_unitdir}/multi-user.target.wants/deviced.service
%{_unitdir}/deviced.service
%{_datadir}/dbus-1/system-services/org.tizen.system.deviced.service
-%dir %{plugindir}
-%if %{?sdb_prestart} == on
-%{_unitdir}/sdb-prestart.service
-%{_unitdir}/basic.target.wants/sdb-prestart.service
-%endif
%config %{_sysconfdir}/dbus-1/system.d/org.tizen.system.deviced.conf
-%config %{_sysconfdir}/deviced/init.conf
-%config %{_sysconfdir}/deviced/display.conf
-%if %{?battery_module} == on
-%config %{_sysconfdir}/deviced/battery.conf
%endif
-# usbhost_test
-%{_sysconfdir}/deviced/usb-host-test/test_gadget.gs
-%{_bindir}/usb-host-ffs-test-daemon
-%{_unitdir}/usb-host-ffs-test-daemon.service
-%{_unitdir}/usb-host-test.socket
-%{_sysconfdir}/deviced/usb-host-test/descs
-%{_sysconfdir}/deviced/usb-host-test/strs
-# dummy mtp-responder
-%{_sysconfdir}/mtp-responder-dummy/strs
-%{_sysconfdir}/mtp-responder-dummy/descs
-%{_unitdir}/mtp-responder-dummy.socket
-%{_unitdir}/mtp-responder-dummy.service
-
-# Assume power module is on (-DPOWER_MODULE=on)
-%{_unitdir}/deviced-request-shutdown@.service
-%{_unitdir}/systemd-reboot.service.d/deviced-request-shutdown-reboot.conf
-%{_unitdir}/systemd-poweroff.service.d/deviced-request-shutdown-poweroff.conf
-%{_unitdir}/systemd-halt.service.d/deviced-request-shutdown-halt.conf
-%{_unitdir}/systemd-exit.service.d/deviced-request-shutdown-exit.conf
-%{_prefix}/lib/systemd/deviced-shutdown
-%{_sbindir}/deviced-request-shutdown
-
-%files unified-system-plugin
-%manifest %{name}.manifest
-%license LICENSE.Apache-2.0
-%license LICENSE.MIT
-%{_libdir}/system/plugin/libunified-system-service-deviced.so
-%{_libdir}/libdeviced-common-private.so
%dir %{plugindir}
%if %{?sdb_prestart} == on
%{_unitdir}/sdb-prestart.service
%{_unitdir}/basic.target.wants/sdb-prestart.service
%endif
-%config %{_sysconfdir}/dbus-1/system.d/org.tizen.system.deviced-unified-system-service.conf
%config %{_sysconfdir}/deviced/init.conf
%config %{_sysconfdir}/deviced/display.conf
%if %{?battery_module} == on