dbus: add a rc.d script, create dbus user/group dbus for binpkgs.

--HG--
extra : convert_revision : 48ea6899a325893f2d5ca0f61159b37085e79a47
This commit is contained in:
Juan RP 2009-03-20 06:02:37 +01:00
parent 509b140eba
commit b2878b7a9e
4 changed files with 73 additions and 4 deletions

26
templates/dbus/INSTALL Normal file
View File

@ -0,0 +1,26 @@
#
# This script fixes permissions for dbus-daemon-launch-helper
# and creates the dbus system user/group.
#
dbus_launch="./usr/libexec/dbus-daemon-launch-helper"
case "$2" in
pre)
;;
post)
echo "Running $3-$4 post installation hooks..."
if getent group dbus >/dev/null; then
chroot . groupadd -r dbus
[ $? -eq 0 ] && echo "Created dbus system group."
fi
if getent passwd dbus >/dev/null; then
chroot . useradd -c "System message bus" \
-d /var/run/dbus \
-s /sbin/nologin -g dbus -r dbus && \
chroot . passwd -l dbus &>/dev/null
[ $? -eq 0 ] && echo "Created dbus system user."
fi
chroot . chown root:dbus ${dbus_launch}
chroot . chmod 4750 ${dbus_launch}
;;
esac

11
templates/dbus/REMOVE Normal file
View File

@ -0,0 +1,11 @@
#
# This script removes the dbus user/group.
#
case "$2" in
pre)
chroot . userdel dbus &>/dev/null
[ $? -eq 0 ] && echo "Removed dbus system user/group."
;;
post)
;;
esac

27
templates/dbus/files/dbus Normal file
View File

@ -0,0 +1,27 @@
#!/bin/sh
#
# PROVIDE: dbus
# REQUIRE: DAEMON
# KEYWORD: shutdown
. /etc/rc.subr
name="dbus"
rcvar=$name
command="/usr/bin/dbus-daemon"
command_args="--system"
pidfile="/var/run/dbus/pid"
start_precmd=dbus_prestart
dbus_prestart() {
dir="/var/run/dbus"
if [ ! -d $dir ]; then
mkdir $dir
chmod 0755 $dir
chown dbus:dbus $dir
fi
/usr/bin/dbus-uuidgen --ensure
}
load_rc_config $name
run_rc_command "$1"

View File

@ -1,13 +1,12 @@
# Template file for 'dbus'
pkgname=dbus
sourcepkg=dbus
sourcepkg=$pkgname
version=1.2.12
distfiles="http://dbus.freedesktop.org/releases/dbus/$pkgname-$version.tar.gz"
build_style=gnu_configure
configure_args="--disable-selinux --enable-userdb-cache --with-xml=expat
--localstatedir=/var --without-x"
make_install_args="DBUS_DAEMONDIR=$XBPS_DESTDIR/$pkgname-$version/usr/sbin
DBUS_DATADIR=$XBPS_DESTDIR/$pkgname-$version/usr/share"
--localstatedir=/var --without-x --disable-dnotify --enable-inotify
--with-dbus-user=dbus"
short_desc="Message bus system"
maintainer="Juan RP <xtraeme@gmail.com>"
checksum=b2ec81e7d9fa5e24f67baccfd9af2755a7797a65cb4c3cad10d023867f2bd220
@ -30,3 +29,9 @@ Add_dependency full glibc
Add_dependency full expat
Add_dependency run dbus-libs
Add_dependency build pkg-config
post_install()
{
rm -rf ${DESTDIR}/var/run
install -D -m755 ${FILESDIR}/dbus ${DESTDIR}/etc/rc.d/dbus
}