[csw-devel] SF.net SVN: gar:[2328] csw/trunk/lib/dbus

wbonnet at users.sourceforge.net wbonnet at users.sourceforge.net
Thu Nov 20 22:06:03 CET 2008


Revision: 2328
          http://gar.svn.sourceforge.net/gar/?rev=2328&view=rev
Author:   wbonnet
Date:     2008-11-20 21:06:03 +0000 (Thu, 20 Nov 2008)

Log Message:
-----------
Update dbus to 1.2.4

Modified Paths:
--------------
    csw/trunk/lib/dbus/Makefile
    csw/trunk/lib/dbus/checksums
    csw/trunk/lib/dbus/files/CSWdbus.depend
    csw/trunk/lib/dbus/files/CSWdbus.postinstall
    csw/trunk/lib/dbus/files/CSWdbus.prototype

Added Paths:
-----------
    csw/trunk/lib/dbus/files/CSWdbus.preinstall
    csw/trunk/lib/dbus/files/CSWdbus.preremove
    csw/trunk/lib/dbus/files/checkinstall
    csw/trunk/lib/dbus/files/cswdbus
    csw/trunk/lib/dbus/files/dbus.xml
    csw/trunk/lib/dbus/files/i.smfno
    csw/trunk/lib/dbus/files/i.smfyes
    csw/trunk/lib/dbus/files/space
    csw/trunk/lib/dbus/files/svc-dbus

Modified: csw/trunk/lib/dbus/Makefile
===================================================================
--- csw/trunk/lib/dbus/Makefile	2008-11-20 10:30:34 UTC (rev 2327)
+++ csw/trunk/lib/dbus/Makefile	2008-11-20 21:06:03 UTC (rev 2328)
@@ -1,5 +1,5 @@
 GARNAME      = dbus
-GARVERSION   = 1.2.1
+GARVERSION   = 1.2.4
 CATEGORIES   = libs
 
 DESCRIPTION  = DBus Message Bus System
@@ -12,7 +12,8 @@
 MASTER_SITES  = http://dbus.freedesktop.org/releases/dbus/
 DISTFILES     = $(GARNAME)-$(GARVERSION).tar.gz 
 PKGDIST       = $(GARNAME)-$(GARVERSION).tar.gz 
-DISTFILES    += CSWdbus.gspec CSWdbus.prototype CSWdbus.depend CSWdbus.postinstall
+DISTFILES    += CSWdbus.gspec CSWdbus.prototype CSWdbus.depend CSWdbus.postinstall CSWdbus.preinstall checkinstall 
+DISTFILES    += space i.smfno i.smfyes svc-dbus dbus.xml cswdbus CSWdbus.preremove
 DISTFILES    += CSWlibdbus.gspec CSWlibdbus.prototype CSWlibdbus.depend
 DISTFILES    += CSWlibdbusdev.gspec CSWlibdbusdev.prototype CSWlibdbusdev.depend
 # DISTFILES    += $(call admfiles,CSWdbus, depend)
@@ -30,5 +31,10 @@
 CONFIGURE_ARGS = --prefix=/opt/csw --mandir=/opt/csw/share/man --disable-tests --with-xml=expat
 
 post-install:
+	( mkdir -p $(DESTDIR)/etc/init.d )
+	( mkdir -p $(DESTDIR)/etc/rc3.d )
+	( cp -fr $(FILEDIR)/csw$(GARNAME) $(DESTDIR)/etc/init.d )
+	( rm -f $(DESTDIR)/etc/rc3.d/S52$(GARNAME) )
+	( ln -s /etc/init.d/csw$(GARNAME) $(DESTDIR)/etc/rc3.d/S52$(GARNAME) )
 	( gfind $(DESTDIR)/opt/csw -exec bash -c "file {} | ggrep ELF | ggrep -e 'executable' -e 'dynamic lib' | ggrep 'not stripped' && strip {}"  \; )
 

