diff --git a/debian/linglong-bin.install b/debian/linglong-bin.install index 749bea159..34d536fcf 100644 --- a/debian/linglong-bin.install +++ b/debian/linglong-bin.install @@ -2,8 +2,6 @@ usr/bin/ll-service usr/bin/ll-cli usr/bin/ll-package-manager usr/bin/ll-system-helper -usr/share/applications/org.deepin.linglong.service.desktop -etc/xdg/autostart/org.deepin.linglong.service.desktop etc/profile.d/linglong.sh etc/X11/Xsession.d/21linglong usr/share/linglong/config.json @@ -15,8 +13,11 @@ usr/share/dbus-1/system.d/org.deepin.linglong.PackageManager.conf usr/share/dbus-1/system-services/org.deepin.linglong.PackageManager.service usr/share/dbus-1/system.d/org.deepin.linglong.SystemHelper.conf usr/share/dbus-1/system-services/org.deepin.linglong.SystemHelper.service -lib/systemd/system/org.deepin.linglong.PackageManager.service -lib/systemd/system/org.deepin.linglong.SystemHelper.service +usr/share/dbus-1/services/org.deepin.linglong.AppManager.service +usr/lib/systemd/system/org.deepin.linglong.PackageManager.service +usr/lib/systemd/user/org.deepin.linglong.AppManager.service +usr/lib/systemd/system/org.deepin.linglong.SystemHelper.service +usr/lib/sysusers.d/linglong.conf usr/share/mime/packages/deepin-linglong.xml usr/libexec/linglong/upgrade-all diff --git a/misc/CMakeLists.txt b/misc/CMakeLists.txt index 569abc105..583bf8a31 100644 --- a/misc/CMakeLists.txt +++ b/misc/CMakeLists.txt @@ -7,6 +7,10 @@ configure_file( systemd/user/linglong-upgrade.service @ONLY ) +configure_file( + dbus/org.deepin.linglong.AppManager.service.in + dbus/org.deepin.linglong.AppManager.service +) set(SYSTEMD_USER_FILE ${CMAKE_CURRENT_BINARY_DIR}/systemd/user/linglong-upgrade.service @@ -14,7 +18,34 @@ set(SYSTEMD_USER_FILE ) install(FILES ${SYSTEMD_USER_FILE} - DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/systemd/user/ + DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/systemd/user/) + +set(DBUS_SESSION_SERVICE_FILE + ${CMAKE_CURRENT_BINARY_DIR}/dbus/org.deepin.linglong.AppManager.service +) + +# dbus will not load files in /usr/local/share/dbus-1/system.d. So we have to +# make sure the .conf file(s) installed to /usr/share +install(FILES ${DBUS_CONFIG_FILE} DESTINATION /usr/share/dbus-1/system.d) + +install(FILES ${DBUS_SYSTEM_SERVICE_FILE} + DESTINATION ${CMAKE_INSTALL_DATADIR}/dbus-1/system-services +) + +install(FILES ${DBUS_SESSION_SERVICE_FILE} + DESTINATION ${CMAKE_INSTALL_DATADIR}/dbus-1/services +) + +# linglong + +set(LINGLONG_CONFIG_FILES linglong/builder.yaml linglong/config.json) + +install(FILES linglong/builder.yaml + DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/linglong +) + +install(FILES linglong/config.json + DESTINATION ${CMAKE_INSTALL_DATADIR}/linglong ) configure_file( @@ -28,3 +59,54 @@ set(LINGLONG_SCRIPTS ${CMAKE_CURRENT_BINARY_DIR}/scripts/upgrade-all) install(PROGRAMS ${LINGLONG_SCRIPTS} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/linglong/ ) + +# systemd + +configure_file( + systemd/service/org.deepin.linglong.AppManager.service.in + systemd/service/org.deepin.linglong.AppManager.service +) + +set(SYSTEMD_SYSTEM_SERVICE_FILE + # cmake-format: sortable + ${CMAKE_CURRENT_BINARY_DIR}/systemd/service/org.deepin.linglong.PackageManager.service + ${CMAKE_CURRENT_BINARY_DIR}/systemd/service/org.deepin.linglong.SystemHelper.service +) + +install(FILES ${SYSTEMD_SYSTEM_SERVICE_FILE} + DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/systemd/system/ +) + +set(SYSTEMD_USER_SERVICE_FILE + ${CMAKE_CURRENT_BINARY_DIR}/systemd/service/org.deepin.linglong.AppManager.service +) + +install(FILES ${SYSTEMD_USER_SERVICE_FILE} + DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/systemd/user/ +) + +install( + PROGRAMS systemd/user-environment-generators/61-linglong + DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/systemd/user-environment-generators/ +) + +install( + PROGRAMS systemd/system-environment-generators/61-linglong + DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/systemd/system-environment-generators/ +) + +# sysuser + +pkg_get_variable( + SYSUSERSDIR + systemd + sysusersdir +) + +install(FILES sysuser/linglong.conf DESTINATION ${SYSUSERSDIR}) + +# xdg + +install(FILES xdg/mime/deepin-linglong.xml + DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages +) diff --git a/misc/dbus/org.deepin.linglong.AppManager.service.in b/misc/dbus/org.deepin.linglong.AppManager.service.in new file mode 100644 index 000000000..c06d4462c --- /dev/null +++ b/misc/dbus/org.deepin.linglong.AppManager.service.in @@ -0,0 +1,4 @@ +[D-BUS Service] +Name=org.deepin.linglong.AppManager +Exec=@CMAKE_INSTALL_FULL_BINDIR@/ll-service +SystemdService=org.deepin.linglong.AppManager.service diff --git a/misc/systemd/service/org.deepin.linglong.AppManager.service.in b/misc/systemd/service/org.deepin.linglong.AppManager.service.in new file mode 100644 index 000000000..50181fd8d --- /dev/null +++ b/misc/systemd/service/org.deepin.linglong.AppManager.service.in @@ -0,0 +1,9 @@ +[Unit] +Description=Linglong AppManager service + +[Service] +Type=dbus +BusName=org.deepin.linglong.AppManager +ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/ll-service +Restart=on-failure +RestartSec=10