[PATCH] Applied patches from cygwin port.
Yaakov Selkowitz
yselkowitz at users.sourceforge.net
Sat Jun 12 13:37:52 PDT 2010
---
README.cygwin | 9 ++
bus/Makefile.am | 14 +++-
bus/messagebus-config.in | 178 ++++++++++++++++++++++++++++++++++++++++++++
configure.in | 24 +++---
cygwin/README | 137 ++++++++++++++++++++++++++++++++++
cygwin/dbus.hint | 12 +++
cygwin/libdbus1-devel.hint | 13 +++
cygwin/libdbus1_3.hint | 13 +++
cygwin/postinstall.sh | 2 +
cygwin/preremove.sh | 4 +
test/Makefile.am | 2 +-
11 files changed, 394 insertions(+), 14 deletions(-)
create mode 100755 README.cygwin
create mode 100644 bus/messagebus-config.in
create mode 100644 cygwin/README
create mode 100644 cygwin/dbus.hint
create mode 100644 cygwin/libdbus1-devel.hint
create mode 100644 cygwin/libdbus1_3.hint
create mode 100644 cygwin/postinstall.sh
create mode 100644 cygwin/preremove.sh
diff --git a/README.cygwin b/README.cygwin
new file mode 100755
index 0000000..754b3e0
--- /dev/null
+++ b/README.cygwin
@@ -0,0 +1,9 @@
+The cygwin dbus port is included in master branch of
+dbus git repository since 1.3.1.
+
+See cygwin/README for more informations about
+the cygwin dbus port.
+
+The cygwin port of dbus is maintained by:
+
+http://sourceware.org/cygwinports/
diff --git a/bus/Makefile.am b/bus/Makefile.am
index 5a8d04d..7932a8d 100644
--- a/bus/Makefile.am
+++ b/bus/Makefile.am
@@ -211,8 +211,8 @@ if DBUS_UNIX
if test -f dbus-daemon-launch-helper$(EXEEXT) ; then \
$(INSTALL_PROGRAM) dbus-daemon-launch-helper$(EXEEXT) $(DESTDIR)$(libexecdir); \
if test `id -u` -eq 0; then \
- chown root:$(DBUS_USER) $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper; \
- chmod 4750 $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper; \
+ chown root:$(DBUS_USER) $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \
+ chmod 4750 $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper$(EXEEXT); \
else \
echo "Not installing $(DESTDIR)$(libexecdir)/dbus-daemon-launch-helper binary setuid!"; \
echo "You'll need to manually set permissions to root:$(DBUS_USER) and permissions 4750"; \
@@ -222,6 +222,7 @@ endif
#### Init scripts fun
SCRIPT_IN_FILES=messagebus.in \
+ messagebus-config.in \
rc.messagebus.in
## Red Hat start
@@ -246,6 +247,15 @@ initd_SCRIPTS= \
endif
## Slackware end
+## Cygwin start
+if DBUS_INIT_SCRIPTS_CYGWIN
+
+bin_SCRIPTS= \
+ messagebus-config
+
+endif
+## Cygwin end
+
MAN_IN_FILES=dbus-daemon.1.in
man_MANS = dbus-daemon.1
diff --git a/bus/messagebus-config.in b/bus/messagebus-config.in
new file mode 100644
index 0000000..39459dc
--- /dev/null
+++ b/bus/messagebus-config.in
@@ -0,0 +1,178 @@
+#!/bin/sh
+#
+# messagebus-config, Copyright 2009 Yaakov Selkowitz
+#
+# This file is part of the Cygwin port of dbus.
+
+# ======================================================================
+# Initialization
+# ======================================================================
+PROGNAME=$(basename $0)
+_tdir=$(dirname $0)
+PROGDIR=$(cd $_tdir && pwd)
+
+CSIH_SCRIPT=/usr/share/csih/cygwin-service-installation-helper.sh
+
+# Subdirectory where the new package is being installed
+PREFIX=@prefix@
+
+# Directory where the config files are stored
+SYSCONFDIR=@sysconfdir@/dbus-1
+DEVDIR=/dev
+LOGDIR=/var/log
+RUNDIR=$(dirname @DBUS_SYSTEM_PID_FILE@)
+SOCKDIR=$(dirname @DBUS_SYSTEM_SOCKET@)
+
+source ${CSIH_SCRIPT}
+
+# ======================================================================
+# Routine: install_service
+# Install messagebus as a service
+# ======================================================================
+install_service() {
+
+ if csih_is_nt
+ then
+
+ # Check if messagebus is installed and remove on user request.
+ if cygrunsrv -Q messagebus > /dev/null 2>&1
+ then
+ csih_warning "The messagebus service is already installed."
+ echo
+ if csih_request "Do you want to reinstall it with different args?"
+ then
+ cygrunsrv -E messagebus
+ cygrunsrv -R messagebus
+ fi
+ fi
+
+ # Install messagebus service if it is not already installed
+ if ! cygrunsrv -Q messagebus > /dev/null 2>&1
+ then
+ echo
+ csih_warning "The following function requires administrator privileges!"
+ if csih_request "Do you want to install messagebus as service?"
+ then
+ if cygrunsrv -I messagebus -d "CYGWIN D-Bus system service" -p @EXPANDED_BINDIR@/dbus-daemon -a "--nofork --system"
+ then
+ echo
+ csih_inform "The messagebus service has been installed under the LocalSystem"
+ csih_inform "account (also known as SYSTEM). To start the service now, call"
+ csih_inform "\`net start messagebus' or \`cygrunsrv -S messagebus'. Otherwise, it"
+ csih_inform "will start automatically after the next reboot."
+ echo
+ csih_inform "Check ${SYSCONFDIR}/system.conf first, if it suits your needs."
+ fi
+ fi # user allowed us to install messagebus
+ fi # messagebus already installed
+ fi # csih_is_nt
+} # --- End of install_service --- #
+
+
+# ======================================================================
+# Main Entry Point
+# ======================================================================
+
+
+# Check how the script has been started. If
+# (1) it has been started by giving the full path and
+# that path is /etc/postinstall, OR
+# (2) Otherwise, if the environment variable
+# CONFIG_AUTO_ANSWER_NO is set
+# then set auto_answer to "no". This allows automatic
+# creation of the config files in /etc w/o overwriting
+# them if they already exist. In both cases, color
+# escape sequences are suppressed, so as to prevent
+# cluttering setup's logfiles.
+if [ "$PROGDIR" = "/etc/postinstall" ]
+then
+ csih_auto_answer="no"
+ csih_disable_color
+fi
+if [ -n "${CONFIG_AUTO_ANSWER_NO}" ]
+then
+ csih_auto_answer="no"
+ csih_disable_color
+fi
+
+
+# ======================================================================
+# Parse options
+# ======================================================================
+while :
+do
+ case $# in
+ 0)
+ break
+ ;;
+ esac
+
+ option=$1
+ shift
+
+ case "$option" in
+ -d | --debug )
+ set -x
+ csih_trace_on
+ ;;
+
+ -y | --yes )
+ csih_auto_answer=yes
+ ;;
+
+ -n | --no )
+ csih_auto_answer=no
+ ;;
+
+ *)
+ echo "usage: ${PROGNAME} [OPTION]..."
+ echo
+ echo "This script creates a basic messagebus configuration."
+ echo
+ echo "Options:"
+ echo " --debug -d Enable shell's debug output."
+ echo " --yes -y Answer all questions with \"yes\" automatically."
+ echo " --no -n Answer all questions with \"no\" automatically."
+ echo
+ exit 1
+ ;;
+
+ esac
+done
+
+# ======================================================================
+# Action!
+# ======================================================================
+
+# Check for ${SYSCONFDIR} directory
+csih_make_dir "${SYSCONFDIR}" "Cannot create global configuration files."
+chmod 775 "${SYSCONFDIR}"
+setfacl -m u:system:rwx "${SYSCONFDIR}"
+
+# Check for ${DEVDIR} directory
+csih_make_dir "${DEVDIR}" "Syslogging using messagebus will not work."
+chmod 775 "${DEVDIR}"
+setfacl -m u:system:rwx "${DEVDIR}"
+
+# Check for ${LOGDIR} directory
+csih_make_dir "${LOGDIR}" "Syslogging using messagebus will not work."
+chmod 775 "${LOGDIR}"
+setfacl -m u:system:rwx "${LOGDIR}"
+
+# Check for ${RUNDIR} directory
+csih_make_dir "${RUNDIR}" "PID files of running processes will not be created."
+chmod 775 "${RUNDIR}"
+setfacl -m u:system:rwx "${RUNDIR}"
+
+# Check for ${SOCKDIR} directory
+csih_make_dir "${SOCKDIR}" "SOCKET files of running processes will not be created."
+chmod 775 "${SOCKDIR}"
+setfacl -m u:system:rwx "${SOCKDIR}"
+
+# maybe: csih_auto_answer=no will skip,
+# interactive user will get a chance to override
+install_service
+
+
+echo
+echo "Configuration finished. Have fun!"
diff --git a/configure.in b/configure.in
index 484e6ae..b79ed14 100644
--- a/configure.in
+++ b/configure.in
@@ -1041,7 +1041,7 @@ cc_supports_flag() {
AC_MSG_CHECKING(whether $CC supports "$@")
Cfile=/tmp/foo${$}
touch ${Cfile}.c
- $CC -c "$@" ${Cfile}.c -o ${Cfile}.o >/dev/null 2>&1
+ $CC -c -Werror "$@" ${Cfile}.c -o ${Cfile}.o >/dev/null 2>&1
rc=$?
rm -f ${Cfile}.c ${Cfile}.o
case $rc in
@@ -1354,23 +1354,24 @@ if test -f /etc/slackware-version || test -f $EXPANDED_SYSCONFDIR/slackware-vers
operating_system=slackware
fi
+if test -f /usr/bin/cygwin1.dll || test -f $EXPANDED_BINDIR/cygwin1.dll ; then
+ operating_system=cygwin
+fi
+
#### Sort out init scripts
if test x$with_init_scripts = x; then
- if test xredhat = x$operating_system ; then
- with_init_scripts=redhat
- else
- if test xslackware = x$operating_system ; then
- with_init_scripts=slackware
- else
- with_init_scripts=none
- fi
- fi
+ case x$operating_system in
+ xredhat) with_init_scripts=redhat ;;
+ xslackware) with_init_scripts=slackware ;;
+ xcygwin) with_init_scripts=cygwin ;;
+ *) with_init_scripts=none ;;
+ esac
fi
AM_CONDITIONAL(DBUS_INIT_SCRIPTS_RED_HAT, test x$with_init_scripts = xredhat)
-
AM_CONDITIONAL(DBUS_INIT_SCRIPTS_SLACKWARE, test x$with_init_scripts = xslackware)
+AM_CONDITIONAL(DBUS_INIT_SCRIPTS_CYGWIN, test x$with_init_scripts = xcygwin)
##### Set up location for system bus socket
if ! test -z "$with_system_socket"; then
@@ -1554,6 +1555,7 @@ dbus/dbus-arch-deps.h
bus/system.conf
bus/session.conf
bus/messagebus
+bus/messagebus-config
bus/rc.messagebus
bus/dbus-daemon.1
Makefile
diff --git a/cygwin/README b/cygwin/README
new file mode 100644
index 0000000..e649d63
--- /dev/null
+++ b/cygwin/README
@@ -0,0 +1,137 @@
+dbus
+------------------------------------------
+D-BUS is a message bus system, a simple way for applications to talk
+to one another.
+
+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).
+
+USER NOTES:
+Use messagebus-config to install the D-Bus system service.
+
+Runtime requirements:
+ cygwin-1.7.0-51
+ libexpat1-2.0.1-1
+ libgcc1-4.3.2-2
+ libX11_6-1.2.1-1
+ csih
+
+Build requirements:
+(besides corresponding -devel packages)
+ autoconf2.5-2.63-10
+ automake1.10-1.10.2-10
+ binutils-2.19.51-1
+ cygport-0.9.7-1
+ gawk-3.1.6-2
+ gcc4-core-4.3.2-2
+ gcc4-g++-4.3.2-2
+ libtool-2.2.7a-14
+ make-3.81-2
+ pkg-config-0.23b-10
+ sed-4.1.5-2
+
+Canonical website:
+ http://www.freedesktop.org/Software/dbus
+
+Canonical download:
+ http://dbus.freedesktop.org/releases/
+
+-------------------------------------------
+
+Build instructions:
+ unpack dbus-1.2.16-X-src.tar.bz2
+ if you use setup to install this src package, it will be
+ unpacked under /usr/src automatically
+ cd /usr/src
+ cygport ./dbus-1.2.16-X.cygport all
+
+This will create:
+ /usr/src/dbus-1.2.16-X-src.tar.bz2
+ /usr/src/dbus-1.2.16-X.tar.bz2
+ /usr/src/libdbus1-devel-1.2.16-X.tar.bz2
+ /usr/src/libdbus1_3-1.2.16-X.tar.bz2
+
+-------------------------------------------
+
+Files included in the binary package:
+
+(dbus)
+ /etc/dbus-1/session.conf
+ /etc/dbus-1/session.d/.keep-dbus
+ /etc/dbus-1/system.conf
+ /etc/dbus-1/system.d/.keep-dbus
+ /etc/postinstall/dbus.sh
+ /etc/preremove/dbus.sh
+ /usr/bin/dbus-cleanup-sockets.exe
+ /usr/bin/dbus-daemon.exe
+ /usr/bin/dbus-launch.exe
+ /usr/bin/dbus-monitor.exe
+ /usr/bin/dbus-send.exe
+ /usr/bin/dbus-uuidgen.exe
+ /usr/bin/messagebus-config
+ /usr/lib/dbus-1.0/dbus-daemon-launch-helper.exe
+ /usr/share/dbus-1/services/.keep-dbus
+ /usr/share/dbus-1/system-services/.keep-dbus
+ /usr/share/doc/dbus/AUTHORS
+ /usr/share/doc/dbus/COPYING
+ /usr/share/doc/dbus/ChangeLog
+ /usr/share/doc/dbus/HACKING
+ /usr/share/doc/dbus/README
+ /usr/share/doc/dbus/TODO
+ /usr/share/doc/dbus/html/dbus-faq.html
+ /usr/share/doc/dbus/html/dbus-specification.html
+ /usr/share/doc/dbus/html/dbus-test-plan.html
+ /usr/share/doc/dbus/html/dbus-tutorial.html
+ /usr/share/man/man1/dbus-cleanup-sockets.1.gz
+ /usr/share/man/man1/dbus-daemon.1.gz
+ /usr/share/man/man1/dbus-launch.1.gz
+ /usr/share/man/man1/dbus-monitor.1.gz
+ /usr/share/man/man1/dbus-send.1.gz
+ /usr/share/man/man1/dbus-uuidgen.1.gz
+
+(libdbus1_3)
+ /usr/bin/cygdbus-1-3.dll
+
+(libdbus1-devel)
+ /usr/include/dbus-1.0/dbus/dbus-address.h
+ /usr/include/dbus-1.0/dbus/dbus-bus.h
+ /usr/include/dbus-1.0/dbus/dbus-connection.h
+ /usr/include/dbus-1.0/dbus/dbus-errors.h
+ /usr/include/dbus-1.0/dbus/dbus-macros.h
+ /usr/include/dbus-1.0/dbus/dbus-memory.h
+ /usr/include/dbus-1.0/dbus/dbus-message.h
+ /usr/include/dbus-1.0/dbus/dbus-misc.h
+ /usr/include/dbus-1.0/dbus/dbus-pending-call.h
+ /usr/include/dbus-1.0/dbus/dbus-protocol.h
+ /usr/include/dbus-1.0/dbus/dbus-server.h
+ /usr/include/dbus-1.0/dbus/dbus-shared.h
+ /usr/include/dbus-1.0/dbus/dbus-signature.h
+ /usr/include/dbus-1.0/dbus/dbus-threads.h
+ /usr/include/dbus-1.0/dbus/dbus-types.h
+ /usr/include/dbus-1.0/dbus/dbus.h
+ /usr/lib/dbus-1.0/include/dbus/dbus-arch-deps.h
+ /usr/lib/libdbus-1.a
+ /usr/lib/libdbus-1.dll.a
+ /usr/lib/libdbus-1.la
+ /usr/lib/pkgconfig/dbus-1.pc
+
+------------------
+
+Port Notes:
+
+----- version 1.2.16-1 -----
+Version bump.
+
+----- version 1.2.14-1 -----
+Version bump.
+
+----- version 1.2.12-10 -----
+Initial release for Cygwin 1.7.
+
+
+Cygwin port maintained by:
+http://sourceware.org/cygwinports/
diff --git a/cygwin/dbus.hint b/cygwin/dbus.hint
new file mode 100644
index 0000000..51f7de2
--- /dev/null
+++ b/cygwin/dbus.hint
@@ -0,0 +1,12 @@
+category: System
+requires: libdbus1_3 libexpat1 libgcc1 libX11_6 csih
+sdesc: "Freedesktop message bus system (daemon and clients)"
+ldesc: "D-BUS is a message bus system, a simple way for applications to talk
+to one another.
+
+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)."
diff --git a/cygwin/libdbus1-devel.hint b/cygwin/libdbus1-devel.hint
new file mode 100644
index 0000000..879cf3b
--- /dev/null
+++ b/cygwin/libdbus1-devel.hint
@@ -0,0 +1,13 @@
+category: System
+requires: libdbus1_3
+external-source: dbus
+sdesc: "Freedesktop message bus system (development)"
+ldesc: "D-BUS is a message bus system, a simple way for applications to talk
+to one another.
+
+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)."
diff --git a/cygwin/libdbus1_3.hint b/cygwin/libdbus1_3.hint
new file mode 100644
index 0000000..dc1a8e4
--- /dev/null
+++ b/cygwin/libdbus1_3.hint
@@ -0,0 +1,13 @@
+category: System
+requires: libgcc1
+external-source: dbus
+sdesc: "Freedesktop message bus system (runtime library)"
+ldesc: "D-BUS is a message bus system, a simple way for applications to talk
+to one another.
+
+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)."
diff --git a/cygwin/postinstall.sh b/cygwin/postinstall.sh
new file mode 100644
index 0000000..24ae89a
--- /dev/null
+++ b/cygwin/postinstall.sh
@@ -0,0 +1,2 @@
+mkdir -p /var/lib/dbus
+/usr/bin/dbus-uuidgen --ensure
diff --git a/cygwin/preremove.sh b/cygwin/preremove.sh
new file mode 100644
index 0000000..d1e0576
--- /dev/null
+++ b/cygwin/preremove.sh
@@ -0,0 +1,4 @@
+if /usr/bin/cygrunsrv -Q messagebus &>/dev/null
+then
+ /usr/bin/cygrunsrv -E messagebus
+fi
diff --git a/test/Makefile.am b/test/Makefile.am
index ec0b9d8..58d313a 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -107,7 +107,7 @@ TESTDIRS= \
data/equiv-config-files/entities/basic.d
-FIND_TESTS=find . -name "*.message" -o -name "*.message-raw" -o -name "*.auth-script" -o -name "*.sha1" -o -name "*.txt" -o -name "*.conf" -o -name "*.service"
+FIND_TESTS=find . -type f -a \( -name "*.message" -o -name "*.message-raw" -o -name "*.auth-script" -o -name "*.sha1" -o -name "*.txt" -o -name "*.conf" -o -name "*.service" \)
dist-hook:
for D in $(TESTDIRS); do \
--
1.6.5.1.1367.gcd48
--------------070002040307000506020209--
More information about the dbus
mailing list