Modified: csw/trunk/lib/dbus/checksums
===================================================================
--- csw/trunk/lib/dbus/checksums	2008-11-20 10:30:34 UTC (rev 2327)
+++ csw/trunk/lib/dbus/checksums	2008-11-20 21:06:03 UTC (rev 2328)
@@ -1,8 +1,17 @@
-b57aa1ba0834cbbb1e7502dc2cbfacc2  download/dbus-1.2.1.tar.gz
+2e643910a09f44b000a0d76038637999  download/dbus-1.2.4.tar.gz
 0956c2a4c626eaa494d6c95aeed3f335  download/CSWdbus.gspec
-23e3ca2b86b2223e1365fd707ceb5c88  download/CSWdbus.prototype
-2f8aaccc9f4392b052607b4bbc710ebd  download/CSWdbus.depend
-64556a535f59e23bc4bb1d15b84787eb  download/CSWdbus.postinstall
+f6e781fcc74d4444b18dd17be11153c5  download/CSWdbus.prototype
+81bc75f2ab42dfeb22ecbf8a0db0b2ba  download/CSWdbus.depend
+b093e0816fcca4ec08c41da64be36ff3  download/CSWdbus.postinstall
+6e26e51243c4551ac222112edf67b5db  download/CSWdbus.preinstall
+e62348be24eef2faf9c9e3af5de0e209  download/checkinstall
+f49c3339aa897df97abf1baf54582fb8  download/space
+848ef38127a2c97a70aa1732431f0ac4  download/i.smfno
+bf067dcada44a3d278d67fbec727e197  download/i.smfyes
+2d0ded68e596460871964b9db97b975b  download/svc-dbus
+b55ad85eb459a4d591f30ec70bf1c872  download/dbus.xml
+72c43660ee96009043746c6d4894b02c  download/cswdbus
+a6e0e854f20c9fe8c3c7f486ac0b3912  download/CSWdbus.preremove
 c1e411b511a659e3b8d0803364226019  download/CSWlibdbus.gspec
 8575354d3ed4f3252913a9af03994386  download/CSWlibdbus.prototype
 d41d8cd98f00b204e9800998ecf8427e  download/CSWlibdbus.depend

Modified: csw/trunk/lib/dbus/files/CSWdbus.depend
===================================================================
--- csw/trunk/lib/dbus/files/CSWdbus.depend	2008-11-20 10:30:34 UTC (rev 2327)
+++ csw/trunk/lib/dbus/files/CSWdbus.depend	2008-11-20 21:06:03 UTC (rev 2328)
@@ -2,3 +2,4 @@
 P CSWlibxml2     libxml2 - XML Parser Library
 P CSWzlib        zlib - Zlib Data Compression Library
 P CSWlibdbus     libdbus - DBus Message Bus System - dynamic libraries
+P CSWexpat

Modified: csw/trunk/lib/dbus/files/CSWdbus.postinstall
===================================================================
--- csw/trunk/lib/dbus/files/CSWdbus.postinstall	2008-11-20 10:30:34 UTC (rev 2327)
+++ csw/trunk/lib/dbus/files/CSWdbus.postinstall	2008-11-20 21:06:03 UTC (rev 2328)
@@ -13,4 +13,30 @@
     /opt/csw/bin/dbus-uuidgen --ensure
 fi
 
+# Set variable smf depending on the availability of SMF binaries
+smf=no
+if [ -f /usr/sbin/svccfg -a -f /usr/sbin/svcadm ]
+	then
+  	smf=yes
+fi
+
+# If needed, configure SMF
+if [ $smf = yes ]
+then
+	# Register with SMF
+	echo "Configuring service in SMF"
+	/usr/sbin/svccfg import /opt/csw/var/svc/manifest/system/dbus.xml >/dev/null 2>&1
+	/usr/sbin/svcadm disable svc:/system/cswdbus >/dev/null 2>&1
+	echo "DBus is using Service Management Facility.  The FMRI is:"
+	echo "  svc:/system/cswdbus:default"
+	echo "Starting dbus..."
+	if [ $smf = no ]
+	then
+		/etc/init.d/cswdbus start
+	else
+		/usr/sbin/svcadm enable svc:/system/cswdbus
+	fi
+fi
+
+
 exit 0

