Gentoo Archives: gentoo-commits

From: Michael Weber <xmw@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/xmw:master commit in: x11-misc/trivdm/, x11-misc/trivdm/files/
Date: Tue, 27 Sep 2011 21:49:54
Message-Id: 50fa44f844c7b35a6d7fc21922fda7520ce955c9.xmw@gentoo
1 commit: 50fa44f844c7b35a6d7fc21922fda7520ce955c9
2 Author: Michael Weber <xmw <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 27 21:49:17 2011 +0000
4 Commit: Michael Weber <xmw <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 27 21:49:17 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/xmw.git;a=commit;h=50fa44f8
7
8 Version bump, added CONFIG_PROTECT
9
10 (Portage version: 2.1.10.11/git/Linux x86_64, signed Manifest commit with key 62EEF090)
11
12 ---
13 x11-misc/trivdm/ChangeLog | 6 +++
14 x11-misc/trivdm/Manifest | 10 +++--
15 x11-misc/trivdm/files/trivdm-0_p20110927 | 62 +++++++++++++++++++++++++++++
16 x11-misc/trivdm/trivdm-0_p20110927.ebuild | 53 ++++++++++++++++++++++++
17 4 files changed, 127 insertions(+), 4 deletions(-)
18
19 diff --git a/x11-misc/trivdm/ChangeLog b/x11-misc/trivdm/ChangeLog
20 index 2aecf6e..3829c2f 100644
21 --- a/x11-misc/trivdm/ChangeLog
22 +++ b/x11-misc/trivdm/ChangeLog
23 @@ -2,6 +2,12 @@
24 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
25 # $Header: $
26
27 +*trivdm-0_p20110927 (27 Sep 2011)
28 +
29 + 27 Sep 2011; Michael Weber <xmw@g.o> +files/trivdm-0_p20110927,
30 + +trivdm-0_p20110927.ebuild:
31 + Version bump, added CONFIG_PROTECT
32 +
33 *trivdm-0_p20110921 (23 Sep 2011)
34
35 23 Sep 2011; Michael Weber <xmw@g.o> +files/trivdm-0_p20110921,
36
37 diff --git a/x11-misc/trivdm/Manifest b/x11-misc/trivdm/Manifest
38 index c83ee2d..73dbf38 100644
39 --- a/x11-misc/trivdm/Manifest
40 +++ b/x11-misc/trivdm/Manifest
41 @@ -2,13 +2,15 @@
42 Hash: SHA256
43
44 AUX trivdm-0_p20110921 2319 RMD160 d5ea44d05528ee0d6d3a6f27d8bb00bd513fce5d SHA1 21cb08d686d6c9c8cb157660f903e9ae2e496b01 SHA256 eae817ac58331265e5f73c7d154e14524b90417a3560c826da4b55b49fe95a42
45 +AUX trivdm-0_p20110927 2435 RMD160 7430356d28715ee4062d434da4fd18f1df9c79b1 SHA1 b8b11db1314ab9404e8bcafc9c86b3cab39cab85 SHA256 33e54114644860dc4aced2935e72d0188f016dbff5191f3fde4e70dbbb380cc6
46 EBUILD trivdm-0_p20110921.ebuild 1372 RMD160 e03319f38b7e6d5398b7d9ad70f19cecefa4bb98 SHA1 4d9946e7c0ff322e9600526be021151dc9ab8347 SHA256 28a5980ee288a5dff6ca820da6272567ff841d61bafd35f9a29b0b42c7025135
47 -MISC ChangeLog 287 RMD160 7e59711261ef173fc9fd22be4ca0bbb0d2059df5 SHA1 3cb44a28290f92c95ebcd78065ca14de52d60876 SHA256 5f3667a5fb992b6d5366ff5bd8eabf3a28f12e8b698a8d17bd183f1b2585dfe5
48 +EBUILD trivdm-0_p20110927.ebuild 1430 RMD160 25be98eeb10527e26be5126aabe585cbbed68318 SHA1 794da6899cd0b6c883141e574dee65759287dbfa SHA256 ad040c7033142c823ca27c66b392e6371f6afd8af5c45d170720001779226113
49 +MISC ChangeLog 463 RMD160 a2bf88f9761720e6d5dbc25c27b4b049bfd87abe SHA1 cf38de624c7dff5398883e5af0ee958a63f72db6 SHA256 2f05250a79307c84dbc3ae46a8eebca2415141760ebbeab9c70cd1d898478c22
50 MISC metadata.xml 245 RMD160 6b03982a4d5f32d9fa6b9259ae36f9fcb07c8404 SHA1 fb16c7b4c5ab071dd979f761b8bb075f5396b737 SHA256 375a1da02cd2c393ce2378a73c1ce08134bc030b3bb378c6a4d6ca9cd5be1f8d
51 -----BEGIN PGP SIGNATURE-----
52 Version: GnuPG v2.0.17 (GNU/Linux)
53
54 -iF4EAREIAAYFAk59AzIACgkQknrdDGLu8JAtOwD+PMfXdsC+gxXHrKIist1Py4sm
55 -nA6ftWSxCb5BNmLBV5MA/2OEDy6JDQUY7uISQf4Z5b/piVVEkZjPkox9YzUxT+W/
56 -=8FNu
57 +iF4EAREIAAYFAk6CRN0ACgkQknrdDGLu8JCVPwD/VQDOBMHu+ifAI5orQGVbxcQQ
58 +MSfhzp6j+7PYMsGf+RUA/0rC0dbMfxo4Iw5H2vM+/+bipPyvtqKqzUCizWQi74CB
59 +=aXXm
60 -----END PGP SIGNATURE-----
61
62 diff --git a/x11-misc/trivdm/files/trivdm-0_p20110927 b/x11-misc/trivdm/files/trivdm-0_p20110927
63 new file mode 100644
64 index 0000000..3bef475
65 --- /dev/null
66 +++ b/x11-misc/trivdm/files/trivdm-0_p20110927
67 @@ -0,0 +1,62 @@
68 +#!/bin/zsh
69 +# trivdm by Christian Neukirchen, Michael Weber root@××××××.de
70 +# wget http://xmw.de/tmp/trivdm -O /usr/local/bin/trivdm
71 +# c7:2345:respawn:/usr/bin/openvt -c 7 -f -w /usr/local/bin/trivdm
72 +# symlinks to /usr/local/bin/{gdmflexiserver,w} and /etc/local.d/trivdm.start
73 +# groupadd --system trivdm ; useradd --system -g trivdm -G wheel trivdm
74 +# chmod u+s /usr/bin/chvt
75 +
76 +NAME=$(basename $0) ; USER=trivdm ; LANG=C
77 +log() { echo "$@" | logger -s -t $NAME }
78 +trap 'read -s -k -t 10 "?Press any key to continue ..." ; exit -1 ' ZERR
79 +w() { ps haxo ruser,tty,comm | grep -v $USER | egrep -v "agetty|login$" | \
80 + awk '{ if ( $3 == "X" || $2 != "?" ) print $1" "$2 }' | sort -u | \
81 + awk '{ ORS="" ; if ( u != $1 ) { u=$1 ; print "\n"u"\t" } ; print $2"," }' \
82 + | sed -e '1d ; s:,$:: ; $a\' }
83 +
84 +case $NAME in
85 + gdmflexiserver)
86 + [ "$1" = "-ls" ] && exec chvt 7 || exec /usr/bin/gdmflexiserver $@ ;;
87 + trivdm.start)
88 + chvt 7 ; exec setfont sun12x22 ;;
89 + w)
90 + w ; exec /usr/bin/w $@ ;;
91 + *)
92 + [ "$1" = "update" ] && exec wget http://xmw.de/tmp/$NAME -O $0
93 + [ "$(id -un)" = "$USER" ] || exec su -c $0 $USER ;;
94 +esac
95 +
96 +clear
97 +toilet --font mono9 --gay $(hostname -f | sed 's:^[^\.]*\.::') | awk \
98 + '{a[NR%8]=a[NR%8] $0} END {for (i=1;i<=NR;i++) print a[i];print a[0]}' \
99 + | sed 's/ *$//g;/^$/d'
100 +print -n "Usage: <username>[/<session type>]
101 + <session type> in ~/.xinitrc (default), Gnome (fallback),\n\t"
102 +find /etc/X11/Sessions -type f ! -name Gnome | \
103 + awk -F / 'BEGIN { ORS=", " } { print $5 }' | sed 's:, $:\n\n:'
104 +print "connected users:\n$({ w | grep '' || print '<none>'} | sed 's:^:\t:')\n"
105 +read "login?$(hostname)/tty7 x11 login: "
106 +
107 +case $login in
108 + "")
109 + exit ;;
110 + */*)
111 + xclient=$(find /etc/X11/Sessions -iname "*${login#*/}*" -type f | \
112 + sort | head -n 1)
113 + [ -n "$xclient" ] || { log invalid session ; [ ] }
114 + login=${login%/*} ;;
115 + *) xclient="~/.xinitrc" ;;
116 +esac
117 +
118 +id "$login" 2>&1 >/dev/null | sed "s|^id:|$NAME:|"
119 +id "$login" 2>/dev/null >/dev/null
120 +
121 +tty=$(ps h -eo ruser,tty,comm | grep "^$login " | awk '$3=="X" {print $2}')
122 +[ "$tty" ] && { log switching to console $tty ; chvt "${tty#tty}" ; [ ] }
123 +
124 +dpy=0 ; while [ -e /tmp/.X11-unix/X$dpy ] ; do (( dpy += 1 )) done
125 +su -l -c "export xclient=$xclient ;
126 + [ -x \"\$xclient\" ] || xclient=/etc/X11/Sessions/Gnome ;
127 + /usr/sbin/daemonize -a -e ~/.xorg-stderr -o ~/.xorg-stdout -c ~ \
128 + /usr/bin/startx \$xclient -- :$dpy -retro" $login
129 +[ ]
130
131 diff --git a/x11-misc/trivdm/trivdm-0_p20110927.ebuild b/x11-misc/trivdm/trivdm-0_p20110927.ebuild
132 new file mode 100644
133 index 0000000..8b1edd4
134 --- /dev/null
135 +++ b/x11-misc/trivdm/trivdm-0_p20110927.ebuild
136 @@ -0,0 +1,53 @@
137 +# Copyright 1999-2011 Gentoo Foundation
138 +# Distributed under the terms of the GNU General Public License v2
139 +# $Header: $
140 +
141 +EAPI=3
142 +
143 +inherit eutils
144 +
145 +DESCRIPTION="trivial display manager"
146 +HOMEPAGE="http://xmw.de/tmp/trivdm"
147 +SRC_URI=""
148 +
149 +LICENSE="MIT"
150 +SLOT="0"
151 +KEYWORDS="~amd64 ~x86"
152 +IUSE=""
153 +
154 +RDEPEND="app-misc/toilet
155 + app-shells/zsh
156 + sys-apps/daemonize
157 + sys-apps/kbd"
158 +DEPEND=""
159 +
160 +pkg_setup() {
161 + enewgroup ${PN}
162 + enewuser ${PN} -1 /usr/bin/${PN} -1 ${PN}
163 +}
164 +
165 +src_install() {
166 + newbin "${FILESDIR}"/${P} ${PN} || die
167 + dodir /etc/env.d
168 + echo "CONFIG_PROTECT=\"/usr/bin/${PN}\"" > "${D}"/etc/env.d/90${PN}
169 +}
170 +
171 +pkg_preinst() {
172 + sed -e "/^c7:/d" /etc/inittab > "${ED}"/etc/inittab || die
173 + sed -n -e '/c7:/{s/^.*c7:/c7:/ ; s:/local/:/: ; p}' \
174 + "${ED}"/usr/bin/${PN} >> "${ED}"/etc/inittab || die
175 +
176 + elog "IMPORTANT NOTE"
177 + elog "Your system needs 5 minor adjustments that"
178 + elog "must not be made by Gentoo portage system:"
179 + elog "1) enable xscreensaver->newlogin compartibility"
180 + elog " ln -s ../../bin/${PN} /usr/local/bin/gdmflexiserver"
181 + elog "2) tune w to display remote login sessions and daemonized X11"
182 + elog " ln -s ../../bin/${PN} /usr/local/bin/w"
183 + elog "3) set a fancy font on framebuffer console on startup"
184 + elog " ln -s ../../usr/bin/${PN} /etc/local.d/${PN}.start"
185 + elog "4) grant chvt to everyone"
186 + elog " chmod u+s /usr/bin/chvt"
187 + elog "5) updated /etc/inittab (etc-update, ...) and reload"
188 + elog " kill -HUP 1"
189 +}