aboutsummaryrefslogtreecommitdiffstats
path: root/main/slim
diff options
context:
space:
mode:
Diffstat (limited to 'main/slim')
-rw-r--r--main/slim/APKBUILD61
-rw-r--r--main/slim/slim-1.3.1-gcc4.4.patch17
-rw-r--r--main/slim/slim-restart.patch141
-rwxr-xr-xmain/slim/slim.initd18
-rw-r--r--main/slim/slim.install7
-rw-r--r--main/slim/slim.logrotate9
6 files changed, 253 insertions, 0 deletions
diff --git a/main/slim/APKBUILD b/main/slim/APKBUILD
new file mode 100644
index 0000000000..c0e0a22f6d
--- /dev/null
+++ b/main/slim/APKBUILD
@@ -0,0 +1,61 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=slim
+pkgver=1.3.1
+pkgrel=3
+pkgdesc="Desktop-independent graphical login manager for X11"
+url="http://slim.berlios.de/"
+license="GPL-2"
+subpackages="$pkgname-doc"
+makedepends="libxmu-dev libpng-dev jpeg-dev libxft-dev"
+depends=
+install=
+source="http://download.berlios.de/$pkgname/$pkgname-$pkgver.tar.gz
+ http://dev.alpinelinux.org/~/ncopa/alpine/slim-alpinelinux.tar.gz
+ $pkgname.logrotate
+ $pkgname.initd
+ slim-1.3.1-gcc4.4.patch
+ slim-restart.patch"
+
+prepare() {
+ cd "$srcdir/slim-$pkgver"
+ for i in ../*.patch; do
+ patch -p1 -i $i || return 1
+ done
+ sed -i -e 's|#xserver_arguments.*|xserver_arguments -nolisten tcp vt07|'\
+ -e 's|/var/run/slim.lock|/var/lock/slim.lock|' \
+ -e 's|halt_cmd.*|halt_cmd /sbin/poweroff|'\
+ -e 's|reboot_cmd.*|reboot_cmd /sbin/reboot|'\
+ -e 's|console_cmd.*|console_cmd /usr/bin/terminal|'\
+ -e 's|login_cmd.*|login_cmd exec /bin/sh -l /etc/X11/xinit/xinitrc|' \
+ -e 's|screenshot_cmd.*|screenshot_cmd scrot /slim.png|' \
+ -e 's|imagemagick|scrot|' \
+ -e 's|current_theme.*|current_theme alpinelinux|' \
+ slim.conf || return 1
+}
+
+build() {
+ cd "$srcdir/slim-$pkgver"
+ make CXX="${CXX:-g++}" CC="${CC:-gcc}" || return 1
+}
+
+package() {
+ cd "$srcdir/slim-$pkgver"
+ make DESTDIR="$pkgdir" MANDIR=/usr/share/man install || return 1
+
+ install -D -m755 ../slim.initd "$pkgdir"/etc/init.d/slim || return 1
+ install -D -m644 ../slim.logrotate "$pkgdir"/etc/logrotate.d/slim
+
+ # install our default theme
+ cd "$srcdir"/slim-alpinelinux
+ install -d "$pkgdir"/usr/share/slim/themes/alpinelinux
+ cp background.png panel.png slim.theme \
+ "$pkgdir"/usr/share/slim/themes/alpinelinux/
+ rm -rf "$pkgdir"/usr/share/slim/themes/default
+}
+
+md5sums="727d0acb24c0fbf0751134c37a9c895f slim-1.3.1.tar.gz
+cd63232c7770b0e67a009a94c2a46b82 slim-alpinelinux.tar.gz
+43da096480bf72c3ccec8ad8400f34f0 slim.logrotate
+6ee3a023e56052528295034be809cfc6 slim.initd
+a00df4316e2392fff7e75daf5c826cae slim-1.3.1-gcc4.4.patch
+648d871fe7d2a97b7d7b928019e2feee slim-restart.patch"
diff --git a/main/slim/slim-1.3.1-gcc4.4.patch b/main/slim/slim-1.3.1-gcc4.4.patch
new file mode 100644
index 0000000000..5708d70717
--- /dev/null
+++ b/main/slim/slim-1.3.1-gcc4.4.patch
@@ -0,0 +1,17 @@
+Patch to allow compilation with gcc-4.4
+
+Notified by Daniel J. - from Debian bug tracker
+
+http://bugs.gentoo.org/252745
+
+--- a/switchuser.h 2008-11-11 19:40:18.000000000 +0000
++++ b/switchuser.h 2008-11-11 19:40:28.000000000 +0000
+@@ -18,6 +18,7 @@
+ #include <pwd.h>
+ #include <grp.h>
+ #include <paths.h>
++#include <cstdio>
+ #include <iostream>
+ #include "const.h"
+ #include "cfg.h"
+
diff --git a/main/slim/slim-restart.patch b/main/slim/slim-restart.patch
new file mode 100644
index 0000000000..1f9c02dfff
--- /dev/null
+++ b/main/slim/slim-restart.patch
@@ -0,0 +1,141 @@
+diff -ur 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 2008-11-21 20:38:48.000000000 +0100
+@@ -102,6 +102,11 @@
+
+ extern App* LoginApp;
+
++int xioerror(Display *disp) {
++ LoginApp->RestartServer();
++ return 0;
++}
++
+ void CatchSignal(int sig) {
+ cerr << APPNAME << ": unexpected signal " << sig << endl;
+ LoginApp->StopServer();
+@@ -109,19 +114,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);
+ }
+@@ -267,7 +259,6 @@
+ signal(SIGHUP, CatchSignal);
+ signal(SIGPIPE, CatchSignal);
+ signal(SIGUSR1, User1Signal);
+- signal(SIGALRM, AlarmSignal);
+
+ #ifndef XNEST_DEBUG
+ OpenLog();
+@@ -287,7 +278,6 @@
+
+ CreateServerAuth();
+ StartServer();
+- alarm(2);
+ #endif
+
+ }
+@@ -603,6 +593,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");
+@@ -648,9 +640,6 @@
+
+
+ void App::Reboot() {
+- // Stop alarm clock
+- alarm(0);
+-
+ #ifdef USE_PAM
+ try{
+ pam.end();
+@@ -673,9 +662,6 @@
+
+
+ void App::Halt() {
+- // Stop alarm clock
+- alarm(0);
+-
+ #ifdef USE_PAM
+ try{
+ pam.end();
+@@ -761,6 +747,7 @@
+
+ StopServer();
+ RemoveLock();
++ while (waitpid(-1, NULL, WNOHANG) > 0); // Collects all dead childrens
+ Run();
+ }
+
+@@ -831,6 +818,7 @@
+
+ for(cycles = 0; cycles < ncycles; cycles++) {
+ if((Dpy = XOpenDisplay(DisplayName))) {
++ XSetIOErrorHandler(xioerror);
+ return 1;
+ } else {
+ if(!ServerTimeout(1, (char *) "X server to begin accepting connections"))
+@@ -913,9 +901,6 @@
+ ServerPID = -1;
+ break;
+ }
+- alarm(15);
+- pause();
+- alarm(0);
+
+ // Wait for server to start up
+ if(WaitForServer() == 0) {
+@@ -948,15 +933,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 -ur slim-1.3.1.orig/app.h slim-1.3.1/app.h
+--- slim-1.3.1.orig/app.h 2008-09-26 02:54:15.000000000 +0200
++++ slim-1.3.1/app.h 2008-11-21 20:38:48.000000000 +0100
+@@ -34,6 +34,7 @@
+ ~App();
+ void Run();
+ int GetServerPID();
++ void RestartServer();
+ void StopServer();
+
+ // Lock functions
+@@ -48,7 +49,6 @@
+ void Console();
+ void Exit();
+ void KillAllClients(Bool top);
+- void RestartServer();
+ void ReadConfig();
+ void OpenLog();
+ void CloseLog();
diff --git a/main/slim/slim.initd b/main/slim/slim.initd
new file mode 100755
index 0000000000..4ab113b6b0
--- /dev/null
+++ b/main/slim/slim.initd
@@ -0,0 +1,18 @@
+#!/sbin/runscript
+
+depends() {
+ needs localmount
+}
+
+start() {
+ ebegin "Starting slim"
+ start-stop-daemon --start --quiet --exec /usr/bin/slim -- -d
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping slim"
+ start-stop-daemon --stop --quiet --exec /usr/bin/slim
+ eend $?
+}
+
diff --git a/main/slim/slim.install b/main/slim/slim.install
new file mode 100644
index 0000000000..45eb02fa13
--- /dev/null
+++ b/main/slim/slim.install
@@ -0,0 +1,7 @@
+post_install() {
+ cat << _EOF
+
+ Add slim to the DAEMONS array in /etc/rc.conf or update /etc/inittab.
+
+_EOF
+}
diff --git a/main/slim/slim.logrotate b/main/slim/slim.logrotate
new file mode 100644
index 0000000000..26ec3b0f42
--- /dev/null
+++ b/main/slim/slim.logrotate
@@ -0,0 +1,9 @@
+/var/log/slim.log {
+ compress
+ rotate 1
+ size 1024k
+ notifempty
+ missingok
+ copytruncate
+ noolddir
+}