OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /v/openpkg/cvs                   Email:  r...@openpkg.org
  Module: openpkg-src                      Date:   02-Dec-2009 23:47:57
  Branch: HEAD                             Handle: 2009120222475501

  Added files:
    openpkg-src/screen      screen-multiuser.1 screen-multiuser.sh
  Modified files:
    openpkg-src/screen      screen.spec

  Log:
    add my little screen-multiuser(1) utility

  Summary:
    Revision    Changes     Path
    1.1         +166 -0     openpkg-src/screen/screen-multiuser.1
    1.1         +123 -0     openpkg-src/screen/screen-multiuser.sh
    1.58        +18 -3      openpkg-src/screen/screen.spec
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/screen/screen-multiuser.1
  ============================================================================
  $ cvs diff -u -r0 -r1.1 screen-multiuser.1
  --- /dev/null 2009-12-02 23:47:51 +0100
  +++ screen-multiuser.1        2009-12-02 23:47:56 +0100
  @@ -0,0 +1,166 @@
  +.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.07)
  +.\"
  +.\" Standard preamble:
  +.\" ========================================================================
  +.de Sh \" Subsection heading
  +.br
  +.if t .Sp
  +.ne 5
  +.PP
  +\fB\\$1\fR
  +.PP
  +..
  +.de Sp \" Vertical space (when we can't use .PP)
  +.if t .sp .5v
  +.if n .sp
  +..
  +.de Vb \" Begin verbatim text
  +.ft CW
  +.nf
  +.ne \\$1
  +..
  +.de Ve \" End verbatim text
  +.ft R
  +.fi
  +..
  +.\" Set up some character translations and predefined strings.  \*(-- will
  +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
  +.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
  +.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
  +.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
  +.\" nothing in troff, for use with C<>.
  +.tr \(*W-
  +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
  +.ie n \{\
  +.    ds -- \(*W-
  +.    ds PI pi
  +.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 
pitch
  +.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 
pitch
  +.    ds L" ""
  +.    ds R" ""
  +.    ds C` ""
  +.    ds C' ""
  +'br\}
  +.el\{\
  +.    ds -- \|\(em\|
  +.    ds PI \(*p
  +.    ds L" ``
  +.    ds R" ''
  +'br\}
  +.\"
  +.\" Escape single quotes in literal strings from groff's Unicode transform.
  +.ie \n(.g .ds Aq \(aq
  +.el       .ds Aq '
  +.\"
  +.\" If the F register is turned on, we'll generate index entries on stderr 
for
  +.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
  +.\" entries marked with X<> in POD.  Of course, you'll have to process the
  +.\" output yourself in some meaningful fashion.
  +.ie \nF \{\
  +.    de IX
  +.    tm Index:\\$1\t\\n%\t"\\$2"
  +..
  +.    nr % 0
  +.    rr F
  +.\}
  +.el \{\
  +.    de IX
  +..
  +.\}
  +.\"
  +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
  +.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
  +.    \" fudge factors for nroff and troff
  +.if n \{\
  +.    ds #H 0
  +.    ds #V .8m
  +.    ds #F .3m
  +.    ds #[ \f1
  +.    ds #] \fP
  +.\}
  +.if t \{\
  +.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
  +.    ds #V .6m
  +.    ds #F 0
  +.    ds #[ \&
  +.    ds #] \&
  +.\}
  +.    \" simple accents for nroff and troff
  +.if n \{\
  +.    ds ' \&
  +.    ds ` \&
  +.    ds ^ \&
  +.    ds , \&
  +.    ds ~ ~
  +.    ds /
  +.\}
  +.if t \{\
  +.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
  +.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
  +.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
  +.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
  +.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
  +.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
  +.\}
  +.    \" troff and (daisy-wheel) nroff accents
  +.ds : 
\\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
  +.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
  +.ds o 
\\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
  +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
  +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
  +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
  +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
  +.ds ae a\h'-(\w'a'u*4/10)'e
  +.ds Ae A\h'-(\w'A'u*4/10)'E
  +.    \" corrections for vroff
  +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
  +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
  +.    \" for low resolution devices (crt and lpr)
  +.if \n(.H>23 .if \n(.V>19 \
  +\{\
  +.    ds : e
  +.    ds 8 ss
  +.    ds o a
  +.    ds d- d\h'-1'\(ga
  +.    ds D- D\h'-1'\(hy
  +.    ds th \o'bp'
  +.    ds Th \o'LP'
  +.    ds ae ae
  +.    ds Ae AE
  +.\}
  +.rm #[ #] #H #V #F C
  +.\" ========================================================================
  +.\"
  +.IX Title "SCREEN-MULTIUSER.SH 1"
  +.TH SCREEN-MULTIUSER.SH 1 "2009-12-02" "perl v5.10.0" "User Contributed Perl 
Documentation"
  +.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
  +.\" way too many mistakes in technical documents.
  +.if n .ad l
  +.nh
  +.SH "NAME"
  +\&\fBscreen-multiuser\fR \*(-- easy \fIscreen\fR\|(1) multi-user session 
management
  +.SH "SYNOPSIS"
  +.IX Header "SYNOPSIS"
  +\&\fBscreen-multiuser\fR \fBmaster\fR \fIsession-name\fR 
[\fIservant-name\fR[:\fIpermission\fR] ...]
  +.PP
  +\&\fBscreen-multiuser\fR \fBservant\fR \fIsession-name\fR \fImaster-name\fR
  +.SH "DESCRIPTION"
  +.IX Header "DESCRIPTION"
  +\&\fBscreen-multiuser\fR is a tiny frontend to \fIscreen\fR\|(1) for 
controlling
  +multi-user sessions. The idea is that a session master is opening a
  +\&\fIscreen\fR\|(1) based multi-user session and one or multiple session 
servants
  +then join it afterwards.
  +.SH "EXAMPLE"
  +.IX Header "EXAMPLE"
  +.Vb 3
  +\& foo$ screen\-multiuser master  support bar:+rwx baz:+r
  +\& bar$ screen\-multiuser servant support foo
  +\& baz$ screen\-multiuser servant support foo
  +.Ve
  +.SH "AUTHOR"
  +.IX Header "AUTHOR"
  +.Vb 3
  +\& Ralf S. Engelschall
  +\& r...@engelschall.com
  +\& www.engelschall.com
  +.Ve
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/screen/screen-multiuser.sh
  ============================================================================
  $ cvs diff -u -r0 -r1.1 screen-multiuser.sh
  --- /dev/null 2009-12-02 23:47:51 +0100
  +++ screen-multiuser.sh       2009-12-02 23:47:56 +0100
  @@ -0,0 +1,123 @@
  +#!/bin/sh
  +##
  +##  screen-multiuser -- easy screen(1) multi-user session management
  +##  Copyright (c) 2004-2009 Ralf S. Engelschall <r...@engelschall.com> 
  +##
  +
  +#   usage
  +if [ $# -eq 0 ]; then
  +    echo "screen-multiuser:ERROR: invalid arguments" 1>&2
  +    echo "screen-multiuser:USAGE: screen-multiuser master <session-name> 
[<servant-name> ...]" 1>&2
  +    echo "screen-multiuser:USAGE: screen-multiuser servant <session-name> 
<master-name>" 1>&2
  +    exit 1
  +fi
  +
  +#   determine screen(1) and path to a temporary run-command script
  +screenrc="$HOME/.screenrc-multiuser"
  +screen="@l_prefix@/bin/screen"
  +
  +#   dispatch run-time mode
  +mode="$1"
  +shift
  +case "$mode" in
  +    master )
  +        #   run a new session as the session master
  +        if [ $# -lt 1 ]; then
  +            echo "screen-multiuser:ERROR: invalid arguments to mode 
\"master\"" 1>&2
  +            echo "screen-multiuser:USAGE: $0 master <session-name> 
[<servant-name>[:<permission>] ...]" 1>&2
  +            exit 1
  +        fi
  +        session="$1"; shift
  +        master="${LOGNAME-${USERNAME-"unknown"}}"
  +        title="screen-multiuser:"
  +        title="${title} ${master}%?/%t%?"
  +        title="${title}%? %{= rW} %n %{-}%?"
  +        title="${title}%? [%u]%?"
  +        title="${title} %=%-w%{= rW}%50>%n %t%{-}%+w"
  +        (   if [ -f $HOME/.screenrc ]; then
  +                echo "source \"$HOME/.screenrc\""
  +            fi
  +            echo "escape          ^Aa"
  +            echo "startup_message off"
  +            echo "vbell           off"
  +            echo "defscrollback   10000"
  +            echo "defmonitor      off"
  +            echo "msgminwait      1"
  +            echo "msgwait         1"
  +            echo "hardstatus      alwayslastline \" $title \""
  +            echo "multiuser       on"
  +            echo "acladd          $master"
  +            echo "aclchg          $master +rwx \"#?\""
  +            echo "aclumask        ?+rwx"
  +            echo "aclumask        ??+rwx"
  +            if [ $# -gt 0 ]; then
  +                for servant in "$@"; do
  +                    permission="+rwx"
  +                    if expr "$servant" : '.*:.*' >/dev/null; then
  +                        permission=`expr "$servant" : '.*:\(.*\)'`
  +                        servant=`expr "$servant" : '\(.*\):.*'`
  +                    fi
  +                    echo "acladd $servant"
  +                    echo "aclchg $servant $permission \"#?\""
  +                done
  +            else
  +                echo "password"
  +            fi
  +        ) >$screenrc
  +        $screen -t "$session" -c $screenrc -S "$session" -d -R
  +        rm -f $screenrc >/dev/null 2>&1 || true
  +        ;;
  +    servant )
  +        #   attach to an existing session as one session servant
  +        if [ $# -ne 2 ]; then
  +            echo "screen-multiuser:ERROR: invalid arguments to mode 
\"servant\"" 1>&2
  +            echo "screen-multiuser:USAGE: $0 servant <session-name> 
<master-name>" 1>&2
  +            exit 1
  +        fi
  +        session="$1"; shift
  +        master="$1"; shift
  +        $screen -c $screenrc -r "$master/$session" -x
  +        ;;
  +    * )
  +        echo "screen-multiuser:ERROR: invalid mode \"$mode\"" 1>&2
  +        echo "screen-multiuser:USAGE: $0 master <session-name> 
[<servant-name>[:<permission>] ...]" 1>&2
  +        echo "screen-multiuser:USAGE: $0 servant <session-name> 
<master-name>" 1>&2
  +        exit 1
  +        ;;
  +esac
  +
  +exit 0
  +
  +=pod
  +
  +=head1 NAME
  +
  +B<screen-multiuser> -- easy screen(1) multi-user session management
  +
  +=head1 SYNOPSIS
  +
  +B<screen-multiuser> B<master> I<session-name> 
[I<servant-name>[:I<permission>] ...]
  +
  +B<screen-multiuser> B<servant> I<session-name> I<master-name>
  +
  +=head1 DESCRIPTION
  +
  +B<screen-multiuser> is a tiny frontend to screen(1) for controlling
  +multi-user sessions. The idea is that a session master is opening a
  +screen(1) based multi-user session and one or multiple session servants
  +then join it afterwards.
  +
  +=head1 EXAMPLE
  +
  + foo$ screen-multiuser master  support bar:+rwx baz:+r
  + bar$ screen-multiuser servant support foo
  + baz$ screen-multiuser servant support foo
  +
  +=head1 AUTHOR
  +
  + Ralf S. Engelschall
  + r...@engelschall.com
  + www.engelschall.com
  +
  +=cut
  +
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/screen/screen.spec
  ============================================================================
  $ cvs diff -u -r1.57 -r1.58 screen.spec
  --- openpkg-src/screen/screen.spec    14 Aug 2009 11:54:16 -0000      1.57
  +++ openpkg-src/screen/screen.spec    2 Dec 2009 22:47:56 -0000       1.58
  @@ -32,17 +32,21 @@
   Group:        Terminal
   License:      GPL
   Version:      4.0.3
  -Release:      20090814
  +Release:      20091202
   
   #   list of sources
   Source0:      
ftp://ftp.uni-erlangen.de/pub/utilities/screen/screen-%{version}.tar.gz
  +Source1:      screen-multiuser.sh
  +Source2:      screen-multiuser.1
   Patch0:       screen.patch
   
   #   build information
   Prefix:       %{l_prefix}
   BuildRoot:    %{l_buildroot}
  -BuildPreReq:  OpenPKG, openpkg >= 20040130, ncurses, make
  -PreReq:       OpenPKG, openpkg >= 20040130, ncurses
  +BuildPreReq:  OpenPKG, openpkg >= 20040130, make
  +PreReq:       OpenPKG, openpkg >= 20040130
  +BuildPreReq:  ncurses
  +PreReq:       ncurses
   AutoReq:      no
   AutoReqProv:  no
   
  @@ -115,6 +119,17 @@
           etc/etcscreenrc \
           $RPM_BUILD_ROOT%{l_prefix}/etc/screen/screenrc
   
  +    #   install screen-multiuser(1) utility
  +    %{l_shtool} mkdir -f -p -m 755 \
  +        $RPM_BUILD_ROOT%{l_prefix}/bin \
  +        $RPM_BUILD_ROOT%{l_prefix}/man/man1
  +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
  +        %{SOURCE screen-multiuser.sh} \
  +        $RPM_BUILD_ROOT%{l_prefix}/bin/screen-multiuser
  +    %{l_shtool} install -c -m 644 \
  +        %{SOURCE screen-multiuser.1} \
  +        $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  +
       #   determine installation files
       %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
           %{l_files_std} \
  @@ .
______________________________________________________________________
OpenPKG                                             http://openpkg.org
CVS Repository Commit List                     openpkg-cvs@openpkg.org

Reply via email to