pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/consolekit Import consolekit version 0.3.0.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/58638ae02480
branches:  trunk
changeset: 550441:58638ae02480
user:      jmcneill <jmcneill%pkgsrc.org@localhost>
date:      Sat Nov 22 03:32:22 2008 +0000

description:
Import consolekit version 0.3.0.

ConsoleKit is a framework for keeping track of the various users, sessions,
and seats present on a system. It provides a mechanism for software to react
to changes of any of these items or of any of the metadata associated with
them.

diffstat:

 sysutils/consolekit/DESCR                     |    4 +
 sysutils/consolekit/Makefile                  |   46 ++
 sysutils/consolekit/PLIST                     |   30 +
 sysutils/consolekit/buildlink3.mk             |   22 +
 sysutils/consolekit/distinfo                  |   10 +
 sysutils/consolekit/files/ck-sysdeps-netbsd.c |  433 ++++++++++++++++++++++++++
 sysutils/consolekit/patches/patch-aa          |   29 +
 sysutils/consolekit/patches/patch-ab          |   23 +
 sysutils/consolekit/patches/patch-ac          |   15 +
 sysutils/consolekit/patches/patch-ad          |   16 +
 sysutils/consolekit/patches/patch-ae          |   33 +
 11 files changed, 661 insertions(+), 0 deletions(-)

diffs (truncated from 705 to 300 lines):

