From 83006e0c3e9fe89c5cba8e13391a8d058c88bb94 Mon Sep 17 00:00:00 2001 From: aliriza Date: Tue, 7 Feb 2023 09:02:46 +0000 Subject: [PATCH] fix use flag --- sys/apps/dbus/dbus.confd | 7 +++++++ sys/apps/dbus/dbus.initd | 32 ++++++++++++++++++++++++++++++++ sys/apps/dbus/dbus.sysconf | 6 ++++++ sys/apps/dbus/ympbuild | 18 ++++++++++++++---- 4 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 sys/apps/dbus/dbus.confd create mode 100644 sys/apps/dbus/dbus.initd create mode 100644 sys/apps/dbus/dbus.sysconf diff --git a/sys/apps/dbus/dbus.confd b/sys/apps/dbus/dbus.confd new file mode 100644 index 00000000..04540475 --- /dev/null +++ b/sys/apps/dbus/dbus.confd @@ -0,0 +1,7 @@ +# Configuration for /etc/init.d/dbus + +# Additional arguments to pass to dbus-daemon. +#command_args= + +# Uncomment to use process supervisor. +#supervisor=supervise-daemon diff --git a/sys/apps/dbus/dbus.initd b/sys/apps/dbus/dbus.initd new file mode 100644 index 00000000..5dec1b0b --- /dev/null +++ b/sys/apps/dbus/dbus.initd @@ -0,0 +1,32 @@ +#!/sbin/openrc-run +name="System Message Bus" +description="An IPC message bus daemo" + +extra_started_commands="reload" + +command="/usr/bin/dbus-daemon" +command_args="--system" +command_background="yes" +pidfile="/run/$RC_SVCNAME.pid" + +depend() { + need localmount + after bootmisc +} + +start_pre() { + mkdir -p /run/dbus + /usr/bin/dbus-uuidgen --ensure=/etc/machine-id +} + +stop_post() { + [ ! -S /run/dbus/system_bus_socket ] || rm -f /run/dbus/system_bus_socket +} + +reload() { + ebegin "Reloading $name configuration" + /usr/bin/dbus-send --print-reply --system --type=method_call \ + --dest=org.freedesktop.DBus \ + / org.freedesktop.DBus.ReloadConfig > /dev/null + eend $? +} diff --git a/sys/apps/dbus/dbus.sysconf b/sys/apps/dbus/dbus.sysconf new file mode 100644 index 00000000..77bac2e6 --- /dev/null +++ b/sys/apps/dbus/dbus.sysconf @@ -0,0 +1,6 @@ +#!/bin/sh +if [ ! -f /etc/machine-id ] ; then + dbus-uuidgen --ensure=/etc/machine-id +fi +dbus-send --system --type=method_call --dest=org.freedesktop.DBus / \ + org.freedesktop.DBUS.ReloadConfig >/dev/null 2>&1 || : \ No newline at end of file diff --git a/sys/apps/dbus/ympbuild b/sys/apps/dbus/ympbuild index 96c91f91..0b09a6d8 100644 --- a/sys/apps/dbus/ympbuild +++ b/sys/apps/dbus/ympbuild @@ -7,10 +7,16 @@ description='A message bus system, a simple way for applications to talk to each email='aliriza.keskin@pardus.org.tr' maintainer='aliriza' license=('GPLv3') -source=("https://dbus.freedesktop.org/releases/dbus/dbus-$version.tar.xz") +source=("https://dbus.freedesktop.org/releases/dbus/dbus-$version.tar.xz" + "dbus.sysconf" + "dbus.initd" + "dbus.confd") depends=(audit expat libcap-ng) makedepends=() -md5sums=('c56de960ea9031b92ee71aaa0e8e72c2') +md5sums=('c56de960ea9031b92ee71aaa0e8e72c2' + 'SKIP' + 'SKIP' + 'SKIP') group=(sys.apps) uses=(x11) x11_depends=(libX11) @@ -23,7 +29,8 @@ setup(){ --libdir=/usr/lib64/ \ --localstatedir=/var \ --sysconfdir=/etc \ - --with-system-pid-file=/run/dbus/dbus.pid + --with-system-pid-file=/run/dbus/dbus.pid \ + $(use_opt x11 --with-x --without-x) } build(){ @@ -32,8 +39,11 @@ build(){ package(){ make $jobs install - mkdir "$DESTDIR"/etc/{passwd.d,group.d} + mkdir "$DESTDIR"/etc/{passwd,group,sysconf,init,conf}.d echo "messagebus:x:109:" > "$DESTDIR"/etc/group.d/dbus echo "messagebus:x:103:109::/nonexistent:/usr/sbin/nologin" > "$DESTDIR"/etc/passwd.d/dbus + install ../dbus.sysconf "$DESTDIR"/etc/sysconf.d/dbus + install ../dbus.initd "$DESTDIR"/etc/init.d/dbus + install ../dbus.confd "$DESTDIR"/etc/conf.d/dbus }