ports/kde4 (3.0): kde-workspace: Added post-install and startup script for kdm
commit a16e2b0946e471ea1bbb4627d02585842d50e9fc Author: Alan Mizrahi <alan+crux@mizrahi.com.ve> Date: Wed Feb 26 00:06:56 2014 +0900 kde-workspace: Added post-install and startup script for kdm diff --git a/kde-workspace/.footprint b/kde-workspace/.footprint index fea81f6..2cbc2ee 100644 --- a/kde-workspace/.footprint +++ b/kde-workspace/.footprint @@ -1,3 +1,6 @@ +drwxr-xr-x root/root etc/ +drwxr-xr-x root/root etc/rc.d/ +-rwxr-xr-x root/root etc/rc.d/kdm drwxr-xr-x root/root usr/ drwxr-xr-x root/root usr/bin/ -rwxr-xr-x root/root usr/bin/genkdmconf @@ -1411,7 +1414,6 @@ drwxr-xr-x root/root usr/share/config/ drwxr-xr-x root/root usr/share/config/kdm/ -rw-r--r-- root/root usr/share/config/kdm/Xaccess -rwxr-xr-x root/root usr/share/config/kdm/Xreset --rw-r--r-- root/root usr/share/config/kdm/Xresources -rwxr-xr-x root/root usr/share/config/kdm/Xsession -rwxr-xr-x root/root usr/share/config/kdm/Xsetup -rwxr-xr-x root/root usr/share/config/kdm/Xstartup diff --git a/kde-workspace/.md5sum b/kde-workspace/.md5sum index e0f90cc..2be25bc 100644 --- a/kde-workspace/.md5sum +++ b/kde-workspace/.md5sum @@ -1 +1,2 @@ 2bed3dcf2860ceba4609ae64a8bac923 kde-workspace-4.11.5.tar.xz +ee2a38b05282adff3c3b17e0faf87b61 kdm.rc diff --git a/kde-workspace/Pkgfile b/kde-workspace/Pkgfile index 83906a9..490303f 100644 --- a/kde-workspace/Pkgfile +++ b/kde-workspace/Pkgfile @@ -6,8 +6,8 @@ name=kde-workspace version=4.11.5 -release=1 -source=(http://download.kde.org/stable/$version/src/$name-$version.tar.xz) +release=2 +source=(http://download.kde.org/stable/$version/src/$name-$version.tar.xz kdm.rc) build() { # To prevent compilation of a particular component, set DO_NOT_COMPILE @@ -28,5 +28,8 @@ build() { $DO_NOT_COMPILE make make DESTDIR=$PKG install + + install -D -m 755 $SRC/kdm.rc $PKG/etc/rc.d/kdm + find $PKG -name README -delete } diff --git a/kde-workspace/kdm.rc b/kde-workspace/kdm.rc new file mode 100755 index 0000000..52c301c --- /dev/null +++ b/kde-workspace/kdm.rc @@ -0,0 +1,76 @@ +#!/bin/bash + +NAME=kdm +USER=root +RUNDIR=/var/run +PIDFILE=$RUNDIR/kdm.pid +STARTCMD="/usr/bin/kdm -config /etc/X11/kdm/kdmrc" +STOPCMD="" +STOPTIMEOUT=300 + +function getpid() { + if [ -z "$PIDFILE" ]; then + pid="$(pgrep -xfn "$STARTCMD")" + else + if [ -f "$PIDFILE" ]; then + pid=$(< $PIDFILE) + if [ ! -d /proc/"$pid" ]; then + echo "$NAME: removing stale pidfile $PIDFILE" >&2 + rm -f "$PIDFILE" + unset pid + fi + fi + fi + echo "$pid" +} + +case $1 in +start) + pid=$(getpid) + install -d -m 755 -o $USER $RUNDIR || exit 1 + if [ -n "$pid" ]; then + echo "$NAME already running with pid $pid" >&2 + exit 1 + fi + eval "$STARTCMD" + ;; +stop) + pid=$(getpid) + if [ -n "$pid" ]; then + if [ -n "$STOPCMD" ]; then + eval "$STOPCMD" + else + kill "$pid" + fi + t=$(printf '%(%s)T' -1) + tend=$((t+STOPTIMEOUT)) + while [ -d /proc/$pid -a $t -lt $tend ]; do + sleep 0.5 + t=$(printf '%(%s)T' -1) + done + if [ -d /proc/"$pid" ]; then + echo "$NAME still running with pid $pid" >&2 + else + [ -n "$PIDFILE" ] && rm -f "$PIDFILE" + fi + else + echo "$NAME is not running" >&2 + fi + ;; +restart) + $0 stop + $0 start + ;; +status) + pid=$(getpid) + if [ -n "$pid" ]; then + echo "$NAME is running with pid $pid" + else + echo "$NAME is not running" + fi + ;; +*) + echo "usage: $0 [start|stop|restart|status]" + ;; +esac + diff --git a/kde-workspace/post-install b/kde-workspace/post-install new file mode 100644 index 0000000..5e1c7bb --- /dev/null +++ b/kde-workspace/post-install @@ -0,0 +1,11 @@ +#!/bin/sh + +set -x + +# Generate kdm configuration, merges old config if it exists +genkdmconf --no-backup --in /etc/X11/kdm + +rm -f /etc/X11/kdm/README + +getent group kdm >/dev/null || groupadd -r kdm +getent passwd kdm >/dev/null || useradd -r -M -g kdm -s /bin/false kdm
participants (1)
-
crux@crux.nu