Added: csw/trunk/lib/dbus/files/CSWdbus.preinstall
===================================================================
--- csw/trunk/lib/dbus/files/CSWdbus.preinstall	                        (rev 0)
+++ csw/trunk/lib/dbus/files/CSWdbus.preinstall	2008-11-20 21:06:03 UTC (rev 2328)
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# test if the messagebus group exist, if not create it
+eval getent group messagebus > /dev/null
+if test $? -gt 0
+then 
+	groupadd messagebus > /dev/null
+	echo group messagebus has been added
+	
+	eval getent group messagebus > /dev/null
+	if test $? -gt 0
+	then
+		echo ERROR: Failed to add group messagebus
+		exit 1
+	fi
+fi
+
+# test if the messagebus user exist, if not create it
+eval getent passwd messagebus > /dev/null
+if test $? -gt 0
+then 	
+	useradd -c "DBus daemon user" -g messagebus -d /opt/csw/share -s /bin/sh messagebus > /dev/null
+	echo user messagebus has been added
+
+	eval getent passwd messagebus > /dev/null
+	if test $? -gt 0
+	then 	
+		echo ERROR: Failed to add user messagebus
+		exit 1
+	fi
+fi
+

Added: csw/trunk/lib/dbus/files/CSWdbus.preremove
===================================================================
--- csw/trunk/lib/dbus/files/CSWdbus.preremove	                        (rev 0)
+++ csw/trunk/lib/dbus/files/CSWdbus.preremove	2008-11-20 21:06:03 UTC (rev 2328)
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+smf=no
+if [ -f /usr/sbin/svccfg -a -f /usr/sbin/svcadm ] ;
+then smf=yes ; fi
+
+if [ $smf = yes ]
+  then
+  # Disable service
+     /usr/sbin/svcadm disable -s svc:system/cswdbus:default >/dev/null 2>&1
+
+   # Unregister with SMF
+   /usr/sbin/svccfg delete svc:system/cswdbus:default >/dev/null 2>&1
+fi

Modified: csw/trunk/lib/dbus/files/CSWdbus.prototype
===================================================================
--- csw/trunk/lib/dbus/files/CSWdbus.prototype	2008-11-20 10:30:34 UTC (rev 2327)
+++ csw/trunk/lib/dbus/files/CSWdbus.prototype	2008-11-20 21:06:03 UTC (rev 2328)
@@ -26,8 +26,22 @@
 f none /opt/csw/share/man/man1/dbus-send.1 0644 root bin
 f none /opt/csw/share/man/man1/dbus-uuidgen.1 0644 root bin
 d none /opt/csw/var/lib/dbus 0755 root bin
-d none /opt/csw/var/run/dbus 0755 root bin
+d none /opt/csw/var/run/dbus 0777 root bin
+f smfno /etc/init.d/cswdbus 0755 root bin
+l smfno /etc/rc3.d/S52cswdbus=/etc/init.d/cswdbus
+d smfyes /opt/csw/var/svc 0755 root bin
+d smfyes /opt/csw/var/svc/manifest 0755 root bin
+d smfyes /opt/csw/var/svc/manifest/system 0755 root bin
+f smfyes /opt/csw/var/svc/manifest/system/dbus.xml=dbus.xml 0644 root bin
+d smfyes /opt/csw/lib/svc 0755 root bin
+d smfyes /opt/csw/lib/svc/method 0755 root bin
+f smfyes /opt/csw/lib/svc/method/svc-dbus=svc-dbus 0755 root bin
 i copyright=CSWdbus.copyright
 i depend=CSWdbus.depend
 i pkginfo=CSWdbus.pkginfo
 i postinstall=CSWdbus.postinstall
+i preinstall=CSWdbus.preinstall
+i checkinstall
+i i.smfno
+i i.smfyes
+i space

