ENDFOREACH(flag)
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Werror -rdynamic -Wno-deprecated-declarations")
-SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -fno-omit-frame-pointer -finstrument-functions -DUNIFIED_SYSTEM_SERVICE_ENABLED=${UNIFIED_SYSTEM_SERVICE_ON}")
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -fno-omit-frame-pointer -finstrument-functions -DUNIFIED_SYSTEM_SERVICE_ENABLED=${ENABLE_UNIFIED_SYSTEM_SERVICE}")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -lrt -fPIE")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
# To apply Armoring(Full RELRO), which means GOT Table becomes read-only.
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,relro,-z,now")
-ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${${PROJECT_NAME}_pkgs_LDFLAGS} "-ldl" "-lm")
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
-
+if(${ENABLE_UNIFIED_SYSTEM_SERVICE})
ADD_LIBRARY(${LIBRARY_NAME} SHARED ${SRCS})
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${${PROJECT_NAME}_pkgs_LDFLAGS} "-ldl" "-lm")
INSTALL(TARGETS ${LIBRARY_NAME} DESTINATION ${LIB_INSTALL_DIR}/system/plugin/ COMPONENT RuntimeLibraries)
+else()
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${${PROJECT_NAME}_pkgs_LDFLAGS} "-ldl" "-lm")
+INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
+endif()
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/conf/org.tizen.system.storage.conf DESTINATION /etc/dbus-1/system.d)
+if (${ENABLE_UNIFIED_SYSTEM_SERVICE})
INSTALL(FILES ${CMAKE_SOURCE_DIR}/conf/org.tizen.system.storage-unified-system-service.conf DESTINATION /etc/dbus-1/system.d)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/conf/block.conf DESTINATION /etc/storaged)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/conf/storage.conf DESTINATION /etc/storaged)
+else()
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/conf/org.tizen.system.storage.conf DESTINATION /etc/dbus-1/system.d)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/systemd/org.tizen.system.storage.service DESTINATION /usr/share/dbus-1/system-services)
INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/systemd/ DESTINATION lib/systemd/system
FILES_MATCHING
PATTERN "storaged.service")
+endif()
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/conf/block.conf DESTINATION /etc/storaged)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/conf/storage.conf DESTINATION /etc/storaged)
IF(BLOCK_MODULE STREQUAL on)
ADD_SUBDIRECTORY(src/block)
#These options are DEACTIVATED by default.
%bcond_with emulator
%define extended_storage 0
-%define unified_system_service_on 0
+%define enable_unified_system_service 0
Name: storaged
Summary: Storaged
%description
storage daemon.
-%package unified-system-plugin
-Summary: unified-system-service plugin
-Requires: %{name} = %{version}-%{release}
-%description unified-system-plugin
-unified-system-service plugin
-
%package module_block
Summary: block module plugin
Requires: %{name} = %{version}-%{release}
-DBLOCK_TMPFS=on \
-DSTORAGE_MODULE=on \
-DEXTENDED_STORAGE=%{extended_storage} \
- -DUNIFIED_SYSTEM_SERVICE_ON=%{unified_system_service_on} \
+ -DENABLE_UNIFIED_SYSTEM_SERVICE=%{enable_unified_system_service} \
-DCRITICAL_LOG_MODULE=on \
#eol
rm -rf %{buildroot}
%make_install
+%if %{enable_unified_system_service} != 1
%install_service delayed.target.wants storaged.service
+%endif
%if "%{asan}" == "1"
mkdir -p %{buildroot}%{_unitdir}/storaged.service.d
%find_lang extended-sd
%post
+%if %{enable_unified_system_service}
+mv %{_sysconfdir}/dbus-1/system.d/org.tizen.system.storage-unified-system-service.conf \
+ %{_sysconfdir}/dbus-1/system.d/org.tizen.system.storage.conf
+%endif
+
systemctl daemon-reload
if [ "$1" == "1" ]; then
systemctl restart storaged.service
fi
-%post unified-system-plugin
-mv %{_sysconfdir}/dbus-1/system.d/org.tizen.system.storage-unified-system-service.conf \
- %{_sysconfdir}/dbus-1/system.d/org.tizen.system.storage.conf
-
%postun
systemctl daemon-reload
%files
%manifest %{name}.manifest
%license LICENSE.Apache-2.0
+%if %{enable_unified_system_service}
+%config %{_sysconfdir}/dbus-1/system.d/org.tizen.system.storage-unified-system-service.conf
+%{_libdir}/system/plugin/libunified-system-service-storaged.so
+%else
%config %{_sysconfdir}/dbus-1/system.d/org.tizen.system.storage.conf
%{_datadir}/dbus-1/system-services/org.tizen.system.storage.service
%{_unitdir}/delayed.target.wants/storaged.service
%{_unitdir}/storaged.service
%{_bindir}/storaged
-%if "%{asan}" == "1"
-%{_unitdir}/storaged.service.d/storaged.asan.conf
%endif
-
-%files unified-system-plugin
-%manifest %{name}.manifest
-%license LICENSE.Apache-2.0
-%config %{_sysconfdir}/dbus-1/system.d/org.tizen.system.storage-unified-system-service.conf
-%{_libdir}/system/plugin/libunified-system-service-storaged.so
%if "%{asan}" == "1"
%{_unitdir}/storaged.service.d/storaged.asan.conf
%endif