changeset 344:6598a2f82bb3

network/dbus: initial import, closes #1432
author David Demelier <markand@malikania.fr>
date Wed, 27 Mar 2019 21:05:00 +0100
parents 91bf86b1b7f8
children 7c7fe5c0f569
files network/dbus/dbus network/dbus/dbus.sh
diffstat 2 files changed, 142 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/network/dbus/dbus	Wed Mar 27 21:05:00 2019 +0100
@@ -0,0 +1,60 @@
+#!/bin/sh
+#
+# /etc/rc.d/dbus: run control script for dbus
+
+if [ -f /etc/rc.conf ]; then
+	source /etc/rc.conf
+fi
+
+: ${DBUS_CMD:=/usr/bin/dbus-daemon}
+: ${DBUS_ARGS:=--system}
+: ${DBUS_PID:=/var/run/dbus.pid}
+
+dbus_start()
+{
+	echo "Starting dbus: $DBUS_CMD $DBUS_ARGS"
+	$DBUS_CMD $DBUS_ARGS
+}
+
+dbus_status()
+{
+	if [ -s $DBUS_PID ]; then
+		echo "dbus is running with pid: `cat $DBUS_PID`"
+	else
+		echo "dbus is not running"
+	fi
+}
+
+dbus_stop()
+{
+	if [ -s $DBUS_PID ]; then
+		echo "Stopping dbus..."
+		kill -QUIT `cat $DBUS_PID`
+		rm -f $DBUS_PID
+	fi
+}
+
+dbus_restart()
+{
+	dbus_stop
+	sleep 3
+	dbus_start
+}
+
+case $1 in
+start)
+	dbus_start
+	;;
+status)
+	dbus_status
+	;;
+stop)
+	dbus_stop
+	;;
+restart)
+	dbus_restart
+	;;
+*)
+	echo "usage: $(basename $0) restart|start|status|stop"
+	;;
+esac
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/network/dbus/dbus.sh	Wed Mar 27 21:05:00 2019 +0100
@@ -0,0 +1,82 @@
+#!/bin/sh
+#
+# Copyright (c) 2019 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+PKGNAME=dbus
+PKGVERSION=1.13.8
+PKGREVISION=1
+PKGLICENSE="GPLv2+ CUSTOM"
+PKGSUMMARY="desktop bus"
+PKGDOWNLOAD="https://dbus.freedesktop.org/releases/$PKGNAME/$PKGNAME-$PKGVERSION.tar.xz"
+PKGUIDS="messagebus:100"
+PKGGIDS="messagebus:100"
+PKGOPTIONS="SELINUX X"
+PKGPROTECT="/etc/rc.d/dbus"
+
+: ${CHOST:=$(uname -m)-linux-musl}
+: ${CBUILD:=$(uname -m)-linux-musl}
+: ${CC:=gcc}
+: ${CFLAGS:=-O2}
+: ${CXX:=g++}
+: ${CXXFLAGS:=-O2}
+: ${LDFLAGS:=}
+: ${LIBS:=}
+: ${SELINUX:=no}
+: ${X:=no}
+
+if [ "$SELINUX" = "yes" ]; then
+	with_selinux="--enable-selinux"
+else
+	with_selinux="--disable-selinux"
+fi
+
+if [ "$X" = "yes" ]; then
+	with_x="--with-x"
+else
+	with_x="--without-x"
+fi
+
+build()
+{
+	rm -rf $PKGNAME-$PKGVERSION
+	tar xvaf $PKGNAME-$PKGVERSION.tar.xz
+	pushd $PKGNAME-$PKGVERSION
+
+	CC="$CC" \
+	CFLAGS="$CFLAGS" \
+	CXX="$CXX" \
+	CXXFLAGS="$CXXFLAGS" \
+	LDFLAGS="$LDFLAGS" \
+	LIBS="$LIBS" \
+	./configure \
+		--build=$CBUILD \
+		--host=$CHOST \
+		--prefix=/usr \
+		--sysconfdir=/etc \
+		--with-system-pid-file=/var/run/dbus.pid \
+		--disable-systemd \
+		--disable-static \
+		--enable-shared \
+		$with_selinux \
+		$with_x
+	make
+	make install DESTDIR=$DESTDIR
+	rm -f $DESTDIR/usr/lib/libdbus-1.la
+	cp ../dbus $DESTDIR/etc/rc.d
+
+	popd
+	rm -rf $PKGNAME-$PKGVERSION
+}