From 409dda41bd4e80b279673adb967966b8eba3cc2c Mon Sep 17 00:00:00 2001 From: Pier Luigi Fiorini Date: Sun, 2 Nov 2014 21:54:05 +0100 Subject: [PATCH] Update services --- CMakeLists.txt | 8 ++------ bin/CMakeLists.txt | 4 ++++ bin/plasma-phone.cmake | 5 +---- dbus/CMakeLists.txt | 2 ++ dbus/org.kde.kded5.service | 3 +++ packaging/plasma-phone-components.spec | 12 +++++------ packaging/plasma-phone-components.yaml | 1 + services/CMakeLists.txt | 15 ++++++++++++++ services/kded5.service.cmake | 14 +++++++++++++ services/kdeinit5.service.cmake | 15 ++++++++++++++ ... => plasma-phone-compositor.service.cmake} | 4 ++-- services/plasma-phone-kbuildsycoca5.service | 15 -------------- services/plasma-phone-kdeinit.service | 17 ---------------- services/plasma-phone-ksyncdbusenv.service | 15 -------------- services/plasma-phone-shell.service | 18 ----------------- services/plasma-phone-ui.service | 18 ----------------- services/plasma-phone-ui.service.cmake | 20 +++++++++++++++++++ 17 files changed, 84 insertions(+), 102 deletions(-) create mode 100644 bin/CMakeLists.txt create mode 100644 dbus/CMakeLists.txt create mode 100644 dbus/org.kde.kded5.service create mode 100644 services/CMakeLists.txt create mode 100644 services/kded5.service.cmake create mode 100644 services/kdeinit5.service.cmake rename services/{plasma-phone-compositor.service => plasma-phone-compositor.service.cmake} (78%) delete mode 100644 services/plasma-phone-kbuildsycoca5.service delete mode 100644 services/plasma-phone-kdeinit.service delete mode 100644 services/plasma-phone-ksyncdbusenv.service delete mode 100644 services/plasma-phone-shell.service delete mode 100644 services/plasma-phone-ui.service create mode 100644 services/plasma-phone-ui.service.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 8dcd7091..0a182634 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,10 +38,6 @@ plasma_install_package(look-and-feel org.kde.satellite.phone look-and-feel) plasma_install_package(shell org.kde.satellite.phone shells) install(DIRECTORY wallpaper/ DESTINATION "${WALLPAPER_INSTALL_DIR}/org.kde.satellite.lockers") -configure_file(${CMAKE_SOURCE_DIR}/bin/plasma-phone.cmake ${CMAKE_BINARY_DIR}/plasma-phone) -install(FILES ${CMAKE_BINARY_DIR}/plasma-phone - PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ WORLD_EXECUTE WORLD_READ GROUP_EXECUTE GROUP_READ - DESTINATION ${BIN_INSTALL_DIR}) - +add_subdirectory(bin) add_subdirectory(qmlcomponents) - +add_subdirectory(services) diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt new file mode 100644 index 00000000..9977660b --- /dev/null +++ b/bin/CMakeLists.txt @@ -0,0 +1,4 @@ +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/plasma-phone.cmake ${CMAKE_CURRENT_BINARY_DIR}/plasma-phone) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plasma-phone + PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ WORLD_EXECUTE WORLD_READ GROUP_EXECUTE GROUP_READ + DESTINATION ${BIN_INSTALL_DIR}) diff --git a/bin/plasma-phone.cmake b/bin/plasma-phone.cmake index 0e081fef..b71c0cf6 100644 --- a/bin/plasma-phone.cmake +++ b/bin/plasma-phone.cmake @@ -10,7 +10,4 @@ # (at your option) any later version. # -@CMAKE_INSTALL_FULL_LIBEXECDIR@/ksyncdbusenv -@CMAKE_INSTALL_FULL_BINDIR@/kbuildsycoca5 -LD_BIND_NOW=true @CMAKE_INSTALL_FULL_LIBEXECDIR_KF5@/start_kdeinit_wrapper -@CMAKE_INSTALL_FULL_BINDIR@/plasmashell -p org.kde.satellite.phone -n +exec dbus-run-session -- /usr/bin/plasmashell -p org.kde.satellite.phone -n diff --git a/dbus/CMakeLists.txt b/dbus/CMakeLists.txt new file mode 100644 index 00000000..38f42a29 --- /dev/null +++ b/dbus/CMakeLists.txt @@ -0,0 +1,2 @@ +install(FILES org.kde.kded5.service + DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/dbus-1/session.d) diff --git a/dbus/org.kde.kded5.service b/dbus/org.kde.kded5.service new file mode 100644 index 00000000..3ca38263 --- /dev/null +++ b/dbus/org.kde.kded5.service @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=org.kde.kded5 +SystemdService=kded5.service diff --git a/packaging/plasma-phone-components.spec b/packaging/plasma-phone-components.spec index 70aa509a..4f0e5bb3 100644 --- a/packaging/plasma-phone-components.spec +++ b/packaging/plasma-phone-components.spec @@ -34,6 +34,7 @@ BuildRequires: pkgconfig(Qt5Widgets) BuildRequires: pkgconfig(Qt5Test) BuildRequires: pkgconfig(Qt5Qml) BuildRequires: pkgconfig(Qt5Quick) +BuildRequires: pkgconfig(systemd) BuildRequires: extra-cmake-modules BuildRequires: kf5-rpm-macros BuildRequires: qt5-tools @@ -124,15 +125,12 @@ Theme=breeze name=default EOF -# Install systemd units -mkdir -p %{buildroot}%{_libdir}/systemd/user/user-session.target.wants/ -#UNITS="compositor kbuildsycoca5 kdeinit ksyncdbusenv shell" -UNITS="compositor ui" +# Install services links +mkdir -p %{buildroot}%{_libdir}/systemd/user/user-session.target.wants +UNITS="plasma-phone-compositor plasma-phone-ui" for service in $UNITS; do -install -D -m 644 services/plasma-phone-${service}.service %{buildroot}%{_libdir}/systemd/user/plasma-phone-${service}.service -ln -s ../plasma-phone-${service}.service %{buildroot}%{_libdir}/systemd/user/user-session.target.wants/plasma-phone-${service}.service +ln -sf ../${service}.service %{buildroot}%{_libdir}/systemd/user/user-session.target.wants/${service}.service done - # << install post %files diff --git a/packaging/plasma-phone-components.yaml b/packaging/plasma-phone-components.yaml index 37786aef..d339fa46 100644 --- a/packaging/plasma-phone-components.yaml +++ b/packaging/plasma-phone-components.yaml @@ -37,6 +37,7 @@ PkgConfigBR: - Qt5Test - Qt5Qml - Qt5Quick + - systemd Configure: none Builder: none diff --git a/services/CMakeLists.txt b/services/CMakeLists.txt new file mode 100644 index 00000000..c61e3706 --- /dev/null +++ b/services/CMakeLists.txt @@ -0,0 +1,15 @@ +find_package(PkgConfig REQUIRED) +pkg_check_modules(SYSTEMD systemd REQUIRED) +execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=systemduserunitdir systemd OUTPUT_VARIABLE SYSTEMD_USER_UNIT_DIR) +string(REGEX REPLACE "[ \t\n]+" "" SYSTEMD_USER_UNIT_DIR ${SYSTEMD_USER_UNIT_DIR}) + +macro(satellite_install_service name) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${name}.service.cmake ${CMAKE_CURRENT_BINARY_DIR}/${name}.service) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}.service + DESTINATION ${SYSTEMD_USER_UNIT_DIR}) +endmacro() + +satellite_install_service(kded5) +satellite_install_service(kdeinit5) +satellite_install_service(plasma-phone-compositor) +satellite_install_service(plasma-phone-ui) diff --git a/services/kded5.service.cmake b/services/kded5.service.cmake new file mode 100644 index 00000000..5f2b62ef --- /dev/null +++ b/services/kded5.service.cmake @@ -0,0 +1,14 @@ +# +# Copyright (C) 2014 Pier Luigi Fiorini +# +# Starts kded5. +# + +[Unit] +Description=kded5 +Requires=kdeinit5.service + +[Service] +EnvironmentFile=-/var/lib/environment/plasma-phone/*.conf +ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/kded5 +BusName=org.kde.kded5 diff --git a/services/kdeinit5.service.cmake b/services/kdeinit5.service.cmake new file mode 100644 index 00000000..435032c7 --- /dev/null +++ b/services/kdeinit5.service.cmake @@ -0,0 +1,15 @@ +# +# Copyright (C) 2014 Pier Luigi Fiorini +# +# Starts kdeinit5. +# + +[Unit] +Description=kdeinit5 +Requires=dbus.socket + +[Service] +Environment=DISPLAY:0 +EnvironmentFile=-/var/lib/environment/plasma-phone/*.conf +ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/kdeinit5 +kcminit_startup --no-fork +BusName=org.kde.klauncher5 diff --git a/services/plasma-phone-compositor.service b/services/plasma-phone-compositor.service.cmake similarity index 78% rename from services/plasma-phone-compositor.service rename to services/plasma-phone-compositor.service.cmake index c2958d8d..0a9aa512 100644 --- a/services/plasma-phone-compositor.service +++ b/services/plasma-phone-compositor.service.cmake @@ -14,8 +14,8 @@ Conflicts=maui-bootsplash.service Type=notify EnvironmentFile=-/var/lib/environment/compositor/*.conf EnvironmentFile=-/var/lib/environment/greenisland/*.conf -ExecStart=/usr/bin/greenisland $LIPSTICK_OPTIONS -p org.kde.satellite.compositor.phone -Restart=always +ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/greenisland $LIPSTICK_OPTIONS -p org.kde.satellite.compositor.phone +Restart=on-failure [Install] WantedBy=user-session.target diff --git a/services/plasma-phone-kbuildsycoca5.service b/services/plasma-phone-kbuildsycoca5.service deleted file mode 100644 index ffca4319..00000000 --- a/services/plasma-phone-kbuildsycoca5.service +++ /dev/null @@ -1,15 +0,0 @@ -# -# Copyright (C) 2014 Pier Luigi Fiorini -# -# Starts kbuildsycoca5 needed by the phone UI. -# - -[Unit] -Description=kbuildsycoca5 -Requires=dbus.socket - -[Service] -ExecStart=/usr/bin/kbuildsycoca5 - -[Install] -WantedBy=user-session.target diff --git a/services/plasma-phone-kdeinit.service b/services/plasma-phone-kdeinit.service deleted file mode 100644 index 4a59c1ff..00000000 --- a/services/plasma-phone-kdeinit.service +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright (C) 2014 Pier Luigi Fiorini -# -# Starts kdeinit needed by the phone UI. -# - -[Unit] -Description=kdeinit -Requires=dbus.socket - -[Service] -Environment=LD_BIND_NOW=true -EnvironmentFile=-/var/lib/environment/plasma-phone/*.conf -ExecStart=/usr/lib/libexec/kf5/start_kdeinit_wrapper --kded +kcminit_startup - -[Install] -WantedBy=user-session.target diff --git a/services/plasma-phone-ksyncdbusenv.service b/services/plasma-phone-ksyncdbusenv.service deleted file mode 100644 index 645fcb89..00000000 --- a/services/plasma-phone-ksyncdbusenv.service +++ /dev/null @@ -1,15 +0,0 @@ -# -# Copyright (C) 2014 Pier Luigi Fiorini -# -# Starts ksyncdbus needed by the phone UI. -# - -[Unit] -Description=ksyncdbusenv -Requires=dbus.socket - -[Service] -ExecStart=/usr/lib/libexec/ksyncdbusenv - -[Install] -WantedBy=user-session.target diff --git a/services/plasma-phone-shell.service b/services/plasma-phone-shell.service deleted file mode 100644 index 25550701..00000000 --- a/services/plasma-phone-shell.service +++ /dev/null @@ -1,18 +0,0 @@ -# -# Copyright (C) 2014 Pier Luigi Fiorini -# -# Starts Plasma shell for phones. -# - -[Unit] -Description=Plasma Phone UI -Requires=dbus.socket -After=voicecall-manager.service plasma-phone-compositor.service plasma-phone-ksyncdbusenv.service plasma-phone-kbuildsycoca.service plasma-phone-kdeinit.service - -[Service] -EnvironmentFile=-/var/lib/environment/plasma-phone/*.conf -ExecStart=/usr/bin/plasmashell -p org.kde.satellite.phone -n -Restart=always - -[Install] -WantedBy=user-session.target diff --git a/services/plasma-phone-ui.service b/services/plasma-phone-ui.service deleted file mode 100644 index 5a92f735..00000000 --- a/services/plasma-phone-ui.service +++ /dev/null @@ -1,18 +0,0 @@ -# -# Copyright (C) 2014 Pier Luigi Fiorini -# -# Starts Plasma shell for phones. -# - -[Unit] -Description=Plasma Phone UI -Requires=dbus.socket -After=voicecall-manager.service plasma-phone-compositor.service - -[Service] -EnvironmentFile=-/var/lib/environment/plasma-phone/*.conf -ExecStart=/usr/bin/plasma-phone -Restart=always - -[Install] -WantedBy=user-session.target diff --git a/services/plasma-phone-ui.service.cmake b/services/plasma-phone-ui.service.cmake new file mode 100644 index 00000000..bc99067b --- /dev/null +++ b/services/plasma-phone-ui.service.cmake @@ -0,0 +1,20 @@ +# +# Copyright (C) 2014 Pier Luigi Fiorini +# +# Starts Plasma shell for phones. +# + +[Unit] +Description=Plasma Phone UI +Requires=plasma-phone-compositor.service voicecall-manager.service kded5.service +After=plasma-phone-compositor.service voicecall-manager.service + +[Service] +EnvironmentFile=-/var/lib/environment/plasma-phone/*.conf +ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/plasma-phone +ExecStop=@CMAKE_INSTALL_FULL_BINDIR@/kquitapp5 plasmashell +Restart=on-failure +BusName=org.kde.plasmashell + +[Install] +WantedBy=user-session.target