diff --git a/calendar-client/assets/dbus/com.deepin.Calendar.service.in b/calendar-client/assets/dbus/com.deepin.Calendar.service.in index 0e68070f..5c9a9460 100644 --- a/calendar-client/assets/dbus/com.deepin.Calendar.service.in +++ b/calendar-client/assets/dbus/com.deepin.Calendar.service.in @@ -1,3 +1,4 @@ [D-BUS Service] Name=com.deepin.Calendar Exec=@EXEC_DDE_CALENDAR@ +SystemdService=dde-calendar.service \ No newline at end of file diff --git a/calendar-service/CMakeLists.txt b/calendar-service/CMakeLists.txt index 1a4cc818..435b1535 100644 --- a/calendar-service/CMakeLists.txt +++ b/calendar-service/CMakeLists.txt @@ -9,8 +9,9 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-strong -z noexecstack -pie -fPIC -z lazy") set(APP_RES_DIR "assets") -set(APP_SERVICE_IN "${APP_RES_DIR}/data/com.deepin.dataserver.Calendar.service.in") -set(APP_SYSTEMD_SERVICE "${APP_RES_DIR}/data/com.dde.calendarserver.calendar.service") +set( SERVER_SERVICE_IN "${APP_RES_DIR}/data/com.deepin.dataserver.Calendar.service.in") +set( APP_SERVICE_IN "${APP_RES_DIR}/data/dde-calendar.service.in") +set( SERVER_SYSTEMD_SERVICE "${APP_RES_DIR}/data/com.dde.calendarserver.calendar.service") set(APP_SYSTEMD_TIMER "${APP_RES_DIR}/data/com.dde.calendarserver.calendar.timer") set(AUTOSTART_DESKTOP "${APP_RES_DIR}/dde-calendar-service.desktop") set(HUANGLIDB "${APP_RES_DIR}/data/huangli.db") @@ -72,13 +73,14 @@ target_compile_definitions(${PROJECT_NAME} #修改dbus服务文件 set (EXEC_DDE_CALENDAR_SERVICE "${SERVICE_INSTALL_DIR}/dde-calendar-service" CACHE STRING "Command to execute dde-calendar-service") -configure_file(${APP_SERVICE_IN} ${CMAKE_CURRENT_BINARY_DIR}/dbus/com.deepin.dataserver.Calendar.service @ONLY) - +configure_file(${SERVER_SERVICE_IN} ${CMAKE_CURRENT_BINARY_DIR}/dbus/com.deepin.dataserver.Calendar.service @ONLY) +configure_file(${APP_SERVICE_IN} ${CMAKE_CURRENT_BINARY_DIR}/assets/dde-calendar.service @ONLY) # Install files install(TARGETS ${PROJECT_NAME} DESTINATION ${SERVICE_INSTALL_DIR}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dbus/com.deepin.dataserver.Calendar.service DESTINATION ${CMAKE_INSTALL_DATADIR}/dbus-1/services/) install(FILES ${AUTOSTART_DESKTOP} DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/xdg/autostart/) install(FILES ${HUANGLIDB} DESTINATION ${CMAKE_INSTALL_DATADIR}/dde-calendar/data/) -install(FILES ${APP_SYSTEMD_SERVICE} DESTINATION lib/systemd/user/) +install(FILES ${SERVER_SYSTEMD_SERVICE} DESTINATION lib/systemd/user/) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/assets/dde-calendar.service DESTINATION lib/systemd/user/) install(FILES ${APP_SYSTEMD_TIMER} DESTINATION lib/systemd/user/) diff --git a/calendar-service/assets/data/dde-calendar.service.in b/calendar-service/assets/data/dde-calendar.service.in new file mode 100644 index 00000000..f01cc252 --- /dev/null +++ b/calendar-service/assets/data/dde-calendar.service.in @@ -0,0 +1,8 @@ +[Unit] +Description = dde-calendar date service + +[Service] +ExecStart=@EXEC_DDE_CALENDAR@ +Type=dbus +BusName=com.deepin.Calendar +Slice=app.slice \ No newline at end of file