diff --git a/x11-misc/slim/Manifest b/x11-misc/slim/Manifest new file mode 100644 index 0000000..b125aa4 --- /dev/null +++ b/x11-misc/slim/Manifest @@ -0,0 +1,8 @@ +AUX 14509-fix-keyboard-in-tty-from-which-slim-is-lauched.patch 754 RMD160 079984153eb6ca97dafc94b065aeff6c57cf19ee SHA1 25fc499e10133c5325823453202aefdf828c3c21 SHA256 72995a16600174994864b9af959659d321c1fc6aa093650ed0b95b6760d91a13 +AUX 15287-fix-pam-authentication-with-pam_unix2.patch 3017 RMD160 ae6a20b9eb313bd6b9f93726d5519309a2bafc85 SHA1 e17c582fe0cc1d2a07e51d410db2d61c11aba4c6 SHA256 ced3b92f48ba09cd61287b72737ea58e499a7eedd4f61e25ee1b148d0b6cfbb3 +AUX 261713-restart-xserver-if-killed.patch 3198 RMD160 97b6627b17f74a6fb88a967fee7364bdb3280710 SHA1 15d7bffb0588ac33ece488aa209c2418023d4739 SHA256 c4ff22a4930d6ef12ee6ff30f4782b64785c00d54f687ac620e5cbd5eee283f9 +AUX slim-1.3.2-config.diff 2102 RMD160 f55b6a0d9acace01c0950ffa55b0d0ea5ca2e54b SHA1 693937055fea62aa3ad037da351e9a2e8636c6ea SHA256 dea2cb302bd8dcc4318c9b1c0296d14db10c5d9f9247d48134ec1b35a9db0943 +AUX slim-1.3.2-kbd_ctrl.patch 3468 RMD160 d0e8e425994d9d17f1945c1e331e598550af13a8 SHA1 5d2e5b2dda1f6481e9ef0ecd7bbba71e7d20dc8f SHA256 0238e0e5b3536f3bed5510c0f7726dff8edbbae63c3e3b67af72760794d0df5e +AUX slim.logrotate 102 RMD160 ccf614eca8c0b8fc1fbc2dfb8bf71b02485a743b SHA1 d2bc9202862f0d33bb902eba3aa8fefe0797d7a3 SHA256 d0559cf7764147f601f2bab8077fd956b1171adad4872c0d324279f6a978264a +DIST slim-1.3.2.tar.gz 220592 RMD160 1ca6504c07ea2d420fde86b6db0f4cfbbd6680fc SHA1 e421d5487732c8317f8f591906661e014b036358 SHA256 f1560125005f253b9b88220598fed7a9575ef405716862c6ca3fcc72dbd482b8 +EBUILD slim-1.3.2-r10.ebuild 3308 RMD160 19bf7f566e791b9974b7284e5be70cd54dd954ea SHA1 929ad75b3b6a9d7b40160acbfff9127d942a95ee SHA256 a8941d85a273027b5d6d73a9d5410c2b04ad7cecff91c6ed887449883bca80da diff --git a/x11-misc/slim/files/14509-fix-keyboard-in-tty-from-which-slim-is-lauched.patch b/x11-misc/slim/files/14509-fix-keyboard-in-tty-from-which-slim-is-lauched.patch new file mode 100644 index 0000000..c9d8d0a --- /dev/null +++ b/x11-misc/slim/files/14509-fix-keyboard-in-tty-from-which-slim-is-lauched.patch @@ -0,0 +1,29 @@ +--- app.cpp.orig 2009-01-13 11:30:36.000000000 +0900 ++++ app.cpp 2009-01-13 11:32:27.000000000 +0900 +@@ -270,21 +270,22 @@ + signal(SIGALRM, AlarmSignal); + + #ifndef XNEST_DEBUG +- OpenLog(); +- + if (!force_nodaemon && cfg->getOption("daemon") == "yes") { + daemonmode = true; + } + + // Daemonize + if (daemonmode) { +- if (daemon(0, 1) == -1) { ++ if (daemon(0, 0) == -1) { + cerr << APPNAME << ": " << strerror(errno) << endl; + exit(ERR_EXIT); + } +- UpdatePid(); + } + ++ OpenLog(); ++ ++ if (daemonmode) UpdatePid(); ++ + CreateServerAuth(); + StartServer(); + alarm(2); diff --git a/x11-misc/slim/files/15287-fix-pam-authentication-with-pam_unix2.patch b/x11-misc/slim/files/15287-fix-pam-authentication-with-pam_unix2.patch new file mode 100644 index 0000000..2163d20 --- /dev/null +++ b/x11-misc/slim/files/15287-fix-pam-authentication-with-pam_unix2.patch @@ -0,0 +1,89 @@ +diff -rc slim-1.3.1-orig/app.cpp slim-1.3.1/app.cpp +*** slim-1.3.1-orig/app.cpp 2008-09-26 02:54:15.000000000 +0200 +--- slim-1.3.1/app.cpp 2009-02-17 19:50:06.000000000 +0100 +*************** +*** 41,48 **** + Panel* panel = *static_cast(appdata_ptr); + int result = PAM_SUCCESS; + for (int i=0; iresp=0; +! resp[i]->resp_retcode=0; + switch(msg[i]->msg_style){ + case PAM_PROMPT_ECHO_ON: + // We assume PAM is asking for the username +--- 41,48 ---- + Panel* panel = *static_cast(appdata_ptr); + int result = PAM_SUCCESS; + for (int i=0; imsg_style){ + case PAM_PROMPT_ECHO_ON: + // We assume PAM is asking for the username +*************** +*** 51,63 **** + case Panel::Suspend: + case Panel::Halt: + case Panel::Reboot: +! resp[i]->resp=strdup("root"); + break; + + case Panel::Console: + case Panel::Exit: + case Panel::Login: +! resp[i]->resp=strdup(panel->GetName().c_str()); + break; + } + break; +--- 51,63 ---- + case Panel::Suspend: + case Panel::Halt: + case Panel::Reboot: +! (*resp)[i].resp=strdup("root"); + break; + + case Panel::Console: + case Panel::Exit: + case Panel::Login: +! (*resp)[i].resp=strdup(panel->GetName().c_str()); + break; + } + break; +*************** +*** 73,79 **** + + default: + panel->EventHandler(Panel::Get_Passwd); +! resp[i]->resp=strdup(panel->GetPasswd().c_str()); + break; + } + break; +--- 73,79 ---- + + default: + panel->EventHandler(Panel::Get_Passwd); +! (*resp)[i].resp=strdup(panel->GetPasswd().c_str()); + break; + } + break; +*************** +*** 89,97 **** + } + if (result!=PAM_SUCCESS){ + for (int i=0; iresp==0) continue; +! free(resp[i]->resp); +! resp[i]->resp=0; + }; + free(*resp); + *resp=0; +--- 89,97 ---- + } + if (result!=PAM_SUCCESS){ + for (int i=0; iRestartServer(); ++ return 0; ++} ++ + void CatchSignal(int sig) { + cerr << APPNAME << ": unexpected signal " << sig << endl; + LoginApp->StopServer(); +@@ -107,19 +112,6 @@ + exit(ERR_EXIT); + } + +- +-void AlarmSignal(int sig) { +- int pid = LoginApp->GetServerPID(); +- if(waitpid(pid, NULL, WNOHANG) == pid) { +- LoginApp->StopServer(); +- LoginApp->RemoveLock(); +- exit(OK_EXIT); +- } +- signal(sig, AlarmSignal); +- alarm(2); +-} +- +- + void User1Signal(int sig) { + signal(sig, User1Signal); + } +@@ -257,7 +249,6 @@ + signal(SIGHUP, CatchSignal); + signal(SIGPIPE, CatchSignal); + signal(SIGUSR1, User1Signal); +- signal(SIGALRM, AlarmSignal); + + #ifndef XNEST_DEBUG + OpenLog(); +@@ -277,7 +268,6 @@ + + CreateServerAuth(); + StartServer(); +- alarm(2); + #endif + + } +@@ -575,6 +565,8 @@ + int status; + while (wpid != pid) { + wpid = wait(&status); ++ if (wpid == ServerPID) ++ xioerror(Dpy); // Server died, simulate IO error + } + if (WIFEXITED(status) && WEXITSTATUS(status)) { + LoginPanel->Message("Failed to execute login command"); +@@ -620,9 +612,6 @@ + + + void App::Reboot() { +- // Stop alarm clock +- alarm(0); +- + #ifdef USE_PAM + try{ + pam.end(); +@@ -645,9 +634,6 @@ + + + void App::Halt() { +- // Stop alarm clock +- alarm(0); +- + #ifdef USE_PAM + try{ + pam.end(); +@@ -733,6 +719,7 @@ + + StopServer(); + RemoveLock(); ++ while (waitpid(-1, NULL, WNOHANG) > 0); // Collects all dead childrens + Run(); + } + +@@ -803,6 +790,7 @@ + + for(cycles = 0; cycles < ncycles; cycles++) { + if((Dpy = XOpenDisplay(DisplayName))) { ++ XSetIOErrorHandler(xioerror); + return 1; + } else { + if(!ServerTimeout(1, "X server to begin accepting connections")) +@@ -885,9 +873,6 @@ + ServerPID = -1; + break; + } +- alarm(15); +- pause(); +- alarm(0); + + // Wait for server to start up + if(WaitForServer() == 0) { +@@ -920,15 +905,12 @@ + + + void App::StopServer() { +- // Stop alars clock and ignore signals +- alarm(0); + signal(SIGQUIT, SIG_IGN); + signal(SIGINT, SIG_IGN); + signal(SIGHUP, SIG_IGN); + signal(SIGPIPE, SIG_IGN); + signal(SIGTERM, SIG_DFL); + signal(SIGKILL, SIG_DFL); +- signal(SIGALRM, SIG_DFL); + + // Catch X error + XSetIOErrorHandler(IgnoreXIO); diff --git a/x11-misc/slim/files/slim-1.3.2-config.diff b/x11-misc/slim/files/slim-1.3.2-config.diff new file mode 100644 index 0000000..e05711b --- /dev/null +++ b/x11-misc/slim/files/slim-1.3.2-config.diff @@ -0,0 +1,57 @@ +--- slim.conf.orig 2010-07-08 00:04:10.000000000 -0500 ++++ slim.conf 2010-07-30 21:46:14.713367279 -0500 +@@ -2,7 +2,7 @@ + # Note: -xauth $authfile is automatically appended + default_path /bin:/usr/bin:/usr/local/bin + default_xserver /usr/bin/X +-#xserver_arguments -dpi 75 ++xserver_arguments -nolisten tcp -br -deferglyphs 16 + + # Commands for halt, login, etc. + halt_cmd /sbin/shutdown -h now +@@ -18,7 +18,7 @@ + + + # Activate numlock when slim starts. Valid values: on|off +-# numlock on ++numlock on + + # Hide the mouse cursor (note: does not work with some WMs). + # Valid values: true|false +@@ -33,7 +33,8 @@ + # to adjust the command according to your preferred shell, + # i.e. for freebsd use: + # login_cmd exec /bin/sh - ~/.xinitrc %session +-login_cmd exec /bin/bash -login ~/.xinitrc %session ++# login_cmd exec /bin/bash -login ~/.xinitrc %session ++login_cmd exec /bin/bash -login /etc/X11/xinit/xinitrc + + # Commands executed when starting and exiting a session. + # They can be used for registering a X11 session with +@@ -41,11 +42,13 @@ + # + # sessionstart_cmd some command + # sessionstop_cmd some command ++sessionstart_cmd /usr/bin/sessreg -a -l :0.0 %user ++sessionstop_cmd /usr/bin/sessreg -d -l :0.0 %user + + # Start in daemon mode. Valid values: yes | no + # Note that this can be overriden by the command line + # options "-d" and "-nodaemon" +-# daemon yes ++daemon yes + + # Available sessions (first one is the default). + # The current chosen session name is replaced in the login_cmd +@@ -53,8 +56,10 @@ + # see the xinitrc.sample file shipped with slim sources + sessions xfce4,icewm,wmaker,blackbox + +-# Executed when pressing F11 (requires imagemagick) ++# Executed when pressing F11 (requires media-gfx/imagemagick for import) ++# Alternative is media-gfx/scrot. See Gentoo bug 252241 for more info. + screenshot_cmd import -window root /slim.png ++#screenshot_cmd scrot /root/slim.png + + # welcome message. Available variables: %host, %domain + welcome_msg Welcome to %host diff --git a/x11-misc/slim/files/slim-1.3.2-kbd_ctrl.patch b/x11-misc/slim/files/slim-1.3.2-kbd_ctrl.patch new file mode 100644 index 0000000..849d978 --- /dev/null +++ b/x11-misc/slim/files/slim-1.3.2-kbd_ctrl.patch @@ -0,0 +1,107 @@ +diff -ur slim-1.3.2_orig/app.cpp slim-1.3.2/app.cpp +--- slim-1.3.2_orig/app.cpp 2010-07-08 07:04:10.000000000 +0200 ++++ slim-1.3.2/app.cpp 2010-08-18 21:47:42.000000000 +0200 +@@ -50,6 +50,15 @@ + // We assume PAM is asking for the username + panel->EventHandler(Panel::Get_Name); + switch(panel->getAction()){ ++ case Panel::KSuspend: ++ Suspend(); ++ break; ++ case Panel::KHalt: ++ Halt(); ++ break; ++ case Panel::KReboot: ++ Reboot(); ++ break; + case Panel::Suspend: + case Panel::Halt: + case Panel::Reboot: +@@ -394,12 +403,15 @@ + case Panel::Console: + Console(); + break; ++ case Panel::KReboot: + case Panel::Reboot: + Reboot(); + break; ++ case Panel::KHalt: + case Panel::Halt: + Halt(); + break; ++ case Panel::KSuspend: + case Panel::Suspend: + Suspend(); + break; +@@ -420,6 +432,9 @@ + } + catch(PAM::Auth_Exception& e){ + switch(LoginPanel->getAction()){ ++ case Panel::KSuspend: ++ case Panel::KReboot: ++ case Panel::KHalt: + case Panel::Exit: + case Panel::Console: + return true; // <--- This is simply fake! +@@ -440,6 +455,9 @@ + if (!focuspass){ + LoginPanel->EventHandler(Panel::Get_Name); + switch(LoginPanel->getAction()){ ++ case Panel::KSuspend: ++ case Panel::KReboot: ++ case Panel::KHalt: + case Panel::Exit: + case Panel::Console: + cerr << APPNAME << ": Got a special command (" << LoginPanel->GetName() << ")" << endl; +@@ -454,6 +472,10 @@ + struct passwd *pw; + + switch(LoginPanel->getAction()){ ++ case Panel::KSuspend: ++ case Panel::KHalt: ++ case Panel::KReboot: ++ return true; + case Panel::Suspend: + case Panel::Halt: + case Panel::Reboot: +diff -ur slim-1.3.2_orig/panel.cpp slim-1.3.2/panel.cpp +--- slim-1.3.2_orig/panel.cpp 2010-07-08 07:04:10.000000000 +0200 ++++ slim-1.3.2/panel.cpp 2010-08-17 21:28:19.000000000 +0200 +@@ -351,6 +351,22 @@ + string formerString = ""; + + XLookupString(&event.xkey, &ascii, 1, &keysym, &compstatus); ++ if (reinterpret_cast(event).state & ControlMask) { ++ switch(keysym){ ++ case XK_s: ++ action = KSuspend; ++ return false; ++ case XK_h: ++ action = KHalt; ++ return false; ++ case XK_r: ++ action = KReboot; ++ return false; ++ default: ++ break; ++ } ++ } ++ + switch(keysym){ + case XK_F1: + SwitchSession(); +diff -ur slim-1.3.2_orig/panel.h slim-1.3.2/panel.h +--- slim-1.3.2_orig/panel.h 2010-07-08 07:04:10.000000000 +0200 ++++ slim-1.3.2/panel.h 2010-08-17 21:28:37.000000000 +0200 +@@ -40,7 +40,10 @@ + Reboot, + Halt, + Exit, +- Suspend ++ Suspend, ++ KHalt, ++ KReboot, ++ KSuspend + }; + enum FieldType { + Get_Name, diff --git a/x11-misc/slim/files/slim.logrotate b/x11-misc/slim/files/slim.logrotate new file mode 100644 index 0000000..8901530 --- /dev/null +++ b/x11-misc/slim/files/slim.logrotate @@ -0,0 +1,9 @@ +/var/log/slim.log { + compress + rotate 4 + weekly + delaycompress + copytruncate + missingok + notifempty +} diff --git a/x11-misc/slim/slim-1.3.2-r10.ebuild b/x11-misc/slim/slim-1.3.2-r10.ebuild new file mode 100644 index 0000000..329b2ad --- /dev/null +++ b/x11-misc/slim/slim-1.3.2-r10.ebuild @@ -0,0 +1,104 @@ +# Copyright 1999-2010 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.ebuild,v 1.1 2010/07/31 02:58:39 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" +IUSE="branding screenshot pam" + +RDEPEND="x11-libs/libXmu + x11-libs/libX11 + x11-libs/libXpm + x11-libs/libXft + media-libs/libpng + media-libs/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" + epatch "${FILESDIR}/${PN}-1.3.2-config.diff" + + 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" + # Add suport for keyboard shortcuts rather, than commands + epatch "${FILESDIR}/${PN}-1.3.2-kbd_ctrl.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 slim auth account password session + else + emake DESTDIR="${D}" install || die "emake install failed." + fi + + 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 "By default, ${PN} will use default XSESSION value set in /etc/rc.conf." + 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 + elog "Now you can use shortcuts to perform actions like:" + elog " - Halt (CTRL-H)" + elog " - Reboot (CTRL-R)" + elog " - Suspend (CTRL-S)" + elog "All actions are performed without password prompt." + 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 +}