diff options
author | Donnie Berkholz <spyderous@gentoo.org> | 2005-08-14 00:12:39 +0000 |
---|---|---|
committer | Donnie Berkholz <spyderous@gentoo.org> | 2005-08-14 00:12:39 +0000 |
commit | 5363720bbd272d88230342c90fdd7a27a84afcfe (patch) | |
tree | 16ea4193790eef32e2dd99a22e0237e766845154 /x11-apps | |
parent | Keyworded ~alpha wrt #93379 (diff) | |
download | gentoo-2-5363720bbd272d88230342c90fdd7a27a84afcfe.tar.gz gentoo-2-5363720bbd272d88230342c90fdd7a27a84afcfe.tar.bz2 gentoo-2-5363720bbd272d88230342c90fdd7a27a84afcfe.zip |
Add all the old Gentoo xinit stuff, so it works properly with /etc/rc.conf and so on.
(Portage version: 2.0.51.22-r2)
Diffstat (limited to 'x11-apps')
-rw-r--r-- | x11-apps/xinit/ChangeLog | 10 | ||||
-rw-r--r-- | x11-apps/xinit/files/Xsession | 107 | ||||
-rw-r--r-- | x11-apps/xinit/files/chooser.sh | 64 | ||||
-rw-r--r-- | x11-apps/xinit/files/digest-xinit-0.99.0-r2 | 1 | ||||
-rw-r--r-- | x11-apps/xinit/files/gentoo-startx-customization.patch | 147 | ||||
-rw-r--r-- | x11-apps/xinit/files/startDM.sh | 37 | ||||
-rw-r--r-- | x11-apps/xinit/files/xinitrc | 43 | ||||
-rw-r--r-- | x11-apps/xinit/xinit-0.99.0-r2.ebuild | 35 |
8 files changed, 443 insertions, 1 deletions
diff --git a/x11-apps/xinit/ChangeLog b/x11-apps/xinit/ChangeLog index edaee9d7c3ee..02f0b0c82b2a 100644 --- a/x11-apps/xinit/ChangeLog +++ b/x11-apps/xinit/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for x11-apps/xinit # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/x11-apps/xinit/ChangeLog,v 1.3 2005/08/11 07:33:24 spyderous Exp $ +# $Header: /var/cvsroot/gentoo-x86/x11-apps/xinit/ChangeLog,v 1.4 2005/08/14 00:12:38 spyderous Exp $ + +*xinit-0.99.0-r2 (14 Aug 2005) + + 14 Aug 2005; Donnie Berkholz <spyderous@gentoo.org>; +files/Xsession, + +files/chooser.sh, +files/gentoo-startx-customization.patch, + +files/startDM.sh, +files/xinitrc, +xinit-0.99.0-r2.ebuild: + Add all the old Gentoo xinit stuff, so it works properly with /etc/rc.conf + and so on. *xinit-0.99.0-r1 (11 Aug 2005) diff --git a/x11-apps/xinit/files/Xsession b/x11-apps/xinit/files/Xsession new file mode 100644 index 000000000000..c86ccee19ff3 --- /dev/null +++ b/x11-apps/xinit/files/Xsession @@ -0,0 +1,107 @@ +#!/bin/sh +# $XConsortium: Xsession /main/10 1995/12/18 18:21:28 gildea $ + +case $# in +1) + case $1 in + failsafe) + exec xterm -geometry 80x24-0-0 + ;; + esac +esac + +# redirect errors to a file in user's home directory if we can +for errfile in "$HOME/.xsession-errors" "${TMPDIR-/tmp}/xses-$USER" "/tmp/xses-$USER" +do + if ( cp /dev/null "$errfile" 2> /dev/null ) + then + chmod 600 "$errfile" + exec > "$errfile" 2>&1 + break + fi +done + +# clean up after xbanner +if which freetemp 2> /dev/null ; then + freetemp +fi + +startup=$HOME/.xsession + +userresources=$HOME/.Xresources +usermodmap=$HOME/.Xmodmap +userxkbmap=$HOME/.Xkbmap + +sysresources=/etc/X11/Xresources +sysmodmap=/etc/X11/Xmodmap +sysxkbmap=/etc/X11/Xkbmap + +rh6sysresources=/etc/X11/xinit/Xresources +rh6sysmodmap=/etc/X11/xinit/Xmodmap + + +# merge in defaults +if [ -f "$rh6sysresources" ]; then + xrdb -merge "$rh6sysresources" +fi + +if [ -f "$sysresources" ]; then + xrdb -merge "$sysresources" +fi + +if [ -f "$userresources" ]; then + xrdb -merge "$userresources" +fi + +# merge in keymaps +if [ -f "$sysxkbmap" ]; then + setxkbmap `cat "$sysxkbmap"` + XKB_IN_USE=yes +fi + +if [ -f "$userxkbmap" ]; then + setxkbmap `cat "$userxkbmap"` + XKB_IN_USE=yes +fi + +# +# Eeek, this seems like too much magic here +# +if [ -z "$XKB_IN_USE" -a ! -L /etc/X11/X ]; then + if grep '^exec.*/Xsun' /etc/X11/X > /dev/null 2>&1 && [ -f /etc/X11/XF86Config ]; then + xkbsymbols=`sed -n -e 's/^[ ]*XkbSymbols[ ]*"\(.*\)".*$/\1/p' /etc/X11/XF86Config` + if [ -n "$xkbsymbols" ]; then + setxkbmap -symbols "$xkbsymbols" + XKB_IN_USE=yes + fi + fi +fi + +# xkb and xmodmap don't play nice together +if [ -z "$XKB_IN_USE" ]; then + if [ -f "$rh6sysmodmap" ]; then + xmodmap "$rh6sysmodmap" + fi + + if [ -f "$sysmodmap" ]; then + xmodmap "$sysmodmap" + fi + + if [ -f "$usermodmap" ]; then + xmodmap "$usermodmap" + fi +fi + +unset XKB_IN_USE + +if [ -x "$startup" ]; then + exec "$startup" +elif [ -x "$HOME/.Xclients" ]; then + exec "$HOME/.Xclients" +elif [ -x /etc/X11/xinit/Xclients ]; then + exec /etc/X11/xinit/Xclients +elif [ -x /etc/X11/Xclients ]; then + exec /etc/X11/Xclients +else + exec xsm +fi diff --git a/x11-apps/xinit/files/chooser.sh b/x11-apps/xinit/files/chooser.sh new file mode 100644 index 000000000000..16054d166440 --- /dev/null +++ b/x11-apps/xinit/files/chooser.sh @@ -0,0 +1,64 @@ +#!/bin/sh +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 +# Author: Martin Schlemmer <azarah@gentoo.org> +# $Header: /var/cvsroot/gentoo-x86/x11-apps/xinit/files/chooser.sh,v 1.1 2005/08/14 00:12:39 spyderous Exp $ + +# If $XSESSION is "", source first /etc/conf.d/basic, and then /etc/rc.conf +if [ -z "${XSESSION}" ] +then + [ -f /etc/conf.d/basic ] && source /etc/conf.d/basic + [ -f /etc/rc.conf ] && source /etc/rc.conf +fi + +# Find a match for $XSESSION in /etc/X11/Sessions +GENTOO_SESSION="" +for x in /etc/X11/Sessions/* +do + if [ "`echo ${x##*/} | awk '{ print toupper($1) }'`" \ + = "`echo ${XSESSION} | awk '{ print toupper($1) }'`" ] + then + GENTOO_SESSION=${x} + break + fi +done + +GENTOO_EXEC="" + +if [ -n "${XSESSION}" ]; then + if [ -f /etc/X11/Sessions/${XSESSION} ]; then + if [ -x /etc/X11/Sessions/${XSESSION} ]; then + GENTOO_EXEC="/etc/X11/Sessions/${XSESSION}" + else + GENTOO_EXEC="/bin/sh /etc/X11/Sessions/${XSESSION}" + fi + elif [ -n "${GENTOO_SESSION}" ]; then + if [ -x "${GENTOO_SESSION}" ]; then + GENTOO_EXEC="${GENTOO_SESSION}" + else + GENTOO_EXEC="/bin/sh ${GENTOO_SESSION}" + fi + else + x="" + y="" + + for x in "${XSESSION}" \ + "`echo ${XSESSION} | awk '{ print toupper($1) }'`" \ + "`echo ${XSESSION} | awk '{ print tolower($1) }'`" + do + # Fall through ... + if [ -x "`which ${x} 2>/dev/null`" ]; then + GENTOO_EXEC="`which ${x} 2>/dev/null`" + break + fi + done + + # If all else fail, run twm + GENTOO_EXEC="/usr/X11R6/bin/twm" + fi +fi + +echo "${GENTOO_EXEC}" + + +# vim:ts=4 diff --git a/x11-apps/xinit/files/digest-xinit-0.99.0-r2 b/x11-apps/xinit/files/digest-xinit-0.99.0-r2 new file mode 100644 index 000000000000..01b203ff7286 --- /dev/null +++ b/x11-apps/xinit/files/digest-xinit-0.99.0-r2 @@ -0,0 +1 @@ +MD5 2485a867cc0ed4470e0c458518552dad xinit-0.99.0.tar.bz2 66503 diff --git a/x11-apps/xinit/files/gentoo-startx-customization.patch b/x11-apps/xinit/files/gentoo-startx-customization.patch new file mode 100644 index 000000000000..f1246d84f4e0 --- /dev/null +++ b/x11-apps/xinit/files/gentoo-startx-customization.patch @@ -0,0 +1,147 @@ +--- XFree86-4.2.99.3/xc/programs/xinit/startx.cpp.startx 2002-09-19 02:19:38.000000000 +0200 ++++ XFree86-4.2.99.3/xc/programs/xinit/startx.cpp 2002-12-23 13:13:22.000000000 +0100 +@@ -52,8 +52,6 @@ + userserverrc=$HOME/.xserverrc + sysclientrc=XINITDIR/xinitrc + sysserverrc=XINITDIR/xserverrc +-defaultclient=BINDIR/xterm +-defaultserver=BINDIR/X + defaultclientargs="" + defaultserverargs="" + clientargs="" +@@ -82,60 +80,41 @@ + whoseargs="client" + while [ x"$1" != x ]; do + case "$1" in +- XCOMM '' required to prevent cpp from treating "/*" as a C comment. +- /''*|\./''*) +- if [ "$whoseargs" = "client" ]; then +- if [ x"$clientargs" = x ]; then +- client="$1" +- else +- clientargs="$clientargs $1" +- fi +- else +- if [ x"$serverargs" = x ]; then +- server="$1" +- else +- serverargs="$serverargs $1" +- fi +- fi +- ;; +- --) +- whoseargs="server" +- ;; +- *) +- if [ "$whoseargs" = "client" ]; then +- clientargs="$clientargs $1" +- else +- XCOMM display must be the FIRST server argument +- if [ x"$serverargs" = x ] && @@ +- expr "$1" : ':[0-9][0-9]*$' > /dev/null 2>&1; then +- display="$1" +- else +- serverargs="$serverargs $1" +- fi +- fi +- ;; ++ /''*|\.*) if [ "$whoseargs" = "client" ]; then ++ if [ "x$clientargs" = x ]; then ++ clientargs="$1" ++ else ++ clientargs="$clientargs $1" ++ fi ++ else ++ if [ "x$serverargs" = x ]; then ++ serverargs="$1" ++ else ++ serverargs="$serverargs $1" ++ fi ++ fi ;; ++ --) whoseargs="server" ;; ++ *) if [ "$whoseargs" = "client" ]; then ++ if [ "x$clientargs" = x ]; then ++ clientargs="$defaultclientargs $1" ++ else ++ clientargs="$clientargs $1" ++ fi ++ else ++ case "$1" in ++ :[0-9]*) display="$1"; serverargs="$serverargs $1";; ++ *) serverargs="$serverargs $1" ;; ++ esac ++ fi ;; + esac + shift + done + +-XCOMM process client arguments +-if [ x"$client" = x ]; then +- XCOMM if no client arguments either, use rc file instead +- if [ x"$clientargs" = x ]; then +- client="$defaultclientargs" +- else +- client=$defaultclient +- fi ++if [ x"$clientargs" = x ]; then ++ clientargs="$defaultclientargs" + fi +- +-XCOMM process server arguments +-if [ x"$server" = x ]; then +- XCOMM if no server arguments or display either, use rc file instead +- if [ x"$serverargs" = x -a x"$display" = x ]; then +- server="$defaultserverargs" +- else +- server=$defaultserver +- fi ++if [ x"$serverargs" = x ]; then ++ serverargs="$defaultserverargs" + fi + + if [ x"$XAUTHORITY" = x ]; then +@@ -172,7 +151,9 @@ + done + #endif + +-xinit $client $clientargs -- $server $display $serverargs ++cleanup() { ++ [ -n "$PID" ] && kill $PID > /dev/null 2>&1 ++ + + if [ x"$removelist" != x ]; then + xauth remove $removelist +@@ -195,3 +176,15 @@ + #if defined(sun) && !defined(i386) + kbd_mode -a + #endif ++} ++ ++ ++trap cleanup 0 ++ ++xinit $clientargs -- $serverargs -deferglyphs 16 & ++ ++PID=$! ++ ++wait $PID ++ ++unset PID +--- XFree86-4.2.99.3/xc/programs/xinit/xinit.c.startx 2002-05-31 20:46:13.000000000 +0200 ++++ XFree86-4.2.99.3/xc/programs/xinit/xinit.c 2002-12-23 13:27:35.000000000 +0100 +@@ -431,6 +431,7 @@ + signal(SIGINT, sigCatch); + signal(SIGHUP, sigCatch); + signal(SIGPIPE, sigCatch); ++ signal(SIGTERM, sigCatch); + #else + /* Let those signal interrupt the wait() call in the main loop */ + memset(&sa, 0, sizeof sa); +@@ -442,6 +443,7 @@ + sigaction(SIGINT, &sa, NULL); + sigaction(SIGHUP, &sa, NULL); + sigaction(SIGPIPE, &sa, NULL); ++ sigaction(SIGTERM, &sa, NULL); + #endif + signal(SIGALRM, sigAlarm); + signal(SIGUSR1, sigUsr1); diff --git a/x11-apps/xinit/files/startDM.sh b/x11-apps/xinit/files/startDM.sh new file mode 100644 index 000000000000..ad2c9ead627a --- /dev/null +++ b/x11-apps/xinit/files/startDM.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 +# Author: Martin Schlemmer <azarah@gentoo.org> +# $Header: /var/cvsroot/gentoo-x86/x11-apps/xinit/files/startDM.sh,v 1.1 2005/08/14 00:12:39 spyderous Exp $ + +source /etc/init.d/functions.sh + +# We need to source /etc/profile for stuff like $LANG to work +# bug #10190. +source /etc/profile + +# Great new Gnome2 feature, AA +# We enable this by default +export GDK_USE_XFT=1 + +if [ -e ${svcdir}/options/xdm/service ] +then + retval=0 + EXE="`cat ${svcdir}/options/xdm/service`" + + /sbin/start-stop-daemon --start --quiet --exec ${EXE} + retval=$? + # Fix bug #26125 for slower systems + wait; sleep 2 + + if [ "${retval}" -ne 0 ] + then + # there was a error running the DM + einfo "ERROR: could not start the Display Manager..." + # make sure we do not have a misbehaving DM + killall -9 ${EXE##*/} + fi +fi + + +# vim:ts=4 diff --git a/x11-apps/xinit/files/xinitrc b/x11-apps/xinit/files/xinitrc new file mode 100644 index 000000000000..53cde32559d2 --- /dev/null +++ b/x11-apps/xinit/files/xinitrc @@ -0,0 +1,43 @@ +#!/bin/sh +# $Xorg: xinitrc.cpp,v 1.3 2000/08/17 19:54:30 cpqbld Exp $ + +userresources=$HOME/.Xresources +usermodmap=$HOME/.Xmodmap +xinitdir=/usr/X11R6/lib/X11/xinit +sysresources=$xinitdir/.Xresources +sysmodmap=$xinitdir/.Xmodmap + +# merge in defaults and keymaps + +if [ -f $sysresources ]; then + xrdb -merge $sysresources +fi + +if [ -f $sysmodmap ]; then + xmodmap $sysmodmap +fi + +if [ -f $userresources ]; then + xrdb -merge $userresources +fi + +if [ -f $usermodmap ]; then + xmodmap $usermodmap +fi + +# First try ~/.xinitrc +if [ -f "$HOME/.xinitrc" ]; then + XINITRC="$HOME/.xinitrc" + exec /bin/sh "$HOME/.xinitrc" +# If not present, try the system default +elif [ -n "`/etc/X11/chooser.sh`" ]; then + exec "`/etc/X11/chooser.sh`" +# Failsafe +else + # start some nice programs + twm & + xclock -geometry 50x50-1+1 & + xterm -geometry 80x50+494+51 & + xterm -geometry 80x20+494-0 & + exec xterm -geometry 80x66+0+0 -name login +fi diff --git a/x11-apps/xinit/xinit-0.99.0-r2.ebuild b/x11-apps/xinit/xinit-0.99.0-r2.ebuild new file mode 100644 index 000000000000..9a7d11e3f7c9 --- /dev/null +++ b/x11-apps/xinit/xinit-0.99.0-r2.ebuild @@ -0,0 +1,35 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/x11-apps/xinit/xinit-0.99.0-r2.ebuild,v 1.1 2005/08/14 00:12:38 spyderous Exp $ + +# Must be before x-modular eclass is inherited +SNAPSHOT="yes" + +inherit x-modular + +DESCRIPTION="X.Org xinit application" +KEYWORDS="~sparc ~x86" +RDEPEND="x11-libs/libX11" +DEPEND="${RDEPEND}" + +PATCHES="${FILESDIR}/nolisten-tcp-and-black-background.patch + ${FILESDIR}/gentoo-startx-customization.patch" + +src_unpack() { + x-modular_unpack_source + x-modular_patch_source + + sed -i -e "s:^XINITDIR.*:XINITDIR = \$(sysconfdir)/X11/xinit:g" ${S}/Makefile.am + + x-modular_reconf_source +} + +src_install() { + x-modular_src_install + exeinto /etc/X11 + doexe ${FILESDIR}/chooser.sh ${FILESDIR}/startDM.sh + exeinto /etc/X11/Sessions + doexe ${FILESDIR}/Xsession + exeinto /etc/X11/xinit + doexe ${FILESDIR}/xinitrc +} |