summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2006-04-30 15:39:05 +0800
committermarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2006-04-30 15:39:05 +0800
commitdc8e6d487d9e72a3fd615b44edfa1ae3ef593b72 (patch)
tree82814bcd7507e0858542f281cc08d613591d0764
parentc00641ab7b2e8149795dfe9ab174b088dd6547a4 (diff)
downloadmarcuscom-ports-dc8e6d487d9e72a3fd615b44edfa1ae3ef593b72.tar.gz
marcuscom-ports-dc8e6d487d9e72a3fd615b44edfa1ae3ef593b72.tar.zst
marcuscom-ports-dc8e6d487d9e72a3fd615b44edfa1ae3ef593b72.zip
Update to 2.15.1.
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@6175 df743ca5-7f9a-e211-a948-0013205c9059
-rw-r--r--x11/gnome-session/Makefile56
-rw-r--r--x11/gnome-session/distinfo6
-rw-r--r--x11/gnome-session/files/patch-dbus429
-rw-r--r--x11/gnome-session/files/patch-gnome-session_Makefile.in37
-rw-r--r--x11/gnome-session/pkg-descr2
-rw-r--r--x11/gnome-session/pkg-plist110
-rw-r--r--x11/gnomesession/Makefile56
-rw-r--r--x11/gnomesession/distinfo6
-rw-r--r--x11/gnomesession/files/patch-dbus429
-rw-r--r--x11/gnomesession/files/patch-gnome-session_Makefile.in37
-rw-r--r--x11/gnomesession/pkg-descr2
-rw-r--r--x11/gnomesession/pkg-plist110
12 files changed, 1280 insertions, 0 deletions
diff --git a/x11/gnome-session/Makefile b/x11/gnome-session/Makefile
new file mode 100644
index 000000000..2b07e56b8
--- /dev/null
+++ b/x11/gnome-session/Makefile
@@ -0,0 +1,56 @@
+# New ports collection makefile for: gnomesession
+# Date created: 08 May 2002
+# Whom: Joe Marcus Clarke <marcus@FreeBSD.org>
+#
+# $FreeBSD$
+# $MCom: ports/x11/gnomesession/Makefile,v 1.83 2006/04/24 03:18:23 marcus Exp $
+#
+
+PORTNAME= gnomesession
+PORTVERSION= 2.15.1
+CATEGORIES= x11 gnome
+MASTER_SITES= ${MASTER_SITE_GNOME} \
+ ${MASTER_SITE_LOCAL:S/$/:local/} \
+ http://people.FreeBSD.org/~adamw/images/gnome_splashes/2.12/:local
+MASTER_SITE_SUBDIR= sources/gnome-session/${PORTVERSION:C/^([0-9]+\.[0-9]+).*/\1/} \
+ adamw/:local
+DISTNAME= gnome-session-${PORTVERSION}
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \
+ ${SPLASHES}:local
+DIST_SUBDIR= gnome2
+EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
+
+MAINTAINER= gnome@FreeBSD.org
+COMMENT= Session component for the GNOME 2 desktop
+
+USE_GETTEXT= yes
+USE_BZIP2= yes
+USE_X_PREFIX= yes
+USE_GNOME= gnomeprefix gnomehack intlhack gnomedesktop
+GNOME_DESKTOP_VERSION=2
+USE_GMAKE= yes
+GNU_CONFIGURE= yes
+CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include" \
+ LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib"
+
+MAN1= gnome-session.1 gnome-wm.1 session-properties.1 \
+ gnome-session-save.1
+MAN5= default.session.5
+GCONF_SCHEMAS= gnome-session.schemas
+
+SPLASHES= freebsd-splashes-gnome-2.12.1.tar
+
+post-extract:
+ cd ${WRKDIR} && ${TAR} xf ${DISTDIR}/${DIST_SUBDIR}/${SPLASHES}
+
+post-install:
+ ${INSTALL_DATA} ${WRKSRC}/gnome-session/gnome-splash.png \
+ ${PREFIX}/share/gnome/pixmaps/splash/original-gnome-splash.png
+# ${INSTALL_DATA} ${WRKDIR}/freebsd-splashes-gnome-2.12/domix-splash-2.12.png \
+# ${PREFIX}/share/gnome/pixmaps/splash/gnome-splash.png
+.for splash in MaMBaNgGaoX-2.12.png adamw-piggy-2.12.png adamw-trophy-2.12.png andreas-slogan-2.12.png andreas-splash-2.12.png domix-splash-2.12.png domix-splash2-2.12.png mumija-2.12.png mumija2-2.12.png mumija3-2.12.png tremulant-2.12.png tremulant-blood-2.12.png tremulant-brushed-metal-2.12.png
+ ${INSTALL_DATA} ${WRKDIR}/freebsd-splashes-gnome-2.12/${splash} \
+ ${PREFIX}/share/gnome/pixmaps/splash
+.endfor
+
+.include <bsd.port.mk>
diff --git a/x11/gnome-session/distinfo b/x11/gnome-session/distinfo
new file mode 100644
index 000000000..9e391f376
--- /dev/null
+++ b/x11/gnome-session/distinfo
@@ -0,0 +1,6 @@
+MD5 (gnome2/gnome-session-2.15.1.tar.bz2) = 62030f6fcec1bf9d3d46545c18720428
+SHA256 (gnome2/gnome-session-2.15.1.tar.bz2) = 6e005d2348b56d5c21caf17619e429ec655ef7f508f0674beee7ee72b62d4490
+SIZE (gnome2/gnome-session-2.15.1.tar.bz2) = 654477
+MD5 (gnome2/freebsd-splashes-gnome-2.12.1.tar) = 4a098f0f2295c3333acff185d4bed5aa
+SHA256 (gnome2/freebsd-splashes-gnome-2.12.1.tar) = c7008fc8f43cf07e3d84cbf0bd9b2846fa31aaf37d4f97993b185b4155f8ee27
+SIZE (gnome2/freebsd-splashes-gnome-2.12.1.tar) = 1280000
diff --git a/x11/gnome-session/files/patch-dbus b/x11/gnome-session/files/patch-dbus
new file mode 100644
index 000000000..edd18bfec
--- /dev/null
+++ b/x11/gnome-session/files/patch-dbus
@@ -0,0 +1,429 @@
+--- gnome-session/main.c.orig Tue Mar 21 12:37:40 2006
++++ gnome-session/main.c Sun Apr 23 23:05:38 2006
+@@ -43,6 +43,7 @@
+ #include "command.h"
+ #include "splash-widget.h"
+ #include "util.h"
++#include "gsm-dbus.h"
+ #include "gsm-sound.h"
+ #include "gsm-gsd.h"
+ #include "gsm-keyring.h"
+@@ -334,6 +335,7 @@ main (int argc, char *argv[])
+ char *display_str;
+ char **versions;
+ GConfClient *gconf_client;
++ gboolean dbus_daemon_owner;
+
+ if (getenv ("GSM_VERBOSE_DEBUG"))
+ gsm_set_verbose (TRUE);
+@@ -415,6 +417,7 @@ main (int argc, char *argv[])
+ fprintf (stderr, "SESSION_MANAGER=%s\n", getenv ("SESSION_MANAGER"));
+ gnome_window_icon_set_default_from_file (GNOME_ICONDIR"/gnome-session.png");
+
++ dbus_daemon_owner = gsm_dbus_daemon_start ();
+
+ /* Make sure children see the right value for DISPLAY. This is
+ useful if --display was specified on the command line. */
+@@ -495,6 +498,9 @@ main (int argc, char *argv[])
+ gsm_sound_logout ();
+
+ gsm_keyring_daemon_stop ();
++
++ if (dbus_daemon_owner)
++ gsm_dbus_daemon_stop ();
+
+ g_object_unref (gconf_client);
+ gsm_shutdown_gconfd ();
+--- gnome-session/gsm-dbus.h.orig Sun Apr 23 23:01:47 2006
++++ gnome-session/gsm-dbus.h Sun Apr 23 23:00:53 2006
+@@ -0,0 +1,27 @@
++/* gsm-dbus.h - Handle the dbus-daemon process.
++ *
++ * Copyright (c) 2006 Julio M. Merino Vidal <jmmv@NetBSD.org>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2, or (at your option)
++ * any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++ * 02111-1307, USA.
++ */
++
++#ifndef GSM_DBUS_H
++#define GSM_DBUS_H
++
++gboolean gsm_dbus_daemon_start (void);
++void gsm_dbus_daemon_stop (void);
++
++#endif /* GSM_DBUS_H */
+--- gnome-session/gsm-dbus.c.orig Sun Apr 23 23:09:40 2006
++++ gnome-session/gsm-dbus.c Sun Apr 23 23:10:21 2006
+@@ -0,0 +1,360 @@
++/* gsm-dbus.c - Handle the dbus-daemon process.
++ *
++ * Copyright (c) 2006 Julio M. Merino Vidal <jmmv@NetBSD.org>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2, or (at your option)
++ * any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++ * 02111-1307, USA.
++ */
++
++#if HAVE_CONFIG_H
++#include "config.h"
++#endif
++
++#include <sys/wait.h>
++
++#include <errno.h>
++#include <fcntl.h>
++#include <limits.h>
++#include <signal.h>
++#include <stdlib.h>
++#include <unistd.h>
++
++#include <glib.h>
++#include <glib/gprintf.h>
++
++#include "gsm-dbus.h"
++
++static pid_t dbus_daemon_pid = 0;
++
++static gboolean have_dbus_daemon (void);
++static gboolean have_running_instance (void);
++static int read_line (int, char *, ssize_t);
++static void start_child (int, int);
++static void start_parent (int, int, pid_t);
++
++/* ---------------------------------------------------------------------
++ * PUBLIC INTERFACE
++ * --------------------------------------------------------------------- */
++
++/*
++ * Starts the dbus-daemon if not already running and attaches it to the
++ * current environment by defining DBUS_SESSION_BUS_ADDRESS. Returns
++ * true if we launch a new dbus-daemon so that we know if we have to call
++ * gsm_dbus_daemon_stop later on or not.
++ *
++ * This function can only be called if dbus-daemon is not already running
++ * (i.e., if gnome-session is starting up or if gsm_dbus_daemon_stop was
++ * previously called).
++ */
++gboolean
++gsm_dbus_daemon_start (void)
++{
++ int address_pipe[2];
++ int pid_pipe[2];
++ pid_t tmp_pid;
++
++ g_assert (dbus_daemon_pid == 0);
++
++ if (have_running_instance ())
++ return FALSE;
++ if (! have_dbus_daemon ())
++ return FALSE;
++
++ /*
++ * At this point, dbus-daemon is not running for the current session
++ * and the binary exists. Spawn it.
++ */
++
++ if (pipe (address_pipe) == -1)
++ {
++ g_printerr ("Cannot create address pipe for dbus-daemon\n");
++ return FALSE;
++ }
++
++ if (pipe (pid_pipe) == -1)
++ {
++ close (address_pipe[0]);
++ close (address_pipe[1]);
++ g_printerr ("Cannot create pid pipe for dbus-daemon\n");
++ return FALSE;
++ }
++
++ tmp_pid = fork ();
++ if (tmp_pid == -1)
++ {
++ close (address_pipe[0]);
++ close (address_pipe[1]);
++ close (pid_pipe[0]);
++ close (pid_pipe[1]);
++ g_printerr ("Cannot create child process for dbus-daemon\n");
++ return FALSE;
++ }
++ else if (tmp_pid == 0)
++ {
++ close (address_pipe[0]);
++ close (pid_pipe[0]);
++ start_child (address_pipe[1], pid_pipe[1]);
++ /* NOTREACHED */
++ }
++ else
++ {
++ close (address_pipe[1]);
++ close (pid_pipe[1]);
++ start_parent (address_pipe[0], pid_pipe[0], tmp_pid);
++ }
++
++ g_assert (dbus_daemon_pid != 0);
++ return TRUE;
++}
++
++/*
++ * Stops the running dbus-daemon. Can only be called if we own the process;
++ * i.e., if gsm_dbus_daemon_start returned true.
++ */
++void
++gsm_dbus_daemon_stop (void)
++{
++ g_assert (dbus_daemon_pid != 0);
++
++ if (kill (dbus_daemon_pid, SIGTERM) == -1)
++ g_printerr ("Failed to kill dbus-daemon (pid %d)\n",
++ dbus_daemon_pid);
++ else
++ {
++ dbus_daemon_pid = 0;
++ g_unsetenv ("DBUS_SESSION_BUS_ADDRESS");
++ }
++}
++
++/* ---------------------------------------------------------------------
++ * PRIVATE FUNCTIONS
++ * --------------------------------------------------------------------- */
++
++/*
++ * Check whether the dbus-daemon binary is in the path and raise an
++ * appropriate error message if it is not.
++ */
++static gboolean
++have_dbus_daemon (void)
++{
++ gboolean result;
++ gchar *file_name;
++
++ file_name = g_find_program_in_path ("dbus-daemon");
++ if (file_name == NULL)
++ g_printerr ("Cannot locate dbus-daemon\n");
++ result = file_name != NULL;
++ g_free (file_name);
++
++ return result;
++}
++
++/*
++ * Check whether there is a dbus-daemon session instance currently running
++ * (not spawned by us). If there is, do nothing and return TRUE.
++ */
++static gboolean
++have_running_instance (void)
++{
++ const gchar *address_str;
++
++ g_assert (dbus_daemon_pid == 0);
++
++ address_str = g_getenv ("DBUS_SESSION_BUS_ADDRESS");
++ return address_str != NULL;
++}
++
++/*
++ * Reads a single line from the given file descriptor and stores it in the
++ * buffer pointed to by 'buf'.
++ *
++ * After finding the first new line character, the function returns. This
++ * is to avoid reading dbus' pid multiple times from its file descriptor.
++ */
++static int
++read_line (int fd, char *buf, ssize_t bufsize)
++{
++ gboolean discard, done;
++ ssize_t bytes;
++
++ bytes = 0;
++ discard = FALSE;
++ done = FALSE;
++ do
++ {
++ ssize_t i, result;
++
++ result = read (fd, &buf[bytes], bufsize - bytes);
++ if (result < 0)
++ return -1;
++ else if (result > 0 && !discard)
++ {
++ if (bytes + result < bufsize)
++ bytes += result;
++ else
++ bytes = bufsize - 1;
++ }
++ else
++ done = TRUE;
++
++ for (i = 0; !discard && i < bytes; i++)
++ if (buf[i] == '\n')
++ {
++ buf[i] = '\0';
++ discard = TRUE;
++ }
++ }
++ while (!done);
++
++ g_assert (bytes >= 0 && bytes < bufsize);
++ buf[bytes] = '\0';
++
++ return bytes;
++}
++
++/*
++ * Code run by the child process after the fork to launch dbus-demon.
++ *
++ * As the child, this execs dbus-daemon, connecting it to the appropriate
++ * file descriptors.
++ */
++static void
++start_child (int address_fd, int pid_fd)
++{
++ gchar address_str[16];
++ gchar pid_str[16];
++ int fd;
++ long open_max;
++
++ open_max = sysconf (_SC_OPEN_MAX);
++ for (fd = 0; fd < open_max; fd++)
++ {
++ if (fd != STDIN_FILENO && fd != STDOUT_FILENO && fd != STDERR_FILENO &&
++ fd != address_fd && fd != pid_fd)
++ fcntl (fd, F_SETFD, FD_CLOEXEC);
++ }
++
++ g_snprintf (address_str, sizeof (address_str), "%d", address_fd);
++ g_snprintf (pid_str, sizeof (pid_str), "%d", pid_fd);
++
++ execlp ("dbus-daemon",
++ "dbus-daemon",
++ "--fork",
++ "--print-address", address_str,
++ "--print-pid", pid_str,
++ "--session",
++ NULL);
++
++ g_printerr ("Could not launch dbus-daemon\n");
++
++ exit (EXIT_FAILURE);
++}
++
++/*
++ * Code run by the parent process after the fork to launch dbus-demon.
++ *
++ * As the parent, this waits until dbus-daemon forks itself again and
++ * fetches its address and pid to later take its ownership.
++ */
++static void
++start_parent (int address_fd, int pid_fd, pid_t child)
++{
++ char address_str[256];
++ char pid_str[256];
++ char *tmp_ep;
++ int exitstat;
++ unsigned long tmp_num;
++ ssize_t bytes;
++
++ g_assert (child > 0);
++
++ /*
++ * dbus-daemon --fork causes our child process to exit prematurely
++ * because it is not the real daemon. See if it worked correctly
++ * and clean it up to avoid a zombie.
++ *
++ * Life could be much easier if dbus-daemon had a --no-fork flag.
++ * But, as it hasn't it, we cannot assume that it will not fork,
++ * because we have no control over its configuration file.
++ */
++ if (waitpid (child, &exitstat, 0) == -1)
++ {
++ close (address_fd);
++ close (pid_fd);
++
++ g_printerr ("Failed to get dbus-daemon status\n");
++ return;
++ }
++ if (!WIFEXITED (exitstat) || WEXITSTATUS (exitstat) != EXIT_SUCCESS)
++ {
++ close (address_fd);
++ close (pid_fd);
++
++ g_printerr ("dbus-daemon exited unexpectedly\n");
++ return;
++ }
++
++ /*
++ * Fetch dbus-daemon address.
++ */
++ bytes = read_line (address_fd, address_str, sizeof (address_str));
++ if (bytes == -1 || bytes == 0)
++ {
++ close (address_fd);
++ close (pid_fd);
++
++ g_printerr ("Failed to get dbus-daemon's address\n");
++ return;
++ }
++
++ /*
++ * Fetch dbus-daemon pid.
++ */
++ bytes = read_line (pid_fd, pid_str, sizeof (pid_str));
++ if (bytes == -1 || bytes == 0)
++ {
++ close (address_fd);
++ close (pid_fd);
++
++ g_printerr ("Failed to get dbus-daemon's pid\n");
++ return;
++ }
++
++ close (address_fd);
++ close (pid_fd);
++
++ /*
++ * Convert the string printed in pid_fd to a pid value. Do the usual
++ * strtoul dance to check for a valid number.
++ */
++ errno = 0;
++ tmp_num = strtoul(pid_str, &tmp_ep, 10);
++ if (pid_str[0] == '\0' || *tmp_ep != '\0')
++ {
++ g_printerr ("dbus-daemon pid invalid (not a number)\n");
++ return;
++ }
++ if (errno == ERANGE && tmp_num == ULONG_MAX)
++ {
++ g_printerr ("dbus-daemon pid invalid (out of range)\n");
++ return;
++ }
++ dbus_daemon_pid = tmp_num;
++
++ /*
++ * All right! Tell our future children about the new born dbus-daemon.
++ */
++ g_setenv ("DBUS_SESSION_BUS_ADDRESS", address_str, TRUE);
++}
diff --git a/x11/gnome-session/files/patch-gnome-session_Makefile.in b/x11/gnome-session/files/patch-gnome-session_Makefile.in
new file mode 100644
index 000000000..a80f576a4
--- /dev/null
+++ b/x11/gnome-session/files/patch-gnome-session_Makefile.in
@@ -0,0 +1,37 @@
+--- gnome-session/Makefile.in.orig Sun Apr 23 23:01:30 2006
++++ gnome-session/Makefile.in Sun Apr 23 23:06:41 2006
+@@ -67,7 +67,7 @@ am_gnome_session_OBJECTS = manager.$(OBJ
+ remote.$(OBJEXT) logout.$(OBJEXT) splash-widget.$(OBJEXT) \
+ gsm-xrandr.$(OBJEXT) gsm-keyring.$(OBJEXT) gsm-gsd.$(OBJEXT) \
+ gsm-protocol.$(OBJEXT) gsm-remote-desktop.$(OBJEXT) \
+- gsm-sound.$(OBJEXT) gsm-at-startup.$(OBJEXT) \
++ gsm-sound.$(OBJEXT) gsm-at-startup.$(OBJEXT) gsm-dbus.$(OBJEXT) \
+ gsm-multiscreen.$(OBJEXT) gsm-typebuiltins.$(OBJEXT) \
+ gdm-logout-action.$(OBJEXT) util.$(OBJEXT) $(am__objects_1)
+ gnome_session_OBJECTS = $(am_gnome_session_OBJECTS)
+@@ -310,7 +310,7 @@ sharedstatedir = @sharedstatedir@
+ sysconfdir = @sysconfdir@
+ target_alias = @target_alias@
+ NULL =
+-defaultdir = $(datadir)/gnome
++defaultdir = $(datadir)
+ INCLUDES = \
+ $(GNOME_SESSION_CFLAGS) \
+ $(STANDARD_PROPERTIES_CFLAGS) \
+@@ -386,6 +386,8 @@ gnome_session_SOURCES = \
+ splash-widget.h \
+ gsm-xrandr.c \
+ gsm-xrandr.h \
++ gsm-dbus.c \
++ gsm-dbus.h \
+ gsm-keyring.c \
+ gsm-keyring.h \
+ gsm-gsd.c \
+@@ -610,6 +612,7 @@ distclean-compile:
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm-sound.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm-typebuiltins.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm-xrandr.Po@am__quote@
++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm-dbus.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ice.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logout-test.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logout.Po@am__quote@
diff --git a/x11/gnome-session/pkg-descr b/x11/gnome-session/pkg-descr
new file mode 100644
index 000000000..50986ef91
--- /dev/null
+++ b/x11/gnome-session/pkg-descr
@@ -0,0 +1,2 @@
+This provides session management for the GNOME 2 desktop, and
+provides the tools used to start the desktop.
diff --git a/x11/gnome-session/pkg-plist b/x11/gnome-session/pkg-plist
new file mode 100644
index 000000000..882701bbd
--- /dev/null
+++ b/x11/gnome-session/pkg-plist
@@ -0,0 +1,110 @@
+bin/gnome-session
+bin/gnome-session-properties
+bin/gnome-session-remove
+bin/gnome-session-save
+bin/gnome-wm
+share/gnome/applications/session-properties.desktop
+share/gnome/default.session
+share/gnome/default.wm
+share/gnome/pixmaps/splash/MaMBaNgGaoX-2.12.png
+share/gnome/pixmaps/splash/adamw-piggy-2.12.png
+share/gnome/pixmaps/splash/adamw-trophy-2.12.png
+share/gnome/pixmaps/splash/andreas-slogan-2.12.png
+share/gnome/pixmaps/splash/andreas-splash-2.12.png
+share/gnome/pixmaps/splash/domix-splash-2.12.png
+share/gnome/pixmaps/splash/domix-splash2-2.12.png
+share/gnome/pixmaps/splash/gnome-splash.png
+share/gnome/pixmaps/splash/mumija-2.12.png
+share/gnome/pixmaps/splash/mumija2-2.12.png
+share/gnome/pixmaps/splash/mumija3-2.12.png
+share/gnome/pixmaps/splash/original-gnome-splash.png
+share/gnome/pixmaps/splash/tremulant-2.12.png
+share/gnome/pixmaps/splash/tremulant-blood-2.12.png
+share/gnome/pixmaps/splash/tremulant-brushed-metal-2.12.png
+share/locale/af/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/am/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ar/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/az/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/be/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/bg/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/bn/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/bs/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ca/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/cs/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/cy/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/da/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/de/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/dz/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/el/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/en_CA/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/en_GB/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/eo/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/es/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/et/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/eu/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/fa/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/fi/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/fr/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ga/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/gl/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/gu/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/he/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/hi/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/hr/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/hu/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/hy/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/id/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/is/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/it/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ja/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ka/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/kn/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ko/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ku/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/lt/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/lv/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/mi/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/mk/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ml/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/mn/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/mr/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ms/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/nb/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ne/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/nl/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/nn/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/no/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/nso/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/pa/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/pl/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/pt/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/pt_BR/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ro/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ru/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/sk/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/sl/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/sq/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/sr/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/sr@Latn/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/sv/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ta/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/th/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/tk/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/tr/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/uk/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/rw/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/vi/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/wa/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/xh/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/zh_CN/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/zh_HK/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/zh_TW/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/zu/LC_MESSAGES/gnome-session-2.0.mo
+@dirrmtry share/locale/zh_HK/LC_MESSAGES
+@dirrmtry share/locale/zh_HK
+@dirrmtry share/locale/ku/LC_MESSAGES
+@dirrmtry share/locale/ku
+@dirrmtry share/locale/hy/LC_MESSAGES
+@dirrmtry share/locale/hy
+@dirrmtry share/locale/dz/LC_MESSAGES
+@dirrmtry share/locale/dz
diff --git a/x11/gnomesession/Makefile b/x11/gnomesession/Makefile
new file mode 100644
index 000000000..2b07e56b8
--- /dev/null
+++ b/x11/gnomesession/Makefile
@@ -0,0 +1,56 @@
+# New ports collection makefile for: gnomesession
+# Date created: 08 May 2002
+# Whom: Joe Marcus Clarke <marcus@FreeBSD.org>
+#
+# $FreeBSD$
+# $MCom: ports/x11/gnomesession/Makefile,v 1.83 2006/04/24 03:18:23 marcus Exp $
+#
+
+PORTNAME= gnomesession
+PORTVERSION= 2.15.1
+CATEGORIES= x11 gnome
+MASTER_SITES= ${MASTER_SITE_GNOME} \
+ ${MASTER_SITE_LOCAL:S/$/:local/} \
+ http://people.FreeBSD.org/~adamw/images/gnome_splashes/2.12/:local
+MASTER_SITE_SUBDIR= sources/gnome-session/${PORTVERSION:C/^([0-9]+\.[0-9]+).*/\1/} \
+ adamw/:local
+DISTNAME= gnome-session-${PORTVERSION}
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \
+ ${SPLASHES}:local
+DIST_SUBDIR= gnome2
+EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
+
+MAINTAINER= gnome@FreeBSD.org
+COMMENT= Session component for the GNOME 2 desktop
+
+USE_GETTEXT= yes
+USE_BZIP2= yes
+USE_X_PREFIX= yes
+USE_GNOME= gnomeprefix gnomehack intlhack gnomedesktop
+GNOME_DESKTOP_VERSION=2
+USE_GMAKE= yes
+GNU_CONFIGURE= yes
+CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include" \
+ LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib"
+
+MAN1= gnome-session.1 gnome-wm.1 session-properties.1 \
+ gnome-session-save.1
+MAN5= default.session.5
+GCONF_SCHEMAS= gnome-session.schemas
+
+SPLASHES= freebsd-splashes-gnome-2.12.1.tar
+
+post-extract:
+ cd ${WRKDIR} && ${TAR} xf ${DISTDIR}/${DIST_SUBDIR}/${SPLASHES}
+
+post-install:
+ ${INSTALL_DATA} ${WRKSRC}/gnome-session/gnome-splash.png \
+ ${PREFIX}/share/gnome/pixmaps/splash/original-gnome-splash.png
+# ${INSTALL_DATA} ${WRKDIR}/freebsd-splashes-gnome-2.12/domix-splash-2.12.png \
+# ${PREFIX}/share/gnome/pixmaps/splash/gnome-splash.png
+.for splash in MaMBaNgGaoX-2.12.png adamw-piggy-2.12.png adamw-trophy-2.12.png andreas-slogan-2.12.png andreas-splash-2.12.png domix-splash-2.12.png domix-splash2-2.12.png mumija-2.12.png mumija2-2.12.png mumija3-2.12.png tremulant-2.12.png tremulant-blood-2.12.png tremulant-brushed-metal-2.12.png
+ ${INSTALL_DATA} ${WRKDIR}/freebsd-splashes-gnome-2.12/${splash} \
+ ${PREFIX}/share/gnome/pixmaps/splash
+.endfor
+
+.include <bsd.port.mk>
diff --git a/x11/gnomesession/distinfo b/x11/gnomesession/distinfo
new file mode 100644
index 000000000..9e391f376
--- /dev/null
+++ b/x11/gnomesession/distinfo
@@ -0,0 +1,6 @@
+MD5 (gnome2/gnome-session-2.15.1.tar.bz2) = 62030f6fcec1bf9d3d46545c18720428
+SHA256 (gnome2/gnome-session-2.15.1.tar.bz2) = 6e005d2348b56d5c21caf17619e429ec655ef7f508f0674beee7ee72b62d4490
+SIZE (gnome2/gnome-session-2.15.1.tar.bz2) = 654477
+MD5 (gnome2/freebsd-splashes-gnome-2.12.1.tar) = 4a098f0f2295c3333acff185d4bed5aa
+SHA256 (gnome2/freebsd-splashes-gnome-2.12.1.tar) = c7008fc8f43cf07e3d84cbf0bd9b2846fa31aaf37d4f97993b185b4155f8ee27
+SIZE (gnome2/freebsd-splashes-gnome-2.12.1.tar) = 1280000
diff --git a/x11/gnomesession/files/patch-dbus b/x11/gnomesession/files/patch-dbus
new file mode 100644
index 000000000..edd18bfec
--- /dev/null
+++ b/x11/gnomesession/files/patch-dbus
@@ -0,0 +1,429 @@
+--- gnome-session/main.c.orig Tue Mar 21 12:37:40 2006
++++ gnome-session/main.c Sun Apr 23 23:05:38 2006
+@@ -43,6 +43,7 @@
+ #include "command.h"
+ #include "splash-widget.h"
+ #include "util.h"
++#include "gsm-dbus.h"
+ #include "gsm-sound.h"
+ #include "gsm-gsd.h"
+ #include "gsm-keyring.h"
+@@ -334,6 +335,7 @@ main (int argc, char *argv[])
+ char *display_str;
+ char **versions;
+ GConfClient *gconf_client;
++ gboolean dbus_daemon_owner;
+
+ if (getenv ("GSM_VERBOSE_DEBUG"))
+ gsm_set_verbose (TRUE);
+@@ -415,6 +417,7 @@ main (int argc, char *argv[])
+ fprintf (stderr, "SESSION_MANAGER=%s\n", getenv ("SESSION_MANAGER"));
+ gnome_window_icon_set_default_from_file (GNOME_ICONDIR"/gnome-session.png");
+
++ dbus_daemon_owner = gsm_dbus_daemon_start ();
+
+ /* Make sure children see the right value for DISPLAY. This is
+ useful if --display was specified on the command line. */
+@@ -495,6 +498,9 @@ main (int argc, char *argv[])
+ gsm_sound_logout ();
+
+ gsm_keyring_daemon_stop ();
++
++ if (dbus_daemon_owner)
++ gsm_dbus_daemon_stop ();
+
+ g_object_unref (gconf_client);
+ gsm_shutdown_gconfd ();
+--- gnome-session/gsm-dbus.h.orig Sun Apr 23 23:01:47 2006
++++ gnome-session/gsm-dbus.h Sun Apr 23 23:00:53 2006
+@@ -0,0 +1,27 @@
++/* gsm-dbus.h - Handle the dbus-daemon process.
++ *
++ * Copyright (c) 2006 Julio M. Merino Vidal <jmmv@NetBSD.org>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2, or (at your option)
++ * any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++ * 02111-1307, USA.
++ */
++
++#ifndef GSM_DBUS_H
++#define GSM_DBUS_H
++
++gboolean gsm_dbus_daemon_start (void);
++void gsm_dbus_daemon_stop (void);
++
++#endif /* GSM_DBUS_H */
+--- gnome-session/gsm-dbus.c.orig Sun Apr 23 23:09:40 2006
++++ gnome-session/gsm-dbus.c Sun Apr 23 23:10:21 2006
+@@ -0,0 +1,360 @@
++/* gsm-dbus.c - Handle the dbus-daemon process.
++ *
++ * Copyright (c) 2006 Julio M. Merino Vidal <jmmv@NetBSD.org>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2, or (at your option)
++ * any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++ * 02111-1307, USA.
++ */
++
++#if HAVE_CONFIG_H
++#include "config.h"
++#endif
++
++#include <sys/wait.h>
++
++#include <errno.h>
++#include <fcntl.h>
++#include <limits.h>
++#include <signal.h>
++#include <stdlib.h>
++#include <unistd.h>
++
++#include <glib.h>
++#include <glib/gprintf.h>
++
++#include "gsm-dbus.h"
++
++static pid_t dbus_daemon_pid = 0;
++
++static gboolean have_dbus_daemon (void);
++static gboolean have_running_instance (void);
++static int read_line (int, char *, ssize_t);
++static void start_child (int, int);
++static void start_parent (int, int, pid_t);
++
++/* ---------------------------------------------------------------------
++ * PUBLIC INTERFACE
++ * --------------------------------------------------------------------- */
++
++/*
++ * Starts the dbus-daemon if not already running and attaches it to the
++ * current environment by defining DBUS_SESSION_BUS_ADDRESS. Returns
++ * true if we launch a new dbus-daemon so that we know if we have to call
++ * gsm_dbus_daemon_stop later on or not.
++ *
++ * This function can only be called if dbus-daemon is not already running
++ * (i.e., if gnome-session is starting up or if gsm_dbus_daemon_stop was
++ * previously called).
++ */
++gboolean
++gsm_dbus_daemon_start (void)
++{
++ int address_pipe[2];
++ int pid_pipe[2];
++ pid_t tmp_pid;
++
++ g_assert (dbus_daemon_pid == 0);
++
++ if (have_running_instance ())
++ return FALSE;
++ if (! have_dbus_daemon ())
++ return FALSE;
++
++ /*
++ * At this point, dbus-daemon is not running for the current session
++ * and the binary exists. Spawn it.
++ */
++
++ if (pipe (address_pipe) == -1)
++ {
++ g_printerr ("Cannot create address pipe for dbus-daemon\n");
++ return FALSE;
++ }
++
++ if (pipe (pid_pipe) == -1)
++ {
++ close (address_pipe[0]);
++ close (address_pipe[1]);
++ g_printerr ("Cannot create pid pipe for dbus-daemon\n");
++ return FALSE;
++ }
++
++ tmp_pid = fork ();
++ if (tmp_pid == -1)
++ {
++ close (address_pipe[0]);
++ close (address_pipe[1]);
++ close (pid_pipe[0]);
++ close (pid_pipe[1]);
++ g_printerr ("Cannot create child process for dbus-daemon\n");
++ return FALSE;
++ }
++ else if (tmp_pid == 0)
++ {
++ close (address_pipe[0]);
++ close (pid_pipe[0]);
++ start_child (address_pipe[1], pid_pipe[1]);
++ /* NOTREACHED */
++ }
++ else
++ {
++ close (address_pipe[1]);
++ close (pid_pipe[1]);
++ start_parent (address_pipe[0], pid_pipe[0], tmp_pid);
++ }
++
++ g_assert (dbus_daemon_pid != 0);
++ return TRUE;
++}
++
++/*
++ * Stops the running dbus-daemon. Can only be called if we own the process;
++ * i.e., if gsm_dbus_daemon_start returned true.
++ */
++void
++gsm_dbus_daemon_stop (void)
++{
++ g_assert (dbus_daemon_pid != 0);
++
++ if (kill (dbus_daemon_pid, SIGTERM) == -1)
++ g_printerr ("Failed to kill dbus-daemon (pid %d)\n",
++ dbus_daemon_pid);
++ else
++ {
++ dbus_daemon_pid = 0;
++ g_unsetenv ("DBUS_SESSION_BUS_ADDRESS");
++ }
++}
++
++/* ---------------------------------------------------------------------
++ * PRIVATE FUNCTIONS
++ * --------------------------------------------------------------------- */
++
++/*
++ * Check whether the dbus-daemon binary is in the path and raise an
++ * appropriate error message if it is not.
++ */
++static gboolean
++have_dbus_daemon (void)
++{
++ gboolean result;
++ gchar *file_name;
++
++ file_name = g_find_program_in_path ("dbus-daemon");
++ if (file_name == NULL)
++ g_printerr ("Cannot locate dbus-daemon\n");
++ result = file_name != NULL;
++ g_free (file_name);
++
++ return result;
++}
++
++/*
++ * Check whether there is a dbus-daemon session instance currently running
++ * (not spawned by us). If there is, do nothing and return TRUE.
++ */
++static gboolean
++have_running_instance (void)
++{
++ const gchar *address_str;
++
++ g_assert (dbus_daemon_pid == 0);
++
++ address_str = g_getenv ("DBUS_SESSION_BUS_ADDRESS");
++ return address_str != NULL;
++}
++
++/*
++ * Reads a single line from the given file descriptor and stores it in the
++ * buffer pointed to by 'buf'.
++ *
++ * After finding the first new line character, the function returns. This
++ * is to avoid reading dbus' pid multiple times from its file descriptor.
++ */
++static int
++read_line (int fd, char *buf, ssize_t bufsize)
++{
++ gboolean discard, done;
++ ssize_t bytes;
++
++ bytes = 0;
++ discard = FALSE;
++ done = FALSE;
++ do
++ {
++ ssize_t i, result;
++
++ result = read (fd, &buf[bytes], bufsize - bytes);
++ if (result < 0)
++ return -1;
++ else if (result > 0 && !discard)
++ {
++ if (bytes + result < bufsize)
++ bytes += result;
++ else
++ bytes = bufsize - 1;
++ }
++ else
++ done = TRUE;
++
++ for (i = 0; !discard && i < bytes; i++)
++ if (buf[i] == '\n')
++ {
++ buf[i] = '\0';
++ discard = TRUE;
++ }
++ }
++ while (!done);
++
++ g_assert (bytes >= 0 && bytes < bufsize);
++ buf[bytes] = '\0';
++
++ return bytes;
++}
++
++/*
++ * Code run by the child process after the fork to launch dbus-demon.
++ *
++ * As the child, this execs dbus-daemon, connecting it to the appropriate
++ * file descriptors.
++ */
++static void
++start_child (int address_fd, int pid_fd)
++{
++ gchar address_str[16];
++ gchar pid_str[16];
++ int fd;
++ long open_max;
++
++ open_max = sysconf (_SC_OPEN_MAX);
++ for (fd = 0; fd < open_max; fd++)
++ {
++ if (fd != STDIN_FILENO && fd != STDOUT_FILENO && fd != STDERR_FILENO &&
++ fd != address_fd && fd != pid_fd)
++ fcntl (fd, F_SETFD, FD_CLOEXEC);
++ }
++
++ g_snprintf (address_str, sizeof (address_str), "%d", address_fd);
++ g_snprintf (pid_str, sizeof (pid_str), "%d", pid_fd);
++
++ execlp ("dbus-daemon",
++ "dbus-daemon",
++ "--fork",
++ "--print-address", address_str,
++ "--print-pid", pid_str,
++ "--session",
++ NULL);
++
++ g_printerr ("Could not launch dbus-daemon\n");
++
++ exit (EXIT_FAILURE);
++}
++
++/*
++ * Code run by the parent process after the fork to launch dbus-demon.
++ *
++ * As the parent, this waits until dbus-daemon forks itself again and
++ * fetches its address and pid to later take its ownership.
++ */
++static void
++start_parent (int address_fd, int pid_fd, pid_t child)
++{
++ char address_str[256];
++ char pid_str[256];
++ char *tmp_ep;
++ int exitstat;
++ unsigned long tmp_num;
++ ssize_t bytes;
++
++ g_assert (child > 0);
++
++ /*
++ * dbus-daemon --fork causes our child process to exit prematurely
++ * because it is not the real daemon. See if it worked correctly
++ * and clean it up to avoid a zombie.
++ *
++ * Life could be much easier if dbus-daemon had a --no-fork flag.
++ * But, as it hasn't it, we cannot assume that it will not fork,
++ * because we have no control over its configuration file.
++ */
++ if (waitpid (child, &exitstat, 0) == -1)
++ {
++ close (address_fd);
++ close (pid_fd);
++
++ g_printerr ("Failed to get dbus-daemon status\n");
++ return;
++ }
++ if (!WIFEXITED (exitstat) || WEXITSTATUS (exitstat) != EXIT_SUCCESS)
++ {
++ close (address_fd);
++ close (pid_fd);
++
++ g_printerr ("dbus-daemon exited unexpectedly\n");
++ return;
++ }
++
++ /*
++ * Fetch dbus-daemon address.
++ */
++ bytes = read_line (address_fd, address_str, sizeof (address_str));
++ if (bytes == -1 || bytes == 0)
++ {
++ close (address_fd);
++ close (pid_fd);
++
++ g_printerr ("Failed to get dbus-daemon's address\n");
++ return;
++ }
++
++ /*
++ * Fetch dbus-daemon pid.
++ */
++ bytes = read_line (pid_fd, pid_str, sizeof (pid_str));
++ if (bytes == -1 || bytes == 0)
++ {
++ close (address_fd);
++ close (pid_fd);
++
++ g_printerr ("Failed to get dbus-daemon's pid\n");
++ return;
++ }
++
++ close (address_fd);
++ close (pid_fd);
++
++ /*
++ * Convert the string printed in pid_fd to a pid value. Do the usual
++ * strtoul dance to check for a valid number.
++ */
++ errno = 0;
++ tmp_num = strtoul(pid_str, &tmp_ep, 10);
++ if (pid_str[0] == '\0' || *tmp_ep != '\0')
++ {
++ g_printerr ("dbus-daemon pid invalid (not a number)\n");
++ return;
++ }
++ if (errno == ERANGE && tmp_num == ULONG_MAX)
++ {
++ g_printerr ("dbus-daemon pid invalid (out of range)\n");
++ return;
++ }
++ dbus_daemon_pid = tmp_num;
++
++ /*
++ * All right! Tell our future children about the new born dbus-daemon.
++ */
++ g_setenv ("DBUS_SESSION_BUS_ADDRESS", address_str, TRUE);
++}
diff --git a/x11/gnomesession/files/patch-gnome-session_Makefile.in b/x11/gnomesession/files/patch-gnome-session_Makefile.in
new file mode 100644
index 000000000..a80f576a4
--- /dev/null
+++ b/x11/gnomesession/files/patch-gnome-session_Makefile.in
@@ -0,0 +1,37 @@
+--- gnome-session/Makefile.in.orig Sun Apr 23 23:01:30 2006
++++ gnome-session/Makefile.in Sun Apr 23 23:06:41 2006
+@@ -67,7 +67,7 @@ am_gnome_session_OBJECTS = manager.$(OBJ
+ remote.$(OBJEXT) logout.$(OBJEXT) splash-widget.$(OBJEXT) \
+ gsm-xrandr.$(OBJEXT) gsm-keyring.$(OBJEXT) gsm-gsd.$(OBJEXT) \
+ gsm-protocol.$(OBJEXT) gsm-remote-desktop.$(OBJEXT) \
+- gsm-sound.$(OBJEXT) gsm-at-startup.$(OBJEXT) \
++ gsm-sound.$(OBJEXT) gsm-at-startup.$(OBJEXT) gsm-dbus.$(OBJEXT) \
+ gsm-multiscreen.$(OBJEXT) gsm-typebuiltins.$(OBJEXT) \
+ gdm-logout-action.$(OBJEXT) util.$(OBJEXT) $(am__objects_1)
+ gnome_session_OBJECTS = $(am_gnome_session_OBJECTS)
+@@ -310,7 +310,7 @@ sharedstatedir = @sharedstatedir@
+ sysconfdir = @sysconfdir@
+ target_alias = @target_alias@
+ NULL =
+-defaultdir = $(datadir)/gnome
++defaultdir = $(datadir)
+ INCLUDES = \
+ $(GNOME_SESSION_CFLAGS) \
+ $(STANDARD_PROPERTIES_CFLAGS) \
+@@ -386,6 +386,8 @@ gnome_session_SOURCES = \
+ splash-widget.h \
+ gsm-xrandr.c \
+ gsm-xrandr.h \
++ gsm-dbus.c \
++ gsm-dbus.h \
+ gsm-keyring.c \
+ gsm-keyring.h \
+ gsm-gsd.c \
+@@ -610,6 +612,7 @@ distclean-compile:
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm-sound.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm-typebuiltins.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm-xrandr.Po@am__quote@
++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm-dbus.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ice.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logout-test.Po@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logout.Po@am__quote@
diff --git a/x11/gnomesession/pkg-descr b/x11/gnomesession/pkg-descr
new file mode 100644
index 000000000..50986ef91
--- /dev/null
+++ b/x11/gnomesession/pkg-descr
@@ -0,0 +1,2 @@
+This provides session management for the GNOME 2 desktop, and
+provides the tools used to start the desktop.
diff --git a/x11/gnomesession/pkg-plist b/x11/gnomesession/pkg-plist
new file mode 100644
index 000000000..882701bbd
--- /dev/null
+++ b/x11/gnomesession/pkg-plist
@@ -0,0 +1,110 @@
+bin/gnome-session
+bin/gnome-session-properties
+bin/gnome-session-remove
+bin/gnome-session-save
+bin/gnome-wm
+share/gnome/applications/session-properties.desktop
+share/gnome/default.session
+share/gnome/default.wm
+share/gnome/pixmaps/splash/MaMBaNgGaoX-2.12.png
+share/gnome/pixmaps/splash/adamw-piggy-2.12.png
+share/gnome/pixmaps/splash/adamw-trophy-2.12.png
+share/gnome/pixmaps/splash/andreas-slogan-2.12.png
+share/gnome/pixmaps/splash/andreas-splash-2.12.png
+share/gnome/pixmaps/splash/domix-splash-2.12.png
+share/gnome/pixmaps/splash/domix-splash2-2.12.png
+share/gnome/pixmaps/splash/gnome-splash.png
+share/gnome/pixmaps/splash/mumija-2.12.png
+share/gnome/pixmaps/splash/mumija2-2.12.png
+share/gnome/pixmaps/splash/mumija3-2.12.png
+share/gnome/pixmaps/splash/original-gnome-splash.png
+share/gnome/pixmaps/splash/tremulant-2.12.png
+share/gnome/pixmaps/splash/tremulant-blood-2.12.png
+share/gnome/pixmaps/splash/tremulant-brushed-metal-2.12.png
+share/locale/af/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/am/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ar/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/az/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/be/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/bg/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/bn/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/bs/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ca/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/cs/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/cy/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/da/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/de/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/dz/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/el/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/en_CA/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/en_GB/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/eo/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/es/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/et/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/eu/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/fa/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/fi/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/fr/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ga/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/gl/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/gu/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/he/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/hi/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/hr/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/hu/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/hy/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/id/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/is/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/it/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ja/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ka/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/kn/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ko/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ku/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/lt/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/lv/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/mi/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/mk/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ml/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/mn/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/mr/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ms/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/nb/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ne/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/nl/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/nn/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/no/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/nso/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/pa/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/pl/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/pt/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/pt_BR/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ro/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ru/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/sk/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/sl/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/sq/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/sr/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/sr@Latn/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/sv/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/ta/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/th/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/tk/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/tr/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/uk/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/rw/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/vi/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/wa/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/xh/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/zh_CN/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/zh_HK/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/zh_TW/LC_MESSAGES/gnome-session-2.0.mo
+share/locale/zu/LC_MESSAGES/gnome-session-2.0.mo
+@dirrmtry share/locale/zh_HK/LC_MESSAGES
+@dirrmtry share/locale/zh_HK
+@dirrmtry share/locale/ku/LC_MESSAGES
+@dirrmtry share/locale/ku
+@dirrmtry share/locale/hy/LC_MESSAGES
+@dirrmtry share/locale/hy
+@dirrmtry share/locale/dz/LC_MESSAGES
+@dirrmtry share/locale/dz