Added: csw/trunk/lib/dbus/files/checkinstall
===================================================================
--- csw/trunk/lib/dbus/files/checkinstall	                        (rev 0)
+++ csw/trunk/lib/dbus/files/checkinstall	2008-11-20 21:06:03 UTC (rev 2328)
@@ -0,0 +1,21 @@
+# dbus - checkinstall script
+#
+trap `exit 3` 15
+
+# Assign Solaris release class to install release specific files
+smf=no
+if [ -f /usr/sbin/svccfg -a -f /usr/sbin/svcadm ] ; then smf=yes ; fi
+if [ $smf = yes ]
+then
+        CLASSES='none smfyes'
+else
+        CLASSES='none smfno'
+fi
+
+# Make env variables available to other packaging scripts
+
+cat >$1 <<!
+CLASSES='$CLASSES'
+!
+
+exit 0

Added: csw/trunk/lib/dbus/files/cswdbus
===================================================================
--- csw/trunk/lib/dbus/files/cswdbus	                        (rev 0)
+++ csw/trunk/lib/dbus/files/cswdbus	2008-11-20 21:06:03 UTC (rev 2328)
@@ -0,0 +1,39 @@
+#!/sbin/sh
+
+DBUS_VAR_DIR=/opt/csw/var/lib/dbus
+DBUS_VAR_RUN_DIR=/opt/csw/var/lib/dbus
+DBUS_MACHINE_ID_FILE=machine-id
+
+if [ ! -d $DBUS_VAR_DIR ]; then
+    mkdir -p $DBUS_VAR_DIR
+fi
+
+if [ ! -f $DBUS_VAR_DIR/$DBUS_MACHINE_ID_FILE ]; then
+    /opt/csw/bin/dbus-uuidgen --ensure
+fi
+
+
+case $1 in 
+'start')
+        if [ ! -d $DBUS_VAR_DIR ]; then
+                mkdir -p $DBUS_VAR_DIR
+        fi
+        if [ -f $DBUS_VAR_DIR/pid ]; then
+                rm -f $DBUS_VAR_DIR/pid
+        fi
+
+        /opt/csw/bin/dbus-daemon --system
+        err=$?
+        if [ $err -ne 0 ]; then
+                echo "dbus failed to start: error $err"
+                exit 1
+        fi
+        ;;
+
+*)
+        echo "Usage: $0 { start }"
+        exit 1
+        ;;
+esac    
+
+exit 0


Property changes on: csw/trunk/lib/dbus/files/cswdbus
___________________________________________________________________
Added: svn:executable
   + *

Added: csw/trunk/lib/dbus/files/dbus.xml
===================================================================
--- csw/trunk/lib/dbus/files/dbus.xml	                        (rev 0)
+++ csw/trunk/lib/dbus/files/dbus.xml	2008-11-20 21:06:03 UTC (rev 2328)
@@ -0,0 +1,29 @@
+<?xml version='1.0'?>
+<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
+
+<service_bundle type='manifest' name='CSWdbus:dbus'>
+	<service name='system/cswdbus' type='service' version='1'>
+		<create_default_instance enabled='true' />
+	 	<single_instance />
+
+		<dependency name='usr' grouping='require_all' restart_on='none' type='service'>
+			<service_fmri value='svc:/system/filesystem/local' />
+		</dependency>
+	
+		<exec_method type='method' name='start' exec='/opt/csw/lib/svc/method/svc-dbus start' timeout_seconds='30'>
+            <method_context working_directory='/opt/csw/share/dbus-1'>
+				<method_credential user='root' group='root' />
+			</method_context>
+		</exec_method>
+		
+		<exec_method type='method' name='stop' exec=':kill' timeout_seconds='30'>
+		</exec_method>
+
+        <property_group name='startd' type='framework'>
+                <!-- sub-process core dumps shouldn't restart session -->
+                <propval name='ignore_error' type='astring' value='core,signal' />
+        </property_group>
+		
+	</service>
+
+</service_bundle>

