[SCM] xbmc packaging branch, master, updated. upstream/9.11.svn24886.deb1-44-g5d70c70

ceros-guest at users.alioth.debian.org ceros-guest at users.alioth.debian.org
Tue Dec 1 16:24:58 UTC 2009


The following commit has been merged in the master branch:
commit 37630a14b20c3708b131a1f2fa1734f8f404b53b
Author: Andres Mejia <mcitadel at gmail.com>
Date:   Tue Dec 1 11:21:12 2009 -0500

    Include updates for packaging xbmc-live.

diff --git a/tools/XBMCLive/xbmc-live b/debian/xbmc-live.init
similarity index 100%
copy from tools/XBMCLive/xbmc-live
copy to debian/xbmc-live.init
diff --git a/debian/xbmc-live.install b/debian/xbmc-live.install
index 2732055..d586a77 100644
--- a/debian/xbmc-live.install
+++ b/debian/xbmc-live.install
@@ -2,3 +2,4 @@ usr/bin/diskmounter
 usr/bin/installXBMC
 usr/bin/runXBMC
 usr/bin/setAlsaVolumes
+etc/init/xbmc-live.conf
diff --git a/debian/xbmc-live.postinst b/debian/xbmc-live.postinst
old mode 100644
new mode 100755
index 2a59f13..0ef3284
--- a/debian/xbmc-live.postinst
+++ b/debian/xbmc-live.postinst
@@ -1,4 +1,7 @@
 #!/bin/sh
+# postinst script for xbmc-live
+#
+# see: dh_installdeb(1)
 
 set -e
 
@@ -8,52 +11,44 @@ case "$1" in
 	# get a console session going, we're in trouble anyway. ceros
 	sed -i.bak-xbmc-live s/allowed_users=console/allowed_users=anybody/ /etc/X11/Xwrapper.config
 
-	# Add the 'xbmc' user
-	if ! getent passwd xbmc >/dev/null; then
-            adduser \
-                --gecos "XBMC Live User" \
-                --disabled-password \
-                xbmc >/dev/null
+	# Add the 'xbmc' user if the primary one is missing
+	xbmcUser=$(getent passwd 1000 | sed -e 's/\:.*//')
+	if [ ! -n "$xbmcUser" ]; then
+		adduser --gecos "XBMC Live User" xbmc
+		xbmcUser=xbmc
 	fi
-	# Add 'xbmc' user to the appropriate groups
+
+	# Add 'xbmcUser' user to the appropriate groups
+	# Below is a listing of groups and their purpose
+	# adm - For reading system logs (minimal systems may have this user only)
+	# sudo - allow optional passwordless sudo (with trivial intervention on /etc/sudoers)
+	# cdrom - optical disc drive access
+	# floppy - floppy drive access
+	# audio - audio device access
+	# video - video device access
+	# plugdev - enable automatic notifications of new devices
+	# netdev - managing network connections via NetworkManager
+	# powerdev - to be able to hibernate/suspend
+	# fuse - to be able to mount filesystems as normal user
+	GROUPS="adm
+		sudo
+		cdrom
+		floppy
+		audio
+		video
+		plugdev
+		netdev
+		powerdev
+		fuse"
+
 	# TODO: this probably isn't necessary anymore as PolicyKit is now being
 	# used
