summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaakov Selkowitz <yselkowitz@users.sourceforge.net>2010-08-09 08:32:04 +0200
committerRalf Habacker <ralf.habacker@freenet.de>2010-08-10 08:25:24 +0200
commitaec82e2edd6344310958e9b038a4bb17bcbba5b7 (patch)
treee37a17fc6b270855193e1f24ca3948ce838b8673
parent77ee59e06dbb6facda9d4ebdcf47f14adfea091e (diff)
downloaddbus-aec82e2edd6344310958e9b038a4bb17bcbba5b7.tar.gz
Applied patches from cygwin port.
-rwxr-xr-xREADME.cygwin9
-rw-r--r--bus/Makefile.am18
-rw-r--r--bus/messagebus-config.in178
-rw-r--r--configure.in21
-rw-r--r--test/Makefile.am2
5 files changed, 213 insertions, 15 deletions
diff --git a/README.cygwin b/README.cygwin
new file mode 100755
index 00000000..754b3e08
--- /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 af1878ea..a5889ff1 100644
--- a/bus/Makefile.am
+++ b/bus/Makefile.am
@@ -206,13 +206,13 @@ if DBUS_UNIX
$(mkinstalldirs) $(DESTDIR)$(DBUS_DAEMONDIR); \
chmod 755 $(DESTDIR)$(DBUS_DAEMONDIR); \
fi
- $(INSTALL_PROGRAM) dbus-daemon$(EXEEXT) $(DESTDIR)$(DBUS_DAEMONDIR)
+ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) dbus-daemon$(EXEEXT) $(DESTDIR)$(DBUS_DAEMONDIR)
$(mkinstalldirs) $(DESTDIR)$(libexecdir)/dbus-1
if test -f dbus-daemon-launch-helper$(EXEEXT) ; then \
- $(INSTALL_PROGRAM) dbus-daemon-launch-helper$(EXEEXT) $(DESTDIR)$(libexecdir); \
+ $(LIBTOOL) --mode=install $(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"; \
@@ -227,6 +227,7 @@ endif
#### Init scripts fun
SCRIPT_IN_FILES=messagebus.in \
+ messagebus-config.in \
rc.messagebus.in
## Red Hat start
@@ -251,6 +252,15 @@ initd_SCRIPTS= \
endif
## Slackware end
+## Cygwin start
+if DBUS_INIT_SCRIPTS_CYGWIN
+
+bin_SCRIPTS= \
+ messagebus-config
+
+endif
+## Cygwin end
+
if HAVE_SYSTEMD
SCRIPT_IN_FILES += \
dbus.service.in \
diff --git a/bus/messagebus-config.in b/bus/messagebus-config.in
new file mode 100644
index 00000000..39459dcb
--- /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 648b1155..5a386413 100644
--- a/configure.in
+++ b/configure.in
@@ -1356,23 +1356,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)
##### systemd unit files
AC_ARG_WITH([systemdsystemunitdir],
diff --git a/test/Makefile.am b/test/Makefile.am
index ec0b9d88..58d313ab 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 \