Add dbus, Freedesktop.org's Desktop Bus. D-BUS is a message passing framework

for informing applications about system events such as new hardware being
added, new users logging into an IM application, new software installed,
etc.
This commit is contained in:
Joe Marcus Clarke 2004-07-21 19:43:16 +00:00
parent ce44c523f3
commit 1c219c3330
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=114362
10 changed files with 239 additions and 0 deletions

View File

@ -183,6 +183,7 @@
SUBDIR += darcs
SUBDIR += darts
SUBDIR += datadesigner
SUBDIR += dbus
SUBDIR += ddd
SUBDIR += decompyle
SUBDIR += desktop-file-utils

61
devel/dbus/Makefile Normal file
View File

@ -0,0 +1,61 @@
# New ports collection makefile for: D-BUS
# Date Created: 22 June 2004
# Whom: Joe Marcus Clarke <marcus@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= dbus
PORTVERSION= 0.21
CATEGORIES= devel gnome
MASTER_SITES= http://freedesktop.org/Software/dbus/releases/
MAINTAINER= gnome@FreeBSD.org
COMMENT= A message bus system for inter-application communication
LIB_DEPENDS= expat.5:${PORTSDIR}/textproc/expat2
USE_GNOME= gnomehack gtk20 libxml2
USE_GMAKE= yes
USE_LIBTOOL_VER=15
INSTALLS_SHLIB= yes
USE_RC_SUBR= yes
USE_PYTHON= yes
CONFIGURE_ARGS= --enable-gtk \
--disable-python \
--disable-gcj \
--disable-mono \
--with-system-pid-file=/var/run/dbus.pid \
--with-system-socket=/var/run \
--with-session-socket-dir=/var/tmp \
--disable-doxygen-docs \
--disable-xml-docs
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib"
OPTIONS= QT "Enable Qt client support" off
PLIST_SUB= VERSION="1.0"
RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
MAN1= dbus-cleanup-sockets.1 dbus-daemon-1.1 dbus-launch.1 \
dbus-monitor.1 dbus-send.1
.include <bsd.port.pre.mk>
.if defined(WITH_QT) && !defined(WITHOUT_QT)
CONFIGURE_ARGS+=--enable-qt
PLIST_SUB+= QT=""
.else
CONFIGURE_ARGS+=--disable-qt
PLIST_SUB+= QT="@comment "
.endif
post-patch:
@${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${FILESDIR}/dbus.sh > ${WRKSRC}/dbus.sh
post-install:
${INSTALL_SCRIPT} ${WRKSRC}/dbus.sh ${PREFIX}/etc/rc.d
.include <bsd.port.post.mk>

2
devel/dbus/distinfo Normal file
View File

@ -0,0 +1,2 @@
MD5 (dbus-0.21.tar.gz) = 311229d60154334ee3f908badc56747d
SIZE (dbus-0.21.tar.gz) = 1152107

26
devel/dbus/files/dbus.in Normal file
View File

@ -0,0 +1,26 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: dbus
# REQUIRE: DAEMON
# KEYWORD: FreeBSD
#
# Add the following lines to /etc/rc.conf to enable the D-BUS messaging system:
#
# dbus_enable="YES"
#
. %%RC_SUBR%%
name=dbus
rcvar=`set_rcvar`
command="%%PREFIX%%/bin/dbus-daemon-1"
pidfile="/var/run/${name}.pid"
[ -z "$dbus_enable" ] && dbus_enable="NO"
[ -z "$dbus_flags" ] && dbus_flags="--system"
load_rc_config ${name}
run_rc_command "$1"

26
devel/dbus/files/dbus.sh Normal file
View File

@ -0,0 +1,26 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: dbus
# REQUIRE: DAEMON
# KEYWORD: FreeBSD
#
# Add the following lines to /etc/rc.conf to enable the D-BUS messaging system:
#
# dbus_enable="YES"
#
. %%RC_SUBR%%
name=dbus
rcvar=`set_rcvar`
command="%%PREFIX%%/bin/dbus-daemon-1"
pidfile="/var/run/${name}.pid"
[ -z "$dbus_enable" ] && dbus_enable="NO"
[ -z "$dbus_flags" ] && dbus_flags="--system"
load_rc_config ${name}
run_rc_command "$1"

View File

@ -0,0 +1,9 @@
--- dbus-1.pc.in.orig Tue Jun 22 14:50:57 2004
+++ dbus-1.pc.in Tue Jun 22 14:54:24 2004
@@ -7,5 +7,5 @@
Description: Free desktop message bus
Version: @VERSION@
Libs: -L${libdir} -ldbus-1
-Cflags: -I${includedir}/dbus-1.0 -I${libdir}/dbus-1.0/include
+Cflags: -I${includedir}/dbus-1.0 -I${includedir}/dbus-1.0/include

View File

@ -0,0 +1,11 @@
--- dbus/Makefile.in.orig Tue Jun 22 14:58:47 2004
+++ dbus/Makefile.in Tue Jun 22 14:58:56 2004
@@ -232,7 +232,7 @@
INCLUDES = -I$(top_srcdir) $(DBUS_CLIENT_CFLAGS) -DDBUS_COMPILATION
dbusincludedir = $(includedir)/dbus-1.0/dbus
-dbusarchincludedir = $(libdir)/dbus-1.0/include/dbus
+dbusarchincludedir = $(includedir)/dbus-1.0/include/dbus
lib_LTLIBRARIES = libdbus-1.la

View File

@ -0,0 +1,51 @@
--- dbus/dbus-sysdeps.c.orig Wed Mar 17 17:08:09 2004
+++ dbus/dbus-sysdeps.c Tue Jun 22 15:41:42 2004
@@ -740,12 +740,38 @@
{
int bytes_written;
char buf[1] = { '\0' };
+#if defined(HAVE_CMSGCRED) && !defined(LOCAL_CREDS)
+ char cmsgmem[CMSG_SPACE (sizeof (struct cmsgcred))];
+ struct cmsghdr *cmsg = (struct cmsghdr *) cmsgmem;
+ struct iovec iov;
+ struct msghdr msg;
+#endif
+
+#if defined(HAVE_CMSGCRED) && !defined(LOCAL_CREDS)
+ iov.iov_base = buf;
+ iov.iov_len = 1;
+
+ memset (&msg, 0, sizeof (msg));
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
+
+ msg.msg_control = cmsg;
+ msg.msg_controllen = sizeof (cmsgmem);
+ memset (cmsg, 0, sizeof (cmsgmem));
+ cmsg->cmsg_len = sizeof (cmsgmem);
+ cmsg->cmsg_level = SOL_SOCKET;
+ cmsg->cmsg_type = SCM_CREDS;
+#endif
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
again:
+#if defined(HAVE_CMSGCRED) && !defined(LOCAL_CREDS)
+ bytes_written = sendmsg (server_fd, &msg, 0);
+#else
bytes_written = write (server_fd, buf, 1);
+#endif
if (bytes_written < 0 && errno == EINTR)
goto again;
@@ -862,7 +888,8 @@
#ifdef HAVE_CMSGCRED
if (cmsg->cmsg_len < sizeof (cmsgmem) || cmsg->cmsg_type != SCM_CREDS)
{
- dbus_set_error (error, DBUS_ERROR_FAILED);
+ dbus_set_error (error, DBUS_ERROR_FAILED,
+ "Did not receive credentials");
_dbus_verbose ("Message from recvmsg() was not SCM_CREDS\n");
return FALSE;
}

8
devel/dbus/pkg-descr Normal file
View File

@ -0,0 +1,8 @@
D-BUS supplies both a system daemon (for events such as "new hardware device
added" or "printer queue changed") and a per-user-login-session daemon (for
general IPC needs among user applications). Also, the message bus is built on
top of a general one-to-one message passing framework, which can be used by
any two apps to communicate directly (without going through the message bus
daemon).
WWW: http://www.freedesktop.org/Software/dbus

44
devel/dbus/pkg-plist Normal file
View File

@ -0,0 +1,44 @@
bin/dbus-cleanup-sockets
bin/dbus-daemon-1
bin/dbus-glib-tool
bin/dbus-launch
bin/dbus-monitor
bin/dbus-send
bin/dbus-viewer
etc/dbus-1/session.conf
etc/dbus-1/system.conf
etc/rc.d/dbus.sh
include/dbus-%%VERSION%%/dbus/dbus-address.h
include/dbus-%%VERSION%%/dbus/dbus-bus.h
include/dbus-%%VERSION%%/dbus/dbus-connection.h
include/dbus-%%VERSION%%/dbus/dbus-errors.h
include/dbus-%%VERSION%%/dbus/dbus-glib.h
include/dbus-%%VERSION%%/dbus/dbus-macros.h
include/dbus-%%VERSION%%/dbus/dbus-memory.h
include/dbus-%%VERSION%%/dbus/dbus-message.h
include/dbus-%%VERSION%%/dbus/dbus-pending-call.h
include/dbus-%%VERSION%%/dbus/dbus-protocol.h
include/dbus-%%VERSION%%/dbus/dbus-server.h
include/dbus-%%VERSION%%/dbus/dbus-threads.h
include/dbus-%%VERSION%%/dbus/dbus-types.h
include/dbus-%%VERSION%%/dbus/dbus.h
include/dbus-%%VERSION%%/include/dbus/dbus-arch-deps.h
lib/libdbus-1.a
lib/libdbus-1.so
lib/libdbus-1.so.0
lib/libdbus-glib-1.a
lib/libdbus-glib-1.so
lib/libdbus-glib-1.so.0
%%QT%%lib/libdbus-qt-1.a
%%QT%%lib/libdbus-qt-1.so
%%QT%%lib/libdbus-qt-1.so.0
libdata/pkgconfig/dbus-1.pc
libdata/pkgconfig/dbus-glib-1.pc
@dirrm lib/dbus-%%VERSION%%/services
@dirrm lib/dbus-%%VERSION%%
@dirrm include/dbus-%%VERSION%%/include/dbus
@dirrm include/dbus-%%VERSION%%/include
@dirrm include/dbus-%%VERSION%%/dbus
@dirrm include/dbus-%%VERSION%%
@dirrm etc/dbus-1/system.d
@dirrm etc/dbus-1