commit:     c956632e0b0b798755fb4a331bf1232540c627c0
Author:     Johannes Huber <johu <AT> gentoo <DOT> org>
AuthorDate: Wed May 28 14:42:16 2014 +0000
Commit:     Johannes Huber <johu <AT> gentoo <DOT> org>
CommitDate: Wed May 28 14:42:16 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/kde.git;a=commit;h=c956632e

[kde-base/plasma-workspace] Enable startup/shutdown script support

Package-Manager: portage-2.2.10

---
 kde-base/plasma-workspace/files/agent-shutdown.sh  | 13 +++++++
 kde-base/plasma-workspace/files/agent-startup.sh   | 29 ++++++++++++++++
 .../files/plasma-workspace-startkde-script.patch   | 40 ++++++++++++++++++++++
 .../plasma-workspace/plasma-workspace-9999.ebuild  | 26 ++++++++++++--
 4 files changed, 105 insertions(+), 3 deletions(-)

diff --git a/kde-base/plasma-workspace/files/agent-shutdown.sh 
b/kde-base/plasma-workspace/files/agent-shutdown.sh
new file mode 100644
index 0000000..fff8056
--- /dev/null
+++ b/kde-base/plasma-workspace/files/agent-shutdown.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+#
+# This file is executed at plasma shutdown.
+# Uncomment the following lines to kill the agents
+# that were started at session startup.
+
+#if [ -n "${GPG_AGENT_INFO}" ]; then
+#  kill $(echo ${GPG_AGENT_INFO} | cut -d':' -f 2) >/dev/null 2>&1
+#fi
+
+#if [ -n "${SSH_AGENT_PID}" ]; then
+#  eval "$(ssh-agent -s -k)"
+#fi

diff --git a/kde-base/plasma-workspace/files/agent-startup.sh 
b/kde-base/plasma-workspace/files/agent-startup.sh
new file mode 100644
index 0000000..03e017a
--- /dev/null
+++ b/kde-base/plasma-workspace/files/agent-startup.sh
@@ -0,0 +1,29 @@
+# Agents startup file
+#
+# This file is sourced at plasma startup, so that
+# the environment variables set here are available
+# throughout the session.
+
+# Uncomment the following lines to start gpg-agent
+# and/or ssh-agent at plasma startup.
+# If you do so, do not forget to uncomment the respective
+# lines in PLASMADIR/shutdown/agent-shutdown.sh to
+# properly kill the agents when the session ends.
+
+#if [ -x /usr/bin/gpg-agent ]; then
+#  eval "$(/usr/bin/gpg-agent --daemon)"
+#fi 
+
+#if [ -x /usr/bin/ssh-agent ]; then
+#  eval "$(/usr/bin/ssh-agent -s)"
+#fi
+
+# Uncomment the following lines to start rxvt-unicode which has the ability to
+# run multiple terminals in one single process, thus starting up faster and 
+# saving resources.
+# The --opendisplay ensures that the daemon quits when the X server terminates,
+# therefore we don't need matching lines in agent-shutdown.sh.
+
+#if [ -x /usr/bin/urxvtd ]; then
+#      /usr/bin/urxvtd --opendisplay --fork --quiet
+#fi

diff --git 
a/kde-base/plasma-workspace/files/plasma-workspace-startkde-script.patch 
b/kde-base/plasma-workspace/files/plasma-workspace-startkde-script.patch
new file mode 100644
index 0000000..8fb3756
--- /dev/null
+++ b/kde-base/plasma-workspace/files/plasma-workspace-startkde-script.patch
@@ -0,0 +1,40 @@
+From 6c3f73efc0619020a0c17219b1f7e1e3cd49478f Mon Sep 17 00:00:00 2001
+From: Johannes Huber <j...@gentoo.org>
+Date: Wed, 28 May 2014 16:00:41 +0200
+Subject: [PATCH] [startkde] Gentoo FHS script support
+
+---
+ startkde/startkde.cmake | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/startkde/startkde.cmake b/startkde/startkde.cmake
+index f073b93..1c41364 100644
+--- a/startkde/startkde.cmake
++++ b/startkde/startkde.cmake
+@@ -206,6 +206,11 @@ for prefix in `echo "$libpath" | sed -n -e 
's,/lib[^/]*/,/env/,p'`; do
+   done
+ done
+ 
++# Gentoo part for FHS installs
++for file in "@GENTOO_PORTAGE_EPREFIX@/etc/plasma/startup/"*.sh; do
++  test -r "${file}" && . "${file}"
++done
++
+ # Set the path for Qt plugins provided by KDE
+ QT_PLUGIN_PATH=${QT_PLUGIN_PATH+$QT_PLUGIN_PATH:}`qtpaths --plugin-dir`
+ # TODO: Do we really need this?
+@@ -411,6 +416,11 @@ for prefix in `echo "$libpath" | sed -n -e 
's,/lib[^/]*/,/shutdown/,p'`; do
+   done
+ done
+ 
++# Gentoo part for FHS installs
++for file in "@GENTOO_PORTAGE_EPREFIX@/etc/plasma/shutdown/"*.sh; do
++  test -r "${file}" && . "${file}"
++done
++
+ unset KDE_FULL_SESSION
+ xprop -root -remove KDE_FULL_SESSION
+ unset KDE_SESSION_VERSION
+-- 
+1.9.3
+

diff --git a/kde-base/plasma-workspace/plasma-workspace-9999.ebuild 
b/kde-base/plasma-workspace/plasma-workspace-9999.ebuild
index 2bc9036..9aa7ed8 100644
--- a/kde-base/plasma-workspace/plasma-workspace-9999.ebuild
+++ b/kde-base/plasma-workspace/plasma-workspace-9999.ebuild
@@ -93,7 +93,10 @@ DEPEND="${COMMON_DEPEND}
        X? ( x11-proto/xproto )
 "
 
-PATCHES=( "${FILESDIR}/${P}-cmake-enable-prison.patch" )
+PATCHES=(
+       "${FILESDIR}/${PN}-startkde-script.patch"
+       "${FILESDIR}/${P}-cmake-enable-prison.patch"
+)
 
 src_configure() {
        local mycmakeargs=(
@@ -108,8 +111,25 @@ src_configure() {
 src_install() {
        kde5_src_install
 
+       # startup and shutdown scripts
+       insinto /etc/plasma/startup
+       doins "${FILESDIR}/agent-startup.sh"
+
+       insinto /etc/plasma/shutdown
+       doins "${FILESDIR}/agent-shutdown.sh"
+
        # x11 session script
-       echo startkde > "${T}"/KDE-5
+       echo startkde > "${T}"/Plasma
        exeinto /etc/X11/Sessions
-       doexe "${T}"/KDE-5
+       doexe "${T}"/Plasma
+}
+
+pkg_postinst () {
+       kde5_pkg_postinst
+
+       echo
+       elog "To enable gpg-agent and/or ssh-agent in Plasma sessions,"
+       elog "edit ${EPREFIX}/etc/plasma/startup/agent-startup.sh and"
+       elog "${EPREFIX}/etc/plasma/shutdown/agent-shutdown.sh"
+       echo
 }

Reply via email to