From bf46e8b3fa1b464b9b80260e4ed61824e040e6ce Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Wed, 22 Oct 2008 16:18:43 +0530 Subject: Add gnome-base/gdm-9999 - Changes to gnome2-live.eclass to unpack the ebuild's SRC_URI --- eclass/gnome2-live.eclass | 7 +- gnome-base/gdm/Manifest | 4 + .../gdm/files/gdm-fix-daemonize-regression.patch | 119 +++++++++++++ gnome-base/gdm/files/gdm-selinux-remove-attr.patch | 12 ++ gnome-base/gdm/gdm-9999.ebuild | 185 +++++++++++++++++++++ profiles/package.mask | 1 + 6 files changed, 326 insertions(+), 2 deletions(-) create mode 100644 gnome-base/gdm/Manifest create mode 100644 gnome-base/gdm/files/gdm-fix-daemonize-regression.patch create mode 100644 gnome-base/gdm/files/gdm-selinux-remove-attr.patch create mode 100644 gnome-base/gdm/gdm-9999.ebuild diff --git a/eclass/gnome2-live.eclass b/eclass/gnome2-live.eclass index d754974..eca89c5 100644 --- a/eclass/gnome2-live.eclass +++ b/eclass/gnome2-live.eclass @@ -28,6 +28,9 @@ ESVN_REPO_URI=${ESVN_REPO_URI:-"http://svn.gnome.org/svn/${PN}/trunk"} SRC_URI="" gnome2-live_src_unpack() { + if test -n "${A}"; then + unpack ${A} + fi subversion_src_unpack [[ "${EAPI}" != 2 ]] && gnome2-live_src_prepare } @@ -51,8 +54,8 @@ gnome2_src_unpack() { # Run manually for ebuilds that have a custom pkg_postinst gnome2-live_pkg_postinst() { - ewarn "These are live ebuilds, upstream trunks will mostly NOT be stable" - ewarn "Do not report bugs about the packages to the GNOME Gentoo team" + ewarn "This is a live ebuild, upstream trunks will mostly be UNstable" + ewarn "Do NOT report bugs about this package to Gentoo" ewarn "Report upstream bugs (with patches if possible) instead." } diff --git a/gnome-base/gdm/Manifest b/gnome-base/gdm/Manifest new file mode 100644 index 0000000..56a0cba --- /dev/null +++ b/gnome-base/gdm/Manifest @@ -0,0 +1,4 @@ +AUX gdm-fix-daemonize-regression.patch 3927 RMD160 c02a76652a84aa3d406359a22b117b37ad698afc SHA1 4c5b48efeb88ef3f65c53efad5608aa2d5e31c03 SHA256 85d792a6f8607728742d054744a18af749f87758a8828e3a37952691dd749bae +AUX gdm-selinux-remove-attr.patch 503 RMD160 f6281e88fdd718d04667effa938a23286e583770 SHA1 96736ecf27810a055b18890acceac46a25eb8b90 SHA256 cad06b235a669ee342386b9a97502e635c632b0d15b5833b05349c90ea76fb59 +DIST gdm-2.20.5-gentoo-files.tar.bz2 3214 RMD160 a075aa94fc3f6f2947bddf46f008979d62cc94d3 SHA1 9654caf36a91a83ffb5d4e53078a70e8c29a0b61 SHA256 47716f35eb1c6875e9c8e42120ff5f65da806aa06f15a48b082a6f5e5a94da83 +EBUILD gdm-9999.ebuild 4641 RMD160 d4b839f8081efd1e83f5cca1c3ef452654ddec2c SHA1 20837fc353c26eb63d76b0254968220de29ffc44 SHA256 d17ddd1b9994224fe4fd774e9ef3158c8881e96a0d48a1cdb174bacc6c5be0b1 diff --git a/gnome-base/gdm/files/gdm-fix-daemonize-regression.patch b/gnome-base/gdm/files/gdm-fix-daemonize-regression.patch new file mode 100644 index 0000000..d9a5210 --- /dev/null +++ b/gnome-base/gdm/files/gdm-fix-daemonize-regression.patch @@ -0,0 +1,119 @@ +diff --git a/daemon/main.c b/daemon/main.c +index 9d7ab5e..aef3adf 100644 +--- a/daemon/main.c ++++ b/daemon/main.c +@@ -495,6 +495,63 @@ signal_cb (int signo, + return ret; + } + ++static void ++gdm_signal_ignore (int signal) ++{ ++ struct sigaction ign_signal; ++ ++ ign_signal.sa_handler = SIG_IGN; ++ ign_signal.sa_flags = SA_RESTART; ++ sigemptyset (&ign_signal.sa_mask); ++ ++ if G_UNLIKELY (sigaction (signal, &ign_signal, NULL) < 0) ++ gdm_error (_("%s: Error setting signal %d to %s"), ++ "gdm_signal_ignore", signal, "SIG_IGN"); ++} ++ ++static void ++gdm_open_dev_null (mode_t mode) ++{ ++ int ret; ++ VE_IGNORE_EINTR (ret = open ("/dev/null", mode)); ++ if G_UNLIKELY (ret < 0) { ++ /* ++ * Never output anything, we're likely in some ++ * strange state right now ++ */ ++ gdm_signal_ignore (SIGPIPE); ++ VE_IGNORE_EINTR (close (2)); ++ gdm_fail ("Cannot open /dev/null!"); ++ } ++} ++ ++static void ++gdm_daemonify (void) ++{ ++ pid_t pid; ++ ++ pid = fork (); ++ ++ /* terminate the parent */ ++ if (pid > 0) ++ exit (EXIT_SUCCESS); ++ ++ if G_UNLIKELY (pid < 0) ++ gdm_fail (_("%s: fork () failed!"), "gdm_daemonify"); ++ ++ if G_UNLIKELY (setsid () < 0) ++ gdm_fail (_("%s: setsid () failed: %s!"), "gdm_daemonify", ++ strerror (errno)); ++ ++ /* reopen stdin, stdout, stderr with /dev/null */ ++ VE_IGNORE_EINTR (close (0)); ++ VE_IGNORE_EINTR (close (1)); ++ VE_IGNORE_EINTR (close (2)); ++ gdm_open_dev_null (O_RDONLY); ++ gdm_open_dev_null (O_RDWR); ++ gdm_open_dev_null (O_RDWR); ++} ++ + int + main (int argc, + char **argv) +@@ -505,6 +562,7 @@ main (int argc, + DBusGConnection *connection; + GError *error; + int ret; ++ int i; + gboolean res; + gboolean xdmcp_enabled; + GdmSignalHandler *signal_handler; +@@ -512,9 +570,11 @@ main (int argc, + static gboolean do_timed_exit = FALSE; + static gboolean print_version = FALSE; + static gboolean fatal_warnings = FALSE; ++ static gboolean no_daemon = FALSE; + static GOptionEntry entries [] = { + { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL }, + { "fatal-warnings", 0, 0, G_OPTION_ARG_NONE, &fatal_warnings, N_("Make all warnings fatal"), NULL }, ++ { "nodaemon", 0, 0, G_OPTION_ARG_NONE, &no_daemon, N_("Do not fork into the background"), NULL }, + { "timed-exit", 0, 0, G_OPTION_ARG_NONE, &do_timed_exit, N_("Exit after a time - for debugging"), NULL }, + { "version", 0, 0, G_OPTION_ARG_NONE, &print_version, N_("Print GDM version"), NULL }, + +@@ -531,6 +591,14 @@ main (int argc, + + g_type_init (); + ++ /* preprocess the arguments to support the xdm style -nodaemon ++ * option ++ */ ++ for (i = 0; i < argc; i++) { ++ if (strcmp (argv[i], "-nodaemon") == 0) ++ argv[i] = "--nodaemon"; ++ } ++ + context = g_option_context_new (_("GNOME Display Manager")); + g_option_context_add_main_entries (context, entries, NULL); + g_option_context_set_ignore_unknown_options (context, TRUE); +@@ -600,6 +668,12 @@ main (int argc, + delete_pid (); + write_pid (); + ++ if (!no_daemon) { ++ /* fork and write pid file with child's pid */ ++ gdm_daemonify (); ++ write_pid (); ++ } ++ + g_chdir (AUTHDIR); + + manager = gdm_manager_new (); +-- +1.5.5.1 + diff --git a/gnome-base/gdm/files/gdm-selinux-remove-attr.patch b/gnome-base/gdm/files/gdm-selinux-remove-attr.patch new file mode 100644 index 0000000..74ac70b --- /dev/null +++ b/gnome-base/gdm/files/gdm-selinux-remove-attr.patch @@ -0,0 +1,12 @@ +diff --exclude-from=/home/dang/.diffrc -u -ruN gdm-2.13.0.1.orig/configure.ac gdm-2.13.0.1/configure.ac +--- gdm-2.13.0.1.orig/configure.ac 2005-11-14 17:13:40.000000000 -0500 ++++ gdm-2.13.0.1/configure.ac 2005-11-18 14:59:23.000000000 -0500 +@@ -750,7 +750,7 @@ + AC_CHECK_LIB(selinux,setexeccon,/bin/true) + AC_CHECK_LIB(selinux,is_selinux_enabled,/bin/true) + AC_DEFINE(HAVE_SELINUX) +- EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -lselinux -lattr" ++ EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -lselinux" + fi + + # diff --git a/gnome-base/gdm/gdm-9999.ebuild b/gnome-base/gdm/gdm-9999.ebuild new file mode 100644 index 0000000..aae76f1 --- /dev/null +++ b/gnome-base/gdm/gdm-9999.ebuild @@ -0,0 +1,185 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ +EAPI=2 + +inherit eutils pam gnome2 gnome2-live + +DESCRIPTION="GNOME Display Manager" +HOMEPAGE="http://www.gnome.org/projects/gdm/" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +IUSE_LIBC="elibc_glibc" +IUSE="accessibility afs debug ipv6 gnome-keyring policykit selinux tcpd xinerama $IUSE_LIBC" + +# Name of the tarball with gentoo specific files +GDM_EXTRA="${PN}-2.20.5-gentoo-files" + +SRC_URI="${SRC_URI} + mirror://gentoo/${GDM_EXTRA}.tar.bz2" + +# FIXME: automagic libxklavier check + +RDEPEND=">=dev-libs/dbus-glib-0.74 + dev-libs/glib:2 + x11-libs/gtk+:2 + x11-libs/pango + gnome-base/libglade:2.0 + gnome-base/gconf:2 + gnome-base/gnome-panel + x11-wm/metacity + >=x11-libs/libxklavier-3.5 + virtual/xft + app-text/iso-codes + + x11-libs/gksu + x11-libs/libXi + x11-libs/libXau + x11-libs/libX11 + x11-libs/libXext + x11-apps/sessreg + x11-libs/libXdmcp + sys-auth/consolekit + virtual/pam + sys-auth/pambase[gnome-keyring?] + + accessibility? ( x11-libs/libXevie ) + afs? ( net-fs/openafs sys-libs/lwp ) + gnome-keyring? ( + gnome-base/gnome-keyring[pam] + ) + policykit? ( >=sys-auth/policykit-0.8 ) + selinux? ( sys-libs/libselinux ) + tcpd? ( >=sys-apps/tcp-wrappers-7.6 ) + xinerama? ( x11-libs/libXinerama ) + !gnome-extra/fast-user-switch-applet" +DEPEND="${RDEPEND} + test? ( >=dev-libs/check-0.9.4 ) + sys-devel/gettext + x11-proto/inputproto + >=dev-util/intltool-0.40 + >=dev-util/pkgconfig-0.19 + >=app-text/scrollkeeper-0.1.4 + >=app-text/gnome-doc-utils-0.3.2" + +DOCS="AUTHORS ChangeLog NEWS README TODO" + +pkg_setup() { + G2CONF="${G2CONF} + --disable-schemas-install + --localstatedir=/var + --with-xdmcp=yes + --with-pam-prefix=/etc + --enable-authentication-scheme=pam + --with-console-kit=yes + $(use_with accessibility xevie) + $(use_enable debug) + $(use_enable ipv6) + $(use_enable policykit polkit) + $(use_with selinux) + $(use_with tcpd tcp-wrappers) + $(use_with xinerama)" + + enewgroup gdm + enewuser gdm -1 -1 /var/lib/gdm gdm +} + +src_unpack() { + gnome2_src_unpack + + # remove unneeded linker directive for selinux (#41022) + epatch "${FILESDIR}/${PN}-selinux-remove-attr.patch" + epatch "${FILESDIR}/${PN}-fix-daemonize-regression.patch" + # Ugh. B0rked upstream. + cp "/usr/share/gnome-doc-utils/gnome-doc-utils.make" . +} + +src_install() { + gnome2_src_install + + local gentoodir="${WORKDIR}/${GDM_EXTRA}" + + # gdm-binary should be gdm to work with our init (#5598) + rm -f "${D}/usr/sbin/gdm" + dosym /usr/sbin/gdm-binary /usr/sbin/gdm + + # our x11's scripts point to /usr/bin/gdm + dosym /usr/sbin/gdm-binary /usr/bin/gdm + + # log, etc. + keepdir /var/log/gdm + keepdir /var/gdm + + fowners root:gdm /var/gdm + fperms 1770 /var/gdm + + # use our own session script + rm -f "${D}/etc/X11/gdm/Xsession" + exeinto /etc/X11/gdm + doexe "${gentoodir}/Xsession" + + # add a custom xsession .desktop by default (#44537) + exeinto /etc/X11/dm/Sessions + doexe "${gentoodir}/custom.desktop" + + # avoid file collision, bug #213118 + rm -f "${D}/usr/share/xsessions/gnome.desktop" + + # We replace the pam stuff by our own + rm -rf "${D}/etc/pam.d" + + # GDM 2.24 doesn't work without PAM + use gnome-keyring && sed -i "s:#Keyring=::g" "${gentoodir}"/pam.d/* + + dopamd "${gentoodir}"/pam.d/* + dopamsecurity console.apps "${gentoodir}/security/console.apps/gdmsetup" +} + +pkg_postinst() { + gnome2_pkg_postinst + + ewarn + ewarn "This is an EXPERIMENTAL release, please bear with its bugs and" + ewarn "visit us on #gentoo-desktop if you have problems." + ewarn + + elog "To make GDM start at boot, edit /etc/conf.d/xdm" + elog "and then execute 'rc-update add xdm default'." + + if use gnome-keyring; then + elog "For autologin to unlock your keyring, you need to set an empty" + elog "password on your keyring. Use app-crypt/seahorse for that." + fi + + if [ -f "/etc/X11/gdm/gdm.conf" ]; then + elog "You had /etc/X11/gdm/gdm.conf which is the old configuration" + elog "file. It has been moved to /etc/X11/gdm/gdm-pre-gnome-2.16" + mv /etc/X11/gdm/gdm.conf /etc/X11/gdm/gdm-pre-gnome-2.16 + fi + + # Soft restart, assumes Gentoo defaults for file locations + # Do restart after gdm.conf move above + FIFOFILE=/var/gdm/.gdmfifo + PIDFILE=/var/run/gdm.pid + + if [ -w ${FIFOFILE} ] ; then + if [ -f ${PIDFILE} ] ; then + if kill -0 `cat ${PIDFILE}`; then + (echo;echo SOFT_RESTART) >> ${FIFOFILE} + fi + fi + fi + gnome2-live_pkg_postinst +} + +pkg_postrm() { + gnome2_pkg_postrm + + if [[ "$(rc-config list default | grep xdm)" != "" ]] ; then + elog "To remove GDM from startup please execute" + elog "'rc-update del xdm default'" + fi +} diff --git a/profiles/package.mask b/profiles/package.mask index 55ead7c..9d61aa2 100644 --- a/profiles/package.mask +++ b/profiles/package.mask @@ -4,6 +4,7 @@ # Please append to the top of this list as ebuilds are added +=gnome-base/gdm-9999 =gnome-base/gconf-9999 =net-libs/libsoup-9999 =x11-libs/gtk+-2.9999 -- cgit v1.2.3