Added: csw/trunk/lib/dbus/files/i.smfno
===================================================================
--- csw/trunk/lib/dbus/files/i.smfno	                        (rev 0)
+++ csw/trunk/lib/dbus/files/i.smfno	2008-11-20 21:06:03 UTC (rev 2328)
@@ -0,0 +1,15 @@
+# dbus - i.smfno script
+#
+# Copy the non-SMF specific files to the base directory.
+# The files to copy are:
+# /etc/init.d/cswdbus=cswdbus
+# /etc/rc3.d/S52cswdbus=/etc/init.d/cswdbus
+#
+echo "Installing class <smfno>."
+while read src dest
+do
+        # Do copy
+        /usr/bin/cp $src $dest || exit 2
+        echo $dest
+done
+exit 0

Added: csw/trunk/lib/dbus/files/i.smfyes
===================================================================
--- csw/trunk/lib/dbus/files/i.smfyes	                        (rev 0)
+++ csw/trunk/lib/dbus/files/i.smfyes	2008-11-20 21:06:03 UTC (rev 2328)
@@ -0,0 +1,20 @@
+# dbus - i.smfyes script
+#
+# Copy the SMF specific files to the base directory.
+# The files specific to SMF are:
+# /opt/csw/var/svc
+# /opt/csw/var/svc/manifest
+# /opt/csw/var/svc/manifest/system
+# /opt/csw/var/svc/manifest/system/dbus.xml=/dbus.xml
+# /opt/csw/lib/svc
+# /opt/csw/lib/svc/method
+# /opt/csw/lib/svc/method/svc-dbus
+#
+echo "Installing class <smfyes>."
+while read src dest
+do
+        # Do copy
+        /usr/bin/cp $src $dest || exit 2
+        echo $dest
+done
+exit 0

Added: csw/trunk/lib/dbus/files/space
===================================================================
--- csw/trunk/lib/dbus/files/space	                        (rev 0)
+++ csw/trunk/lib/dbus/files/space	2008-11-20 21:06:03 UTC (rev 2328)
@@ -0,0 +1,3 @@
+# No additional space is actually needed.
+# In fact, only one set of the Solaris release specific files are installed.
+# So the space required for this package is less than what is in pkgmap.

Added: csw/trunk/lib/dbus/files/svc-dbus
===================================================================
--- csw/trunk/lib/dbus/files/svc-dbus	                        (rev 0)
+++ csw/trunk/lib/dbus/files/svc-dbus	2008-11-20 21:06:03 UTC (rev 2328)
@@ -0,0 +1,72 @@
+#!/sbin/sh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+# ident	"@(#)svc-dbus	1.1	06/04/24 SMI"
+
+FMRI=svc:/system/dbus:default
+
+. /lib/svc/share/smf_include.sh
+
+if [ ! -x /usr/lib/dbus-daemon ]; then
+	echo "/usr/lib/dbus-daemon not found or not executable"
+	exit $SMF_EXIT_ERR_FATAL
+fi
+
+# Generate machine-id regardless of zones
+if [ ! -f /var/lib/dbus/machine-id ]; then
+	/usr/bin/dbus-uuidgen --ensure
+fi
+
+if smf_is_nonglobalzone; then
+	   /usr/sbin/svcadm disable -t svc:/system/dbus
+        echo "dbus-daemon cannot be run in non-global zones"
+	   sleep 5 &
+	   exit $SMF_EXIT_OK
+fi
+
+case "$1" in
+'start')
+	# temporary hacks
+	if [ ! -d /var/run/dbus ]; then
+		mkdir /var/run/dbus
+	fi
+	if [ -f /var/run/dbus/pid ]; then
+		rm -f /var/run/dbus/pid
+	fi
+
+	/usr/lib/dbus-daemon --system
+	err=$?
+	if [ $err -ne 0 ]; then
+		echo "dbus failed to start: error $err"
+		exit $SMF_EXIT_ERR_FATAL
+	fi
+
+	;;
+*)
+        echo "Usage: $0 { start }"
+	exit $SMF_EXIT_ERR_FATAL 
+        ;;
+esac
+
+exit $SMF_EXIT_OK


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list