summaryrefslogtreecommitdiffstats
path: root/sysutils/consolekit/files
diff options
context:
space:
mode:
authormarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2007-11-09 04:20:53 +0800
committermarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2007-11-09 04:20:53 +0800
commit772a0d5ed2c615e91a0ee54a094730e32d893b83 (patch)
tree57c19f43c46ce366237af763d8fa9c32a5f79701 /sysutils/consolekit/files
parent58f855b257a23b542b5866468a7a5b84d0e27602 (diff)
downloadmarcuscom-ports-772a0d5ed2c615e91a0ee54a094730e32d893b83.tar
marcuscom-ports-772a0d5ed2c615e91a0ee54a094730e32d893b83.tar.gz
marcuscom-ports-772a0d5ed2c615e91a0ee54a094730e32d893b83.tar.bz2
marcuscom-ports-772a0d5ed2c615e91a0ee54a094730e32d893b83.tar.lz
marcuscom-ports-772a0d5ed2c615e91a0ee54a094730e32d893b83.tar.xz
marcuscom-ports-772a0d5ed2c615e91a0ee54a094730e32d893b83.tar.zst
marcuscom-ports-772a0d5ed2c615e91a0ee54a094730e32d893b83.zip
Update to 0.2.3.
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@9917 df743ca5-7f9a-e211-a948-0013205c9059
Diffstat (limited to 'sysutils/consolekit/files')
-rw-r--r--sysutils/consolekit/files/ck-get-x11-display-device35
-rw-r--r--sysutils/consolekit/files/ck-get-x11-server-pid17
-rw-r--r--sysutils/consolekit/files/consolekit.in57
-rw-r--r--sysutils/consolekit/files/patch-src_ck-sysdeps-freebsd.c18
-rw-r--r--sysutils/consolekit/files/patch-src_main.c33
-rw-r--r--sysutils/consolekit/files/patch-src_test-vt-monitor.c33
-rw-r--r--sysutils/consolekit/files/patch-tools_Makefile.in92
7 files changed, 285 insertions, 0 deletions
diff --git a/sysutils/consolekit/files/ck-get-x11-display-device b/sysutils/consolekit/files/ck-get-x11-display-device
new file mode 100644
index 000000000..6fc508360
--- /dev/null
+++ b/sysutils/consolekit/files/ck-get-x11-display-device
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+FSTAT="/usr/bin/fstat"
+GREP="/usr/bin/grep"
+AWK="/usr/bin/awk"
+SED="/usr/bin/sed"
+CAT="/bin/cat"
+HEAD="/usr/bin/head"
+
+dispnum=0
+if [ x"$1" = x"--display" ]; then
+ if [ $# != 2 ]; then
+ echo "usage: $0 [--display DISPLAY]"
+ exit 1
+ fi
+ DISPLAY=$2
+fi
+if [ ! -z "${DISPLAY}" ]; then
+ dispnum=$(echo ${DISPLAY} | ${SED} -E -e 's|:([0-9]+).*|\1|')
+fi
+
+if [ ! -f "/tmp/.X${dispnum}-lock" ]; then
+ echo "ERROR: Failed to find X lock file for display ${dispnum}"
+ exit 1
+fi
+pid=$(${CAT} "/tmp/.X${dispnum}-lock")
+
+device=$(${FSTAT} -p ${pid} | ${GREP} ttyv | ${HEAD} -1 | ${AWK} '{print $8}')
+
+if [ -z "${device}" ]; then
+ echo "ERROR: Failed to find TTY device for X server on display ${dispnum}"
+ exit 1
+fi
+
+echo "/dev/${device}"
diff --git a/sysutils/consolekit/files/ck-get-x11-server-pid b/sysutils/consolekit/files/ck-get-x11-server-pid
new file mode 100644
index 000000000..05c433e01
--- /dev/null
+++ b/sysutils/consolekit/files/ck-get-x11-server-pid
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+SED="/usr/bin/sed"
+CAT="/bin/cat"
+
+dispnum=0
+if [ ! -z "${DISPLAY}" ]; then
+ dispnum=$(echo ${DISPLAY} | ${SED} -E -e 's|:([0-9]+).*|\1|')
+fi
+
+if [ ! -f "/tmp/.X${dispnum}-lock" ]; then
+ echo "ERROR: Failed to find X lock file for display ${dispnum}"
+ exit 1
+fi
+pid=$(${CAT} "/tmp/.X${dispnum}-lock")
+
+echo ${pid}
diff --git a/sysutils/consolekit/files/consolekit.in b/sysutils/consolekit/files/consolekit.in
new file mode 100644
index 000000000..e42d8a1df
--- /dev/null
+++ b/sysutils/consolekit/files/consolekit.in
@@ -0,0 +1,57 @@
+#!/bin/sh
+#
+# $FreeBSD: ports/sysutils/consolekit/files/consolekit.in,v 1.1 2007/08/27 13:52:48 flz Exp $
+#
+# PROVIDE: consolekit
+# REQUIRE: DAEMON dbus
+#
+# Add the following line to /etc/rc.conf to enable the ConsoleKit daemon:
+#
+# consolekit_enable="YES"
+#
+
+. %%RC_SUBR%%
+. %%GNOME_SUBR%%
+
+consolekit_enable=${consolekit_enable-${gnome_enable}}
+
+name=consolekit
+rcvar=`set_rcvar`
+
+command="%%PREFIX%%/sbin/console-kit-daemon"
+pidfile="/var/run/${name}.pid"
+
+start_precmd="consolekit_precmd"
+stop_postcmd="consolekit_postcmd"
+
+local_force_depend()
+{
+ _depend="$1"
+ if [ -f %%LOCALBASE%%/etc/rc.d/${_depend}.sh ]; then
+ _depend="${_depend}.sh"
+ fi
+
+ if ! %%LOCALBASE%%/etc/rc.d/${_depend} forcestatus 1>/dev/null 2>&1 &&
+ ! %%LOCALBASE%%/etc/rc.d/${_depend} forcestart; then
+ return 1
+ fi
+ return 0
+}
+
+consolekit_precmd()
+{
+ if ! checkyesno dbus_enable
+ then
+ local_force_depend dbus || return 1
+ fi
+
+ mkdir -p $(dirname $pidfile)
+}
+
+consolekit_postcmd()
+{
+ rm -f $pidfile
+}
+
+load_rc_config ${name}
+run_rc_command "$1"
diff --git a/sysutils/consolekit/files/patch-src_ck-sysdeps-freebsd.c b/sysutils/consolekit/files/patch-src_ck-sysdeps-freebsd.c
new file mode 100644
index 000000000..83f6b76e5
--- /dev/null
+++ b/sysutils/consolekit/files/patch-src_ck-sysdeps-freebsd.c
@@ -0,0 +1,18 @@
+--- src/ck-sysdeps-freebsd.c.orig 2007-11-08 15:14:35.000000000 -0500
++++ src/ck-sysdeps-freebsd.c 2007-11-08 15:14:45.000000000 -0500
+@@ -202,7 +202,6 @@ ck_process_stat_new_for_unix_pid (pid_t
+ GError **error)
+ {
+ gboolean res;
+- GError *local_error;
+ CkProcessStat *proc;
+
+ g_return_val_if_fail (pid > 1, FALSE);
+@@ -217,7 +216,6 @@ ck_process_stat_new_for_unix_pid (pid_t
+ if (res) {
+ *stat = proc;
+ } else {
+- g_propagate_error (error, local_error);
+ *stat = NULL;
+ }
+
diff --git a/sysutils/consolekit/files/patch-src_main.c b/sysutils/consolekit/files/patch-src_main.c
new file mode 100644
index 000000000..b1a661aa3
--- /dev/null
+++ b/sysutils/consolekit/files/patch-src_main.c
@@ -0,0 +1,33 @@
+--- src/main.c.orig 2007-11-08 15:05:55.000000000 -0500
++++ src/main.c 2007-11-08 15:07:39.000000000 -0500
+@@ -226,6 +226,21 @@ sigusr1_handler (int sig)
+ }
+
+ static void
++setup_termination_signals (void)
++{
++ struct sigaction sa;
++
++ sa.sa_handler = SIG_DFL;
++ sigemptyset (&sa.sa_mask);
++ sa.sa_flags = 0;
++
++ sigaction (SIGTERM, &sa, NULL);
++ sigaction (SIGQUIT, &sa, NULL);
++ sigaction (SIGINT, &sa, NULL);
++ sigaction (SIGHUP, &sa, NULL);
++}
++
++static void
+ setup_debug_log_signals (void)
+ {
+ struct sigaction sa;
+@@ -300,6 +315,8 @@ main (int argc,
+
+ setup_debug_log (debug);
+
++ setup_termination_signals ();
++
+ connection = get_system_bus ();
+ if (connection == NULL) {
+ goto out;
diff --git a/sysutils/consolekit/files/patch-src_test-vt-monitor.c b/sysutils/consolekit/files/patch-src_test-vt-monitor.c
new file mode 100644
index 000000000..6fb9740f5
--- /dev/null
+++ b/sysutils/consolekit/files/patch-src_test-vt-monitor.c
@@ -0,0 +1,33 @@
+--- src/test-vt-monitor.c.orig 2007-08-17 13:08:55.000000000 -0400
++++ src/test-vt-monitor.c 2007-11-08 15:11:37.000000000 -0500
+@@ -31,6 +31,7 @@
+ #include <pwd.h>
+ #include <string.h>
+ #include <errno.h>
++#include <signal.h>
+
+ #include <locale.h>
+
+@@ -55,12 +56,22 @@ main (int argc, char **argv)
+ GError *error;
+ guint num;
+ gboolean res;
++ struct sigaction sa;
+
+ if (! g_thread_supported ()) {
+ g_thread_init (NULL);
+ }
+ g_type_init ();
+
++ sa.sa_handler = SIG_DFL;
++ sigemptyset (&sa.sa_mask);
++ sa.sa_flags = 0;
++
++ sigaction (SIGINT, &sa, NULL);
++ sigaction (SIGTERM, &sa, NULL);
++ sigaction (SIGQUIT, &sa, NULL);
++ sigaction (SIGHUP, &sa, NULL);
++
+ if (! ck_is_root_user ()) {
+ g_warning ("Must be run as root");
+ exit (1);
diff --git a/sysutils/consolekit/files/patch-tools_Makefile.in b/sysutils/consolekit/files/patch-tools_Makefile.in
new file mode 100644
index 000000000..3536e33ad
--- /dev/null
+++ b/sysutils/consolekit/files/patch-tools_Makefile.in
@@ -0,0 +1,92 @@
+--- tools/Makefile.in.orig 2007-11-08 15:03:07.000000000 -0500
++++ tools/Makefile.in 2007-11-08 15:04:31.000000000 -0500
+@@ -38,9 +38,7 @@ build_triplet = @build@
+ host_triplet = @host@
+ @CK_COMPILE_LINUX_TRUE@am__append_1 = linux
+ bin_PROGRAMS = ck-list-sessions$(EXEEXT) $(am__EXEEXT_1)
+-libexec_PROGRAMS = ck-collect-session-info$(EXEEXT) \
+- ck-get-x11-server-pid$(EXEEXT) \
+- ck-get-x11-display-device$(EXEEXT) $(am__EXEEXT_1)
++libexec_PROGRAMS = ck-collect-session-info$(EXEEXT) $(am__EXEEXT_1)
+ subdir = tools
+ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+@@ -64,17 +62,6 @@ ck_collect_session_info_OBJECTS = \
+ am__DEPENDENCIES_1 =
+ ck_collect_session_info_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(top_builddir)/src/libck.la $(am__DEPENDENCIES_1)
+-am_ck_get_x11_display_device_OBJECTS = \
+- ck-get-x11-display-device.$(OBJEXT) $(am__objects_1)
+-ck_get_x11_display_device_OBJECTS = \
+- $(am_ck_get_x11_display_device_OBJECTS)
+-ck_get_x11_display_device_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+- $(top_builddir)/src/libck.la $(am__DEPENDENCIES_1)
+-am_ck_get_x11_server_pid_OBJECTS = ck-get-x11-server-pid.$(OBJEXT) \
+- $(am__objects_1)
+-ck_get_x11_server_pid_OBJECTS = $(am_ck_get_x11_server_pid_OBJECTS)
+-ck_get_x11_server_pid_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+- $(top_builddir)/src/libck.la $(am__DEPENDENCIES_1)
+ am_ck_list_sessions_OBJECTS = list-sessions.$(OBJEXT) $(am__objects_1)
+ ck_list_sessions_OBJECTS = $(am_ck_list_sessions_OBJECTS)
+ ck_list_sessions_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+@@ -91,11 +78,9 @@ CCLD = $(CC)
+ LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+ SOURCES = $(ck_collect_session_info_SOURCES) \
+- $(ck_get_x11_display_device_SOURCES) \
+- $(ck_get_x11_server_pid_SOURCES) $(ck_list_sessions_SOURCES)
++ $(ck_list_sessions_SOURCES)
+ DIST_SOURCES = $(ck_collect_session_info_SOURCES) \
+- $(ck_get_x11_display_device_SOURCES) \
+- $(ck_get_x11_server_pid_SOURCES) $(ck_list_sessions_SOURCES)
++ $(ck_list_sessions_SOURCES)
+ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+@@ -300,24 +285,6 @@ ck_collect_session_info_LDADD = \
+ $(top_builddir)/src/libck.la \
+ $(NULL)
+
+-ck_get_x11_server_pid_SOURCES = \
+- ck-get-x11-server-pid.c \
+- $(NULL)
+-
+-ck_get_x11_server_pid_LDADD = \
+- $(TOOLS_LIBS) \
+- $(top_builddir)/src/libck.la \
+- $(NULL)
+-
+-ck_get_x11_display_device_SOURCES = \
+- ck-get-x11-display-device.c \
+- $(NULL)
+-
+-ck_get_x11_display_device_LDADD = \
+- $(TOOLS_LIBS) \
+- $(top_builddir)/src/libck.la \
+- $(NULL)
+-
+ EXTRA_DIST = \
+ $(NULL)
+
+@@ -417,12 +384,6 @@ clean-libexecPROGRAMS:
+ ck-collect-session-info$(EXEEXT): $(ck_collect_session_info_OBJECTS) $(ck_collect_session_info_DEPENDENCIES)
+ @rm -f ck-collect-session-info$(EXEEXT)
+ $(LINK) $(ck_collect_session_info_LDFLAGS) $(ck_collect_session_info_OBJECTS) $(ck_collect_session_info_LDADD) $(LIBS)
+-ck-get-x11-display-device$(EXEEXT): $(ck_get_x11_display_device_OBJECTS) $(ck_get_x11_display_device_DEPENDENCIES)
+- @rm -f ck-get-x11-display-device$(EXEEXT)
+- $(LINK) $(ck_get_x11_display_device_LDFLAGS) $(ck_get_x11_display_device_OBJECTS) $(ck_get_x11_display_device_LDADD) $(LIBS)
+-ck-get-x11-server-pid$(EXEEXT): $(ck_get_x11_server_pid_OBJECTS) $(ck_get_x11_server_pid_DEPENDENCIES)
+- @rm -f ck-get-x11-server-pid$(EXEEXT)
+- $(LINK) $(ck_get_x11_server_pid_LDFLAGS) $(ck_get_x11_server_pid_OBJECTS) $(ck_get_x11_server_pid_LDADD) $(LIBS)
+ ck-list-sessions$(EXEEXT): $(ck_list_sessions_OBJECTS) $(ck_list_sessions_DEPENDENCIES)
+ @rm -f ck-list-sessions$(EXEEXT)
+ $(LINK) $(ck_list_sessions_LDFLAGS) $(ck_list_sessions_OBJECTS) $(ck_list_sessions_LDADD) $(LIBS)
+@@ -434,8 +395,6 @@ distclean-compile:
+ -rm -f *.tab.c
+
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-collect-session-info.Po@am__quote@
+-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-get-x11-display-device.Po@am__quote@
+-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ck-get-x11-server-pid.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list-sessions.Po@am__quote@
+
+ .c.o: