diff options
author | Jeremy Olexa <darkside@gentoo.org> | 2011-08-16 02:18:37 +0000 |
---|---|---|
committer | Jeremy Olexa <darkside@gentoo.org> | 2011-08-16 02:18:37 +0000 |
commit | 4e473b155b2735eb2cc7c1f17fc87ab2422bf596 (patch) | |
tree | 7dc4f5cf8a164c2dd8e2098549ecc8acfdb07acc /x11-misc/slim | |
parent | Old version cleanup (diff) | |
download | gentoo-2-4e473b155b2735eb2cc7c1f17fc87ab2422bf596.tar.gz gentoo-2-4e473b155b2735eb2cc7c1f17fc87ab2422bf596.tar.bz2 gentoo-2-4e473b155b2735eb2cc7c1f17fc87ab2422bf596.zip |
New Xsession script, bug 334111 by Ian Stakenvicius
(Portage version: 2.1.10.6/cvs/Linux x86_64)
Diffstat (limited to 'x11-misc/slim')
-rw-r--r-- | x11-misc/slim/ChangeLog | 8 | ||||
-rw-r--r-- | x11-misc/slim/files/Xsession-r2 | 158 | ||||
-rw-r--r-- | x11-misc/slim/slim-1.3.2-r4.ebuild | 118 |
3 files changed, 283 insertions, 1 deletions
diff --git a/x11-misc/slim/ChangeLog b/x11-misc/slim/ChangeLog index fea63e515bf3..db5cdc2871c6 100644 --- a/x11-misc/slim/ChangeLog +++ b/x11-misc/slim/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for x11-misc/slim # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/x11-misc/slim/ChangeLog,v 1.67 2011/08/09 17:38:39 ssuominen Exp $ +# $Header: /var/cvsroot/gentoo-x86/x11-misc/slim/ChangeLog,v 1.68 2011/08/16 02:18:37 darkside Exp $ + +*slim-1.3.2-r4 (16 Aug 2011) + + 16 Aug 2011; Jeremy Olexa <darkside@gentoo.org> +slim-1.3.2-r4.ebuild, + +files/Xsession-r2: + New Xsession script, bug 334111 by Ian Stakenvicius 09 Aug 2011; Samuli Suominen <ssuominen@gentoo.org> slim-1.3.2-r3.ebuild, +files/slim-1.3.2-libpng15.patch: diff --git a/x11-misc/slim/files/Xsession-r2 b/x11-misc/slim/files/Xsession-r2 new file mode 100644 index 000000000000..237fb3630661 --- /dev/null +++ b/x11-misc/slim/files/Xsession-r2 @@ -0,0 +1,158 @@ +#!/bin/sh +# +# Slim login manager Xsession script +# + +command="$@" + +# this will go into slim.log along with all other echo's +# good for debugging where things go wrong +echo "$0: Beginning session setup..." + +# First read /etc/profile and .profile +test -f /etc/profile && . /etc/profile +test -f "$HOME/.profile" && . "$HOME/.profile" +# Second read /etc/xprofile and .xprofile for X specific setup +test -f /etc/xprofile && . /etc/xprofile +test -f "$HOME/.xprofile" && . "$HOME/.xprofile" + +# wrap possible arguments to determine whether to treat special or not +if [ "x$command" = "xcustom" ] || [ "x$command" = "xCustom" ] || [ "x$command" = "xdefault" ] || [ "x$command" = "xDefault" ]; then + command="Xsession" +fi +if [ "x$command" = "x" ]; then + # no default specified, check if Xsession will complete + # and if not then assign XSESSION to command + if [ -x "$HOME/.xsession" ] || [ -x "$HOME/.Xclients" ] || [ -x /etc/X11/xinit/Xclients ] || [ -x /etc/X11/Xclients ]; then + command="Xsession" + else + command=$XSESSION + fi +fi + +# most of this is from /etc/X11/chooser.sh +sessionscript="" +if [ -n "${command}" ]; then + # find a match for $command in /etc/X11/Sessions + for x in /etc/X11/Sessions/* ; do + if [ "`echo ${x##*/} | awk '{ print toupper($1) }'`" = "`echo ${command} | awk '{ print toupper($1) }'`" ]; then + sessionscript=${x} + break + fi + done + if [ -n "${sessionscript}" ]; then + if [ -x "${sessionscript}" ]; then + command="${sessionscript}" + else + command="/bin/sh ${sessionscript}" + fi + else + + # find an executable for $command + x="" + y="" + + for x in "${command}" "`echo ${command} | awk '{ print toupper($1) }'`" "`echo ${command} | awk '{ print tolower($1) }'`" + do + # Fall through ... + if [ -x "`which ${x} 2>/dev/null`" ]; then + y="`which ${x} 2>/dev/null`" + break + fi + done + # note , if the command could not be found then $command will be empty + command="$y" + unset x + unset y + fi +fi + +# call xrdb and xmodmap and such, since $command is not a session script +if [ -z "${sessionscript}" ]; then + 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 +fi +unset sessionscript + +# start failsafe session +if [ -z "${command}" ]; then + echo "$0: Failed to find a command to start the session, so starting a failsafe xterm." + exec xterm -geometry 80x24+0+0 +fi + +# run all system xinitrc shell scripts which will update command +if [ -d /etc/X11/xinit/xinitrc.d ]; then + for i in /etc/X11/xinit/xinitrc.d/* ; do + if [ -x "$i" ]; then + . "$i" + fi + done + unset i +fi + +echo "$0: Setup done, will execute: $command" +exec $command + +# vim:ts=4 diff --git a/x11-misc/slim/slim-1.3.2-r4.ebuild b/x11-misc/slim/slim-1.3.2-r4.ebuild new file mode 100644 index 000000000000..296efc9a9368 --- /dev/null +++ b/x11-misc/slim/slim-1.3.2-r4.ebuild @@ -0,0 +1,118 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/x11-misc/slim/slim-1.3.2-r4.ebuild,v 1.1 2011/08/16 02:18:37 darkside Exp $ + +EAPI=2 + +inherit toolchain-funcs pam eutils + +DESCRIPTION="Simple Login Manager" +HOMEPAGE="http://slim.berlios.de" +SRC_URI="mirror://berlios/${PN}/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" +IUSE="branding pam" + +RDEPEND="x11-libs/libXmu + x11-libs/libX11 + x11-libs/libXpm + x11-libs/libXft + >=media-libs/libpng-1.4 + virtual/jpeg + x11-apps/sessreg + pam? ( virtual/pam )" +DEPEND="${RDEPEND} + dev-util/pkgconfig + x11-proto/xproto" +PDEPEND="branding? ( >=x11-themes/slim-themes-1.2.3a-r3 )" + +src_prepare() { + # respect C[XX]FLAGS, fix crosscompile, + # fix linking order for --as-needed" + sed -i -e "s:^CXX=.*:CXX=$(tc-getCXX) ${CXXFLAGS}:" \ + -e "s:^CC=.*:CC=$(tc-getCC) ${CFLAGS}:" \ + -e "s:^MANDIR=.*:MANDIR=/usr/share/man:" \ + -e "s:^\t\(.*\)\ \$(LDFLAGS)\ \(.*\):\t\1\ \2\ \$(LDFLAGS):g" \ + -e "s:-I/usr/include/libpng12:$(pkg-config --cflags-only-I libpng):" \ + -e "s:-lpng12:$(pkg-config --libs-only-l libpng):" \ + -r -e "s:^LDFLAGS=(.*):LDFLAGS=\1 ${LDFLAGS}:" \ + Makefile || die "sed failed in Makefile" + # Our Gentoo-specific config changes + epatch "${FILESDIR}"/${PN}-1.3.2-r2-config.diff + + if use elibc_FreeBSD; then + sed -i -e "s/CUSTOM=-DHAVE_SHADOW/CUSTOM=-DNEEDS_BASENAME/" Makefile \ + || die "sed failed in Makefile" + epatch "${FILESDIR}"/${PN}-1.3.2-bsd-install.patch + fi + + if use branding; then + sed -i -e 's/ default/ slim-gentoo-simple/' slim.conf || die + fi + + # Gentoo bug 297655 + epatch "${FILESDIR}"/14509-fix-keyboard-in-tty-from-which-${PN}-is-lauched.patch + # Upstream bug #15287 + epatch "${FILESDIR}"/15287-fix-pam-authentication-with-pam_unix2.patch + # Gentoo Bug 261713 + epatch "${FILESDIR}"/261713-restart-xserver-if-killed.patch + # Gentoo bug 261359, upstream 15326 + epatch "${FILESDIR}"/261359-fix-SIGTERM-freeze.patch + # Gentoo bug 346037 + epatch "${FILESDIR}"/346037-stop_setting_host_for_pam_ck_connector_so.patch + # Gentoo bug 378505 + epatch "${FILESDIR}"/${P}-libpng15.patch +} + +src_compile() { + if use pam ; then + emake USE_PAM=1 || die "emake failed." + else + emake || die "emake failed." + fi +} + +src_install() { + if use pam ; then + emake USE_PAM=1 DESTDIR="${D}" install || die "emake install failed." + pamd_mimic system-local-login slim auth account session + else + emake DESTDIR="${D}" install || die "emake install failed." + fi + + insinto /usr/share/slim + newins "${FILESDIR}/Xsession-r2" Xsession || die "newins failed" + + insinto /etc/logrotate.d + newins "${FILESDIR}/slim.logrotate" slim || die "newins failed" + + dodoc xinitrc.sample ChangeLog README TODO THEMES +} + +pkg_postinst() { + elog + elog "The configuration file is located at /etc/slim.conf." + elog + elog "If you wish ${PN} to start automatically, set DISPLAYMANAGER=\"${PN}\" " + elog "in /etc/conf.d/xdm and run \"rc-update add xdm default\"." + elog + elog "By default, ${PN} now does proper X session selection, including ~/.xsession" + elog "support, as well as selection between sessions available in" + elog "/etc/X11/Sessions/ at login by pressing [F1]." + elog + elog "The XSESSION environment variable is still supported as a default" + elog "if no session has been specified by the user." + elog + elog "If you want to use .xinitrc in the user's home directory for session" + elog "management instead, see README and xinitrc.sample in" + elog "/usr/share/doc/${PF} and change your login_cmd in /etc/slim.conf" + elog "accordingly." + elog + if ! use pam; then + elog "You have merged ${PN} without USE=pam, this will cause ${PN} to fall back to" + elog "the console when restarting your window manager. If this is not" + elog "desired, then please remerge ${PN} with USE=pam" + fi +} |