-	# For reading system logs (still not sure why xbmc needs this though)
-	if ! getent group adm | grep xbmc > /dev/null; then
-		adduser xbmc adm || true
-	fi
-	# For optical disc drive access
-	if ! getent group cdrom | grep xbmc > /dev/null; then
-		adduser xbmc cdrom || true
-	fi
-	# For floppy drive access
-	if ! getent group floppy | grep xbmc > /dev/null; then
-		adduser xbmc floppy || true
-	fi
-	# For audio device access
-	if ! getent group audio | grep xbmc > /dev/null; then
-		adduser xbmc audio || true
-	fi
-	# For video device access
-	if ! getent group video | grep xbmc > /dev/null; then
-		adduser xbmc video || true
-	fi
-	# To enable automatic notifications of new devices
-	if ! getent group plugdev | grep xbmc > /dev/null; then
-		adduser xbmc plugdev || true
-	fi
-	# For managing network connections via NetworkManager
-	if ! getent group netdev | grep xbmc > /dev/null; then
-		adduser xbmc netdev || true
-	fi
-	# To be able to hibernate/suspend
-	if ! getent group powerdev | grep xbmc > /dev/null; then
-		adduser xbmc powerdev || true
-	fi
-	# To be able to mount filesystems as normal user
-	if ! getent group fuse | grep xbmc > /dev/null; then
-		adduser xbmc fuse || true
-	fi
+	for GROUP in $GROUPS; do
+		if getent group $GROUP >/dev/null && \
+			! getent group $GROUP | grep -q $xbmcUser; then
+			adduser $xbmcUser $GROUP
+		fi
+	done
 
 	# Our set of PolicyKit actions
 
@@ -97,11 +92,17 @@ case "$1" in
 		org.freedesktop.hal.power-management.cpufreq
 		org.freedesktop.hal.power-management.lcd-panel
 		org.freedesktop.hal.power-management.light-sensor
-		org.freedesktop.hal.power-management.keyboard-backlight"
+		org.freedesktop.hal.power-management.keyboard-backlight
+		org.freedesktop.devicekit.power.suspend
+		org.freedesktop.devicekit.power.Hibernate
+		org.freedesktop.consolekit.system.stop"
 
-	# Grant the 'xbmc' user each action from the list
+	# Grant the 'xbmc' user each action from the list if not done already
 	for ACTION in $POLKIT_ACTIONS; do
-		polkit-auth --user xbmc --grant $ACTION || true
+		if polkit-auth --user $xbmcUser --show-obtainable | \
+			grep -q $ACTION; then
+			polkit-auth --user $xbmcUser --grant $ACTION
+		fi
 	done
     ;;
 
@@ -114,6 +115,35 @@ case "$1" in
     ;;
 esac
 
+# Upstart scripts tested on karmic only and not backward compatible ATM
+if [ "$(lsb_release -c | grep karmic)" ]; then
+	if [ -f "/etc/init.d/xbmc-live" ]; then
+		rm /etc/init.d/xbmc-live >/dev/null
+		update-rc.d -f xbmc-live remove >/dev/null
+	fi
+
+	ln -s /lib/init/upstart-job /etc/init.d/xbmc-live
+else
+	if [ -f "/etc/init/xbmc-live.conf" ]; then
+		rm /etc/init/xbmc-live.conf >/dev/null
+	fi
+	if [ -f "/etc/init/xbmc-live-install" ]; then
+		rm /etc/init/xbmc-live-install.conf >/dev/null
+	fi
+
+	if [ -x "/etc/init.d/xbmc-live" ]; then
+		update-rc.d xbmc-live defaults >/dev/null
+		if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+			invoke-rc.d xbmc-live start || exit $?
+		else
+			/etc/init.d/xbmc-live start || exit $?
+		fi
+	fi
+fi
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
 #DEBHELPER#
 
 exit 0
diff --git a/tools/XBMCLive/postrm b/debian/xbmc-live.postrm
similarity index 93%
copy from tools/XBMCLive/postrm
copy to debian/xbmc-live.postrm
index 209173a..2bc1ba3 100755
--- a/tools/XBMCLive/postrm
+++ b/debian/xbmc-live.postrm
@@ -1,10 +1,11 @@
 #!/bin/sh
+# postrm script for xbmc-live
+#
+# see: dh_installdeb(1)
 
 set -e
 if [ "$1" = "purge" ]                                                    
 then                            
-	sed -i -e "/XBMC/d" /etc/sudoers
-
 	POLKIT_ACTIONS="org.freedesktop.hal.dockstation.undock
 		org.freedesktop.hal.wol.enabled
 		org.freedesktop.hal.wol.enable
@@ -72,5 +73,10 @@ fi
 
 update-rc.d -f xbmc-live remove >/dev/null
 
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
 exit 0
 

-- 
xbmc packaging



More information about the pkg-multimedia-commits mailing list