Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=openjava.git;a=commitdiff;h=8ab57d98d8a8de3e8154c5b0c00f3fef4eee8c52
commit 8ab57d98d8a8de3e8154c5b0c00f3fef4eee8c52 Author: James Buren <r...@frugalware.org> Date: Tue Jun 5 01:33:43 2012 -0500 dbus-1.4.16-2-x86_64 * convert to use systemd schema diff --git a/source/base/dbus/FrugalBuild b/source/base/dbus/FrugalBuild index 5114c34..ccf10d2 100644 --- a/source/base/dbus/FrugalBuild +++ b/source/base/dbus/FrugalBuild @@ -3,7 +3,7 @@ pkgname=dbus pkgver=1.4.16 -pkgrel=1 +pkgrel=2 pkgdesc="A message bus system" url="http://freedesktop.org/wiki/Software/dbus" depends=('libxml2>=2.7.8' 'expat') @@ -23,6 +23,10 @@ sha1sums=('d6e6538cfc1ed71992f6786a6da55d815d995b5b' \ '740af74eb43cadf1277346029577aadd3d10f2b5' \ '9009283707f5cdf0f883876f80596bc44cc8722c') +_F_systemd_scriptlet="$pkgname.install" +_F_systemd_units=(dbus=e) +Finclude systemd + subpkgs=('dbus-x11') subconflicts=('dbus-gtk+2') subreplaces=('dbus-gtk+2') @@ -64,9 +68,6 @@ build() ## Install wrapper Fexe /usr/bin/dbus-1-launch - ## we use /usr/env for KDE3 so let us symlink to there - Fln /usr/bin/dbus-1-launch /usr/env/dbus-1-launch.sh - ## and we use /etc/xdg/autostart for GNOME/XFCE Fexe /etc/xdg/autostart/dbus-1-launch.desktop @@ -80,8 +81,9 @@ d $Flocalstatedir/run/console 0755 root root - d $Flocalstatedir/run/dbus 0755 root root - EOF - Fsplit dbus-x11 usr/bin/dbus-launch usr/env /etc/xdg usr/bin/dbus-1-launch + Fsplit dbus-x11 usr/bin/dbus-launch /etc/xdg usr/bin/dbus-1-launch + Fgenscriptlet } # optimization OK diff --git a/source/base/dbus/dbus.install b/source/base/dbus/dbus.install index d764a31..5d55c78 100644 --- a/source/base/dbus/dbus.install +++ b/source/base/dbus/dbus.install @@ -1,51 +1,72 @@ +sysvinit_units=(@_F_sysvinit_units@) +systemd_units=(@_F_systemd_units@) + post_install() { - ## add the group and user if not there - if ! grep -q 'messagebus' /etc/group; then - /usr/sbin/groupadd -g 38 messagebus 2>/dev/null - /usr/sbin/useradd -s /bin/false -c "D-BUS system user" -d '/' -u 38 -g messagebus messagebus 2>/dev/null - fi - ## DO NOT touch that or things will break! - chown root:messagebus /usr/lib/dbus-1/dbus-daemon-launch-helper - chmod 4750 /usr/lib/dbus-1/dbus-daemon-launch-helper - - /usr/bin/dbus-uuidgen --ensure - - systemctl enable dbus.service >/dev/null 2>&1 + if ! grep -q 'messagebus' /etc/group; then + /usr/sbin/groupadd -g 38 messagebus 2>/dev/null + /usr/sbin/useradd -s /bin/false -c "D-BUS system user" -d '/' -u 38 -g messagebus messagebus 2>/dev/null + fi + chown root:messagebus /usr/lib/dbus-1/dbus-daemon-launch-helper + chmod 4750 /usr/lib/dbus-1/dbus-daemon-launch-helper + /usr/bin/dbus-uuidgen --ensure + + local unit + local op + + for i in ${sysvinit_units[@]}; do + chkconfig --del rc.$i >/dev/null 2>&1 + done + + for i in ${systemd_units[@]}; do + unit=$(echo $i | cut -f 1 -d '=') + op=$(echo $i | cut -f 2 -d '=') + if echo $op | grep -q 'e'; then + systemctl enable $unit.service >/dev/null 2>&1 + fi + if echo $op | grep -q 's'; then + systemctl start $unit.service >/dev/null 2>&1 + fi + done } post_upgrade() { - - ## add the group and user if not there if grep -q 'messagebus' /etc/group; then /usr/sbin/usermod -d '/' messagebus 2>/dev/null else - /usr/sbin/groupadd -g 38 messagebus 2>/dev/null - /usr/sbin/useradd -s /bin/false -c "D-BUS system user" -d '/' -u 38 -g messagebus messagebus 2>/dev/null - fi - ## DO NOT touch that or things will break! + /usr/sbin/groupadd -g 38 messagebus 2>/dev/null + /usr/sbin/useradd -s /bin/false -c "D-BUS system user" -d '/' -u 38 -g messagebus messagebus 2>/dev/null + fi chown root:messagebus /usr/lib/dbus-1/dbus-daemon-launch-helper - chmod 4750 /usr/lib/dbus-1/dbus-daemon-launch-helper - + chmod 4750 /usr/lib/dbus-1/dbus-daemon-launch-helper /usr/bin/dbus-uuidgen --ensure - systemctl daemon-reload >/dev/null 2>&1 - # this can be removed after Frugalware-1.6 - rm -f /etc/rc.d/rc?.d/???rc.dbus + for i in ${sysvinit_units[@]}; do + chkconfig --del rc.$i >/dev/null 2>&1 + done + systemctl daemon-reload >/dev/null 2>&1 } pre_remove() { - ## mabye already removed ? - if grep -q 'messagebus' /etc/group; then - /usr/sbin/userdel messagebus 2>/dev/null - /usr/sbin/groupdel messagebus 2>/dev/null - fi - - systemctl --no-reload disable dbus.service >/dev/null 2>&1 - systemctl stop dbus.service >/dev/null 2>&1 + if grep -q 'messagebus' /etc/group; then + /usr/sbin/userdel messagebus 2>/dev/null + /usr/sbin/groupdel messagebus 2>/dev/null + fi + + local unit + + for i in ${sysvinit_units[@]}; do + chkconfig --del rc.$i >/dev/null 2>&1 + done + + for i in ${systemd_units[@]}; do + unit=$(echo $i | cut -f 1 -d '=') + systemctl --no-reload disable $unit.service >/dev/null 2>&1 + systemctl stop $unit.service >/dev/null 2>&1 + done } post_remove() @@ -55,7 +76,4 @@ post_remove() op=$1 shift - $op $* - -# vim: ft=sh _______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git