diff -r 4276ed981f7e -r 58638ae02480 sysutils/consolekit/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/consolekit/DESCR Sat Nov 22 03:32:22 2008 +0000
@@ -0,0 +1,4 @@
+ConsoleKit is a framework for keeping track of the various users, sessions,
+and seats present on a system. It provides a mechanism for software to react
+to changes of any of these items or of any of the metadata associated with
+them.
diff -r 4276ed981f7e -r 58638ae02480 sysutils/consolekit/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/consolekit/Makefile      Sat Nov 22 03:32:22 2008 +0000
@@ -0,0 +1,46 @@
+# $NetBSD: Makefile,v 1.1.1.1 2008/11/22 03:32:22 jmcneill Exp $
+#
+
+CONSOLEKIT_VER=                0.3.0
+DISTNAME=              ConsoleKit-${CONSOLEKIT_VER}
+PKGNAME=               consolekit-${CONSOLEKIT_VER}
+CATEGORIES=            sysutils
+MASTER_SITES=          http://people.freedesktop.org/~mccann/dist/
+EXTRACT_SUFX=          .tar.bz2
+
+MAINTAINER=    jmcneill%NetBSD.org@localhost
+HOMEPAGE=      http://www.freedesktop.org/wiki/Software/ConsoleKit
+COMMENT=       Framework for defining and tracking users, login sessions, and seats
+
+PKG_SYSCONFSUBDIR=     ConsoleKit
+
+EGDIR=         ${PREFIX}/share/examples/consolekit
+CONF_FILES+=   ${EGDIR}/00-primary.seat ${PKG_SYSCONFDIR}/seats.d/00-primary.seat
+CONF_FILES+=   ${EGDIR}/ConsoleKit.conf ${PKG_SYSCONFBASE}/dbus-1/system.d/ConsoleKit.conf
+
+MAKE_DIRS=     ${PKG_SYSCONFDIR}/seats.d
+
+BUILD_DEFS+=           VARBASE
+BUILD_DEFS+=           PKG_SYSCONFBASE
+
+GNU_CONFIGURE=         YES
+USE_DIRS+=             xdg-1.4
+USE_PKGLOCALEDIR=      YES
+USE_TOOLS+=            gmake intltool msgfmt perl pkg-config
+USE_TOOLS+=            autoconf automake autoreconf
+USE_LIBTOOL=           YES
+
+CONFIGURE_ARGS+=       --sysconfdir=${PKG_SYSCONFBASE:Q}
+CONFIGURE_ARGS+=       --localstatedir=${VARBASE}
+
+post-extract:
+       cp ${FILESDIR}/ck-sysdeps-netbsd.c ${WRKSRC}/src/
+
+pre-configure:
+       cd ${WRKSRC} && autoreconf -vi
+
+.include "../../security/policykit/buildlink3.mk"
+.include "../../sysutils/dbus/buildlink3.mk"
+.include "../../sysutils/dbus-glib/buildlink3.mk"
+.include "../../mk/pam.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r 4276ed981f7e -r 58638ae02480 sysutils/consolekit/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/consolekit/PLIST Sat Nov 22 03:32:22 2008 +0000
@@ -0,0 +1,30 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2008/11/22 03:32:22 jmcneill Exp $
+bin/ck-history
+bin/ck-launch-session
+bin/ck-list-sessions
+include/ConsoleKit/ck-connector/ck-connector.h
+lib/ConsoleKit/scripts/ck-system-restart
+lib/ConsoleKit/scripts/ck-system-stop
+lib/libck-connector.la
+lib/pkgconfig/ck-connector.pc
+libexec/ck-collect-session-info
+libexec/ck-get-x11-display-device
+libexec/ck-get-x11-server-pid
+sbin/ck-log-system-restart
+sbin/ck-log-system-start
+sbin/ck-log-system-stop
+sbin/console-kit-daemon
+share/PolicyKit/policy/org.freedesktop.consolekit.policy
+share/dbus-1/interfaces/org.freedesktop.ConsoleKit.Manager.xml
+share/dbus-1/interfaces/org.freedesktop.ConsoleKit.Seat.xml
+share/dbus-1/interfaces/org.freedesktop.ConsoleKit.Session.xml
+share/dbus-1/system-services/org.freedesktop.ConsoleKit.service
+share/examples/consolekit/ConsoleKit.conf
+share/examples/consolekit/00-primary.seat
+@dirrm lib/ConsoleKit/scripts
+@exec ${MKDIR} %D/lib/ConsoleKit/run-session.d
+@dirrm lib/ConsoleKit/run-session.d
+@dirrm lib/ConsoleKit
+@dirrm include/ConsoleKit/ck-connector
+@dirrm include/ConsoleKit
+@exec ${MKDIR} %D/etc/ConsoleKit/seats.d
diff -r 4276ed981f7e -r 58638ae02480 sysutils/consolekit/buildlink3.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/consolekit/buildlink3.mk Sat Nov 22 03:32:22 2008 +0000
@@ -0,0 +1,22 @@
+# $NetBSD: buildlink3.mk,v 1.1.1.1 2008/11/22 03:32:22 jmcneill Exp $
+
+BUILDLINK_DEPTH:=              ${BUILDLINK_DEPTH}+
+CONSOLEKIT_BUILDLINK3_MK:=     ${CONSOLEKIT_BUILDLINK3_MK}+
+
+.if ${BUILDLINK_DEPTH} == "+"
+BUILDLINK_DEPENDS+=    consolekit
+.endif
+
+BUILDLINK_PACKAGES:=   ${BUILDLINK_PACKAGES:Nconsolekit}
+BUILDLINK_PACKAGES+=   consolekit
+BUILDLINK_ORDER:=      ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}consolekit
+
+.if ${CONSOLEKIT_BUILDLINK3_MK} == "+"
+BUILDLINK_API_DEPENDS.consolekit+=     consolekit>=0.3.0
+BUILDLINK_PKGSRCDIR.consolekit?=       ../../sysutils/consolekit
+.endif # CONSOLEKIT_BUILDLINK3_MK
+
+.include "../../sysutils/dbus/buildlink3.mk"
+.include "../../sysutils/dbus-glib/buildlink3.mk"
+
+BUILDLINK_DEPTH:=              ${BUILDLINK_DEPTH:S/+$//}
diff -r 4276ed981f7e -r 58638ae02480 sysutils/consolekit/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/consolekit/distinfo      Sat Nov 22 03:32:22 2008 +0000
@@ -0,0 +1,10 @@
+$NetBSD: distinfo,v 1.1.1.1 2008/11/22 03:32:22 jmcneill Exp $
+
+SHA1 (ConsoleKit-0.3.0.tar.bz2) = e3b6156622cc14ebca7382a55b8ed15f2f2bad98
+RMD160 (ConsoleKit-0.3.0.tar.bz2) = 7a1ebd2f4bfb65690e70138c9923c3fd2fcaf671
+Size (ConsoleKit-0.3.0.tar.bz2) = 393694 bytes
+SHA1 (patch-aa) = 859ccbad31b941b78d4fe9e65fa766c672a717f2
+SHA1 (patch-ab) = 2e9fe9de1f27c635a4eefa77af8322cb8a02ab35
+SHA1 (patch-ac) = 0595a9cd1c4013eb4761e044b4b4b01b613f7d2b
+SHA1 (patch-ad) = a1c1a1d0452945550065da3eac2390318c1eb7be
+SHA1 (patch-ae) = 893cd9214218e283747dc886ef5623e5847b8149
diff -r 4276ed981f7e -r 58638ae02480 sysutils/consolekit/files/ck-sysdeps-netbsd.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/consolekit/files/ck-sysdeps-netbsd.c     Sat Nov 22 03:32:22 2008 +0000
@@ -0,0 +1,433 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2006 William Jon McCann <mccann%jhu.edu@localhost>
+ * Copyright (C) 2007 Joe Marcus Clarke <marcus%FreeBSD.org@localhost>
+ * Copyright (C) 2008 Jared D. McNeill <jmcneill%NetBSD.org@localhost>
+ *
+ * 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 of the License, 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.
+ *
+ */
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <paths.h>
+#include <ttyent.h>
+#include <kvm.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/sysctl.h>
+#include <sys/user.h>
+#include <sys/ioctl.h>
+
+#include <dev/wscons/wsdisplay_usl_io.h>
+
+#define DEV_ENCODE(M,m) ( \
+  ( (M&0xfff) << 8) | ( (m&0xfff00) << 12) | (m&0xff) \
+)
+
+#include "ck-sysdeps.h"
+
+#ifndef ERROR
+#define ERROR -1
+#endif
+
+/* adapted from procps */
+struct _CkProcessStat
+{
+        int pid;
+        int ppid;                       /* stat,status     pid of parent process */
+        char state;                     /* stat,status     single-char code for process state (S=sleeping) */
+        char cmd[16];                   /* stat,status     basename of executable file in call to exec(2) */
+        unsigned long long utime;       /* stat            user-mode CPU time accumulated by process */
+        unsigned long long stime;       /* stat            kernel-mode CPU time accumulated by process */
+        unsigned long long cutime;      /* stat            cumulative utime of process and reaped children */
+        unsigned long long cstime;      /* stat            cumulative stime of process and reaped children */
+        unsigned long long start_time;  /* stat            start time of process -- seconds since 1-1-70 */
+        unsigned long start_code;       /* stat            address of beginning of code segment */
+        unsigned long end_code;         /* stat            address of end of code segment */
+        unsigned long start_stack;      /* stat            address of the bottom of stack for the process */
+        unsigned long kstk_esp;         /* stat            kernel stack pointer */
+        unsigned long kstk_eip;         /* stat            kernel instruction pointer */
+        unsigned long wchan;            /* stat (special)  address of kernel wait channel proc is sleeping in */
+        long priority;                  /* stat            kernel scheduling priority */
+        long nice;                      /* stat            standard unix nice level of process */
+        long rss;                       /* stat            resident set size from /proc/#/stat (pages) */
+        long alarm;                     /* stat            ? */
+        unsigned long rtprio;           /* stat            real-time priority */
+        unsigned long sched;            /* stat            scheduling class */
+        unsigned long vsize;            /* stat            number of pages of virtual memory ... */
+        unsigned long rss_rlim;         /* stat            resident set size limit? */
+        unsigned long flags;            /* stat            kernel flags for the process */
+        unsigned long min_flt;          /* stat            number of minor page faults since process start */
+        unsigned long maj_flt;          /* stat            number of major page faults since process start */
+        unsigned long cmin_flt;         /* stat            cumulative min_flt of process and child processes */
+        unsigned long cmaj_flt;         /* stat            cumulative maj_flt of process and child processes */
+        int     pgrp;                   /* stat            process group id */
+        int session;                    /* stat            session id */
+        int nlwp;                       /* stat    number of threads, or 0 if no clue */
+        int tty;                        /* stat            full device number of controlling terminal */
+        int tpgid;                      /* stat            terminal process group id */
+        int exit_signal;                /* stat            might not be SIGCHLD */
+        int processor;                  /* stat            current (or most recent?) CPU */
+        uintptr_t penv;                 /* stat            address of initial environment vector */
+        char tty_text[16];              /* stat            device name */
+
+};
+
+pid_t
+ck_process_stat_get_ppid (CkProcessStat *stat)
+{
+        g_return_val_if_fail (stat != NULL, -1);
+
+        return stat->ppid;
+}
+
+char *
+ck_process_stat_get_cmd (CkProcessStat *stat)
+{
+        g_return_val_if_fail (stat != NULL, NULL);
+
+        return g_strdup (stat->cmd);
+}
+
+char *
+ck_process_stat_get_tty (CkProcessStat *stat)
+{
+        g_return_val_if_fail (stat != NULL, NULL);
+
+        return g_strdup (stat->tty_text);
+}
+
+static gboolean
+get_kinfo_proc (pid_t pid,
+                struct kinfo_proc2 *p)
+{
+        int    mib[4];
+        size_t len;
+
+        len = 4;
+        sysctlnametomib ("kern.proc.pid", mib, &len);
+
+        len = sizeof(struct kinfo_proc2);
+        mib[3] = pid;
+
+        if (sysctl (mib, 4, p, &len, NULL, 0) == -1) {
+                return FALSE;
+        }
+
+        return TRUE;
+}
+
+/* return 1 if it works, or 0 for failure */
+static gboolean
+stat2proc (pid_t        pid,
+           CkProcessStat *P)
+{
+        struct kinfo_proc2 p;
+        char              *ttname;
+        int               num;
+        int               tty_maj;
+        int               tty_min;
+
+        if (! get_kinfo_proc (pid, &p)) {
+                return FALSE;
+        }
+
+        num = KI_MAXCOMLEN;
+        if (num >= sizeof P->cmd) {
+                num = sizeof P->cmd - 1;
+        }
+
+        memcpy (P->cmd, p.p_comm, num);
+
+        P->cmd[num]   = '\0';
+        P->pid        = p.p_pid;
+        P->ppid       = p.p_ppid;



Home | Main Index | Thread Index | Old Index