summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2012-01-28 07:52:04 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2012-01-28 07:52:04 +0000
commitf6121a5d4401bfb639b4f97635387133ab7d3a74 (patch)
tree809f57f23aaeb6707bd6b922c787098bdddf6b39 /x11-apps/xdm
parentRe-adding now that upstream has made it into a gem and no longer bundles it. (diff)
downloadhistorical-f6121a5d4401bfb639b4f97635387133ab7d3a74.tar.gz
historical-f6121a5d4401bfb639b4f97635387133ab7d3a74.tar.bz2
historical-f6121a5d4401bfb639b4f97635387133ab7d3a74.zip
Import native support for ConsoleKit wrt #360987
Package-Manager: portage-2.2.0_alpha84/cvs/Linux x86_64
Diffstat (limited to 'x11-apps/xdm')
-rw-r--r--x11-apps/xdm/ChangeLog10
-rw-r--r--x11-apps/xdm/Manifest18
-rw-r--r--x11-apps/xdm/files/xdm-consolekit.patch230
-rw-r--r--x11-apps/xdm/metadata.xml5
-rw-r--r--x11-apps/xdm/xdm-1.1.11-r1.ebuild70
5 files changed, 324 insertions, 9 deletions
diff --git a/x11-apps/xdm/ChangeLog b/x11-apps/xdm/ChangeLog
index 4c9e68947415..89563e9d82a6 100644
--- a/x11-apps/xdm/ChangeLog
+++ b/x11-apps/xdm/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for x11-apps/xdm
-# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-apps/xdm/ChangeLog,v 1.131 2011/12/27 20:52:41 maekke Exp $
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/x11-apps/xdm/ChangeLog,v 1.132 2012/01/28 07:52:04 ssuominen Exp $
+
+*xdm-1.1.11-r1 (28 Jan 2012)
+
+ 28 Jan 2012; Samuli Suominen <ssuominen@gentoo.org> +xdm-1.1.11-r1.ebuild,
+ +files/xdm-consolekit.patch:
+ Import native support for ConsoleKit wrt #360987
27 Dec 2011; Markus Meier <maekke@gentoo.org> xdm-1.1.11.ebuild:
x86 stable, bug #394393
diff --git a/x11-apps/xdm/Manifest b/x11-apps/xdm/Manifest
index ec1a0d85ee2f..45d4fb819aa9 100644
--- a/x11-apps/xdm/Manifest
+++ b/x11-apps/xdm/Manifest
@@ -3,19 +3,25 @@ Hash: SHA1
AUX 0001-Fix-missing-linking-dependency-on-ldl.patch 1159 RMD160 2d44d8bcd5484f65ba6de3db485aae979bc8fce7 SHA1 e8ca1fde1d9716191b1b6263abfcaf2d3e434a1e SHA256 4ce9f99385ab2b851a37e79b01276986853c5c3977dbc3151a5e644e89535b89
AUX Xsession 1521 RMD160 c02efb9e96a8dc836d71aa1b47c36358ad61129c SHA1 b94699037a667c716462296c25b4d912fd5d783b SHA256 8a09cd1cef9ebce190e13009e8b21a8504eac1cec3fc31a10d3740b6c7aa49b6
+AUX xdm-consolekit.patch 5712 RMD160 c0611e6c2fe6dd61075ac50323707d05f6b1a720 SHA1 c84807ca7e44c5b7114dd3059cd6d877dd28ff70 SHA256 902bf08f10244325897bc410e7fb81178e47dcae9d96c115992ece860c1b211d
AUX xdm.service 176 RMD160 6879cd39adace0fb9a5d56533d074193d97d297b SHA1 a5bfdecec978ee721136f3757d8242782a41d10a SHA256 d4e47166f51638cd7f85905da130cdec8acc8931c70c1d2634287bfa8348f5d2
AUX xwilling-hang.patch 589 RMD160 1c624acd002d4b45cf6fb318ab4010425120c09b SHA1 df9d176961a1a84da2ee94667fb601634268c923 SHA256 7ee42e52cf2e2aedba74daabee0bb2fa4648262eb00dc92bc778c61b9afb59f4
DIST xdm-1.1.10.tar.bz2 423578 RMD160 c5f6b3bba2d1294b560ad50e2eaaa90097c62dee SHA1 45eb013aa14ddd8d385b200b94fb0fbcbe09b860 SHA256 1487f7168e65fb7ea8cf21e99cdec412e643680c5dac9688aad5f87beba4f97f
DIST xdm-1.1.11.tar.bz2 446612 RMD160 574b5bda0b46a43d0df474279d03e49fa93c9a92 SHA1 8195a8e17d71d18cb89813d04b69a3750e9e818e SHA256 d4da426ddea0124279a3f2e00a26db61944690628ee818a64df9d27352081c47
EBUILD xdm-1.1.10-r1.ebuild 1313 RMD160 7b176ae8c7935b7e493a933d2eaba6d5233be93d SHA1 6fc96802ba63ca46d55915e412144f1e712b0350 SHA256 6bdc61bd529aac883efdf966a3be23741ccd3779a2761f1924a159a078baef8a
EBUILD xdm-1.1.10-r2.ebuild 1970 RMD160 f1bc2940fee345629f57af97157e407ddf9e20c3 SHA1 754f7e84c71676ed67ae94353d33df9aea612334 SHA256 63a143577df305b64fa981eb16dc18298611376a19e311d1dc072bf7c7d4695b
+EBUILD xdm-1.1.11-r1.ebuild 1799 RMD160 b97fbd2e09e6e6390e46b21c7bc3847120265438 SHA1 d8cca7e1a5a0ea6ee8a5dd5251016b5505b26c6c SHA256 1873beb144d6ddfa24825632b22b5185fc310975cdcdf9d503dceb4859cdee4b
EBUILD xdm-1.1.11.ebuild 1810 RMD160 c2886d6a30cf909d501ec0618285538e12e51fe8 SHA1 f2ad58492dfbd0c50f5ba939d8f1311d805d613f SHA256 a5c00bc52f6afbf08a3b41f22993737fabaaf6d0cc24862cfe665eec55fece76
-MISC ChangeLog 18989 RMD160 c969ae0c1fe01332b801ef5848fb8557d24ae1ab SHA1 b5d6d8919b84c220e2bbb4860e7543b89bbdb65c SHA256 b5616284cc231581d25d6bce1160ef672f9ba19d56c54ea4d8d9fbf8134793ae
-MISC metadata.xml 156 RMD160 c1274bdccf57603d580de0075ba07a35b7509560 SHA1 6f78f604e3d079d39189b40aaaa1ddb06182ad91 SHA256 5101ab0d4cc8c7125eea733c44e86962769bd77acaf53b69223b9cadcdd29055
+MISC ChangeLog 19182 RMD160 5d52116cf480346c63a8ecf300ba71ed4dd649fe SHA1 6fedcec806b3bbd7bc0e58539c05c58a677506a1 SHA256 c4b53b18cdc07d015b08c77f4ae2ccc5b40ce9afaf5441de00cf2b7eceb4f314
+MISC metadata.xml 263 RMD160 9ff3bbaed628e48ed00387ddb9990a91a434584e SHA1 4c3a3264e51fb691f208420459fa19f1b235ca8a SHA256 b5893b2e9cadfba8dcee59fe1044e4131621077472177850c1b6ae1d8eef2b4e
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.17 (GNU/Linux)
+Version: GnuPG v2.0.18 (GNU/Linux)
-iEYEARECAAYFAk76MIsACgkQkKaRLQcq0GKuTwCeL4FL22SbqKoLWlRqZmtEMpyk
-ntwAnR5/hHWKbwoVLm8r6xF5IZgK2svk
-=Gc+z
+iQEcBAEBAgAGBQJPI6idAAoJEEdUh39IaPFNr5oH/ikwsrxxGIg24+waQZw2Fqd1
+FAoYFdHX4RcP48T8gLVcysgKeNNbmIgjbE/4v+TctvEq1X94I0kajQcC6xOiuniC
+2Fy2odHz1PzLBX0TPnS+QrElFp1zUP/NQmoisKs2F7W5Ub/s7Zb9hU+dkkoNgbye
+ZT9v2+loL7OnZoS9nwXQfm3KtO/1esSLvqZILGk8xv2rgmocnKUzNbfj5WBJtA+z
+PQyZhZwt5Lvo7jD5AxYU3gJsxVFqPfQd/6hJ2ER7TJ9FTQm4QGus4wITnK48DRSo
+T6qR8lZd6N4aHzi/uMtfp6wVl3Z8Tf8UwDrYUAL8FIS7Gyk1Bx7AUKd1hZyR4VU=
+=qwV1
-----END PGP SIGNATURE-----
diff --git a/x11-apps/xdm/files/xdm-consolekit.patch b/x11-apps/xdm/files/xdm-consolekit.patch
new file mode 100644
index 000000000000..fbacd36fc073
--- /dev/null
+++ b/x11-apps/xdm/files/xdm-consolekit.patch
@@ -0,0 +1,230 @@
+http://bugs.gentoo.org/360987
+http://projects.archlinux.org/svntogit/packages.git/plain/trunk/xdm-consolekit.patch?h=packages/xorg-xdm
+http://lists.x.org/archives/xorg-devel/2011-February/019615.html
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=615020
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -362,6 +362,20 @@
+
+ AM_CONDITIONAL(DYNAMIC_GREETER, test x$DYNAMIC_GREETER = xyes)
+
++# ConsoleKit support
++AC_ARG_WITH(consolekit, AC_HELP_STRING([--with-consolekit], [Use ConsoleKit]),
++ [USE_CONSOLEKIT=$withval], [USE_CONSOLEKIT=yes])
++if test x"$USE_CONSOLEKIT" != xno; then
++ PKG_CHECK_MODULES(CK_CONNECTOR, ck-connector,
++ [USE_CONSOLEKIT=yes], [USE_CONSOLEKIT=no])
++ if test x"$USE_CONSOLEKIT" = xyes; then
++ AC_DEFINE([USE_CONSOLEKIT], 1, [Define to 1 to use ConsoleKit])
++ XDM_CFLAGS="$XDM_CFLAGS $CK_CONNECTOR_CFLAGS -DUSE_CONSOLEKIT"
++ XDM_LIBS="$XDM_LIBS $CK_CONNECTOR_LIBS"
++ fi
++fi
++dnl AM_CONDITIONAL(USE_CONSOLEKIT, test$USE_CONSOLEKIT = xyes)
++
+ #
+ # XDM
+ #
+--- a/xdm/session.c
++++ b/xdm/session.c
+@@ -66,6 +66,11 @@
+ #endif
+ #endif /* USE_PAM */
+
++#ifdef USE_CONSOLEKIT
++#include <ck-connector.h>
++#include <dbus/dbus.h>
++#endif
++
+ #ifdef __SCO__
+ #include <prot.h>
+ #endif
+@@ -472,6 +477,97 @@
+ }
+ }
+
++#ifdef USE_CONSOLEKIT
++
++static CkConnector *connector;
++
++static int openCKSession(struct verify_info *verify, struct display *d)
++{
++ int ret;
++ DBusError error;
++ char *remote_host_name = "";
++ dbus_bool_t is_local;
++ char *display_name = "";
++ char *display_device = "";
++ char devtmp[16];
++
++ if (!use_consolekit)
++ return 1;
++
++ is_local = d->displayType.location == Local;
++ if (d->peerlen > 0 && d->peer)
++ remote_host_name = d->peer;
++ if (d->name)
++ display_name = d->name;
++ /* how can we get the corresponding tty at best...? */
++ if (d->windowPath) {
++ display_device = strchr(d->windowPath, ':');
++ if (display_device && display_device[1])
++ display_device++;
++ else
++ display_device = d->windowPath;
++ snprintf(devtmp, sizeof(devtmp), "/dev/tty%s", display_device);
++ display_device = devtmp;
++ }
++
++ connector = ck_connector_new();
++ if (!connector) {
++ LogOutOfMem("ck_connector");
++ return 0;
++ }
++
++ dbus_error_init(&error);
++ ret = ck_connector_open_session_with_parameters(
++ connector, &error,
++ "unix-user", &verify->uid,
++ "x11-display", &display_name,
++ "x11-display-device", &display_device,
++ "remote-host-name", &remote_host_name,
++ "is-local", &is_local,
++ NULL);
++ if (!ret) {
++ if (dbus_error_is_set(&error)) {
++ LogError("Dbus error: %s\n", error.message);
++ dbus_error_free(&error);
++ } else {
++ LogError("ConsoleKit error\n");
++ }
++ LogError("console-kit-daemon not running?\n");
++ ck_connector_unref(connector);
++ connector = NULL;
++ return 0;
++ }
++
++ verify->userEnviron = setEnv(verify->userEnviron,
++ "XDG_SESSION_COOKIE", ck_connector_get_cookie(connector));
++ return 1;
++}
++
++static void closeCKSession(void)
++{
++ DBusError error;
++
++ if (!connector)
++ return;
++
++ dbus_error_init(&error);
++ if (!ck_connector_close_session(connector, &error)) {
++ if (dbus_error_is_set(&error)) {
++ LogError("Dbus error: %s\n", error.message);
++ dbus_error_free(&error);
++ } else {
++ LogError("ConsoleKit close error\n");
++ }
++ LogError("console-kit-daemon not running?\n");
++ }
++ ck_connector_unref(connector);
++ connector = NULL;
++}
++#else
++#define openCKSession(v,d) 1
++#define closeCKSession()
++#endif
++
+ void
+ SessionExit (struct display *d, int status, int removeAuth)
+ {
+@@ -486,6 +580,8 @@
+ }
+ #endif
+
++ closeCKSession();
++
+ /* make sure the server gets reset after the session is over */
+ if (d->serverPid >= 2 && d->resetSignal)
+ kill (d->serverPid, d->resetSignal);
+@@ -568,6 +664,10 @@
+ #ifdef USE_PAM
+ if (pamh) pam_open_session(pamh, 0);
+ #endif
++
++ if (!openCKSession(verify, d))
++ return 0;
++
+ switch (pid = fork ()) {
+ case 0:
+ CleanUpChild ();
+--- a/include/dm.h
++++ b/include/dm.h
+@@ -325,6 +325,9 @@
+ extern char *prngdSocket;
+ extern int prngdPort;
+ # endif
++#ifdef USE_CONSOLEKIT
++extern int use_consolekit;
++#endif
+
+ extern char *greeterLib;
+ extern char *willing;
+--- a/xdm/resource.c
++++ b/xdm/resource.c
+@@ -68,6 +68,9 @@
+ char *prngdSocket;
+ int prngdPort;
+ #endif
++#ifdef USE_CONSOLEKIT
++int use_consolekit;
++#endif
+
+ char *greeterLib;
+ char *willing;
+@@ -258,6 +261,10 @@
+ "false"} ,
+ { "willing", "Willing", DM_STRING, &willing,
+ ""} ,
++#ifdef USE_CONSOLEKIT
++{ "consoleKit", "ConsoleKit", DM_BOOL, (char **) &use_consolekit,
++ "true"} ,
++#endif
+ };
+
+ # define NUM_DM_RESOURCES (sizeof DmResources / sizeof DmResources[0])
+@@ -440,7 +447,11 @@
+ {"-debug", "*debugLevel", XrmoptionSepArg, (caddr_t) NULL },
+ {"-xrm", NULL, XrmoptionResArg, (caddr_t) NULL },
+ {"-daemon", ".daemonMode", XrmoptionNoArg, "true" },
+-{"-nodaemon", ".daemonMode", XrmoptionNoArg, "false" }
++{"-nodaemon", ".daemonMode", XrmoptionNoArg, "false" },
++#ifdef USE_CONSOLEKIT
++{"-consolekit", ".consoleKit", XrmoptionNoArg, "true" },
++{"-noconsolekit", ".consoleKit", XrmoptionNoArg, "false" }
++#endif
+ };
+
+ static int originalArgc;
+--- a/man/xdm.man
++++ b/man/xdm.man
+@@ -51,6 +51,8 @@
+ ] [
+ .B \-session
+ .I session_program
++] [
++.B \-noconsolekit
+ ]
+ .SH DESCRIPTION
+ .I Xdm
+@@ -218,6 +220,10 @@
+ .IP "\fB\-xrm\fP \fIresource_specification\fP"
+ Allows an arbitrary resource to be specified, as in most
+ X Toolkit applications.
++.IP "\fB\-noconsolekit\fP"
++Specifies ``false'' as the value for the \fBDisplayManager.consoleKit\fP
++resource.
++This suppresses the session management using ConsoleKit.
+ .SH RESOURCES
+ At many stages the actions of
+ .I xdm
diff --git a/x11-apps/xdm/metadata.xml b/x11-apps/xdm/metadata.xml
index 01c4c004e735..21420eb3dfe3 100644
--- a/x11-apps/xdm/metadata.xml
+++ b/x11-apps/xdm/metadata.xml
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
-<herd>x11</herd>
+ <herd>x11</herd>
+ <use>
+ <flag name='consolekit'>Enable native <pkg>sys-auth/consolekit</pkg> support</flag>
+ </use>
</pkgmetadata>
diff --git a/x11-apps/xdm/xdm-1.1.11-r1.ebuild b/x11-apps/xdm/xdm-1.1.11-r1.ebuild
new file mode 100644
index 000000000000..c1c4109d259a
--- /dev/null
+++ b/x11-apps/xdm/xdm-1.1.11-r1.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-apps/xdm/xdm-1.1.11-r1.ebuild,v 1.1 2012/01/28 07:52:04 ssuominen Exp $
+
+EAPI=4
+
+XORG_EAUTORECONF=yes
+
+inherit multilib xorg-2 pam systemd
+
+DEFAULTVT=vt7
+
+DESCRIPTION="X.Org xdm application"
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="consolekit ipv6 pam"
+
+RDEPEND="x11-apps/xrdb
+ x11-libs/libXdmcp
+ x11-libs/libXaw
+ >=x11-apps/xinit-1.0.2-r3
+ x11-libs/libXinerama
+ x11-libs/libXmu
+ x11-libs/libX11
+ x11-libs/libXt
+ x11-apps/sessreg
+ x11-apps/xconsole
+ consolekit? ( sys-auth/consolekit )
+ pam? ( virtual/pam )"
+DEPEND="${RDEPEND}
+ x11-proto/xineramaproto
+ x11-proto/xproto"
+
+pkg_setup() {
+ PATCHES=( "${FILESDIR}"/${PN}-consolekit.patch )
+
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable ipv6)
+ $(use_with pam)
+ "$(systemd_with_unitdir)"
+ --with-default-vt=${DEFAULTVT}
+ --with-xdmconfigdir=/etc/X11/xdm
+ $(use_with consolekit)
+ )
+}
+
+src_install() {
+ xorg-2_src_install
+
+ exeinto /usr/$(get_libdir)/X11/xdm
+ doexe "${FILESDIR}"/Xsession
+
+ use pam && pamd_mimic system-local-login xdm auth account session
+
+ # Keep /var/lib/xdm. This is where authfiles are stored. See #286350.
+ keepdir /var/lib/xdm
+}
+
+pkg_postinst() {
+ # Mea culpa, feel free to remove that after some time --mgorny.
+ if [[ -L "${ROOT}"/etc/systemd/system/graphical.target.wants/${PN}'@tty7'.service ]]
+ then
+ ebegin "Renaming ${PN}@tty7.service to ${PN}.service"
+ ln -s "${ROOT}"/lib/systemd/system/xdm.service \
+ "${ROOT}"/etc/systemd/system/graphical.target.wants/${PN}.service && \
+ rm -f "${ROOT}"/etc/systemd/system/graphical.target.wants/${PN}'@tty7'.service
+ eend ${?} \
+ "Please try to re-enable xdm.service"
+ fi
+}