summaryrefslogtreecommitdiff
path: root/sysutils/screen
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/screen')
-rw-r--r--sysutils/screen/Makefile102
-rw-r--r--sysutils/screen/distinfo3
-rw-r--r--sysutils/screen/files/patch-doc__Makefile.in34
-rw-r--r--sysutils/screen/files/patch-doc_screen.111
-rw-r--r--sysutils/screen/files/patch-misc.c39
-rw-r--r--sysutils/screen/files/patch-os.h19
-rw-r--r--sysutils/screen/files/patch-socket.c76
-rw-r--r--sysutils/screen/files/patch-terminfo__checktc.c18
-rw-r--r--sysutils/screen/files/patch-utmp.c20
-rw-r--r--sysutils/screen/files/screenrc.sample10
-rw-r--r--sysutils/screen/pkg-descr7
-rw-r--r--sysutils/screen/pkg-message11
-rw-r--r--sysutils/screen/pkg-plist27
13 files changed, 373 insertions, 4 deletions
diff --git a/sysutils/screen/Makefile b/sysutils/screen/Makefile
index 6f21f4002217..f2c30dfefb7a 100644
--- a/sysutils/screen/Makefile
+++ b/sysutils/screen/Makefile
@@ -1,6 +1,100 @@
-VERSIONS= 50
-SCREEN_VERSION?= 50
+PORTNAME= screen
+DISTVERSION= 5.0.1
+PORTREVISION= 4
+CATEGORIES= sysutils
+MASTER_SITES= GNU \
+ ftp://ftp.gnu.org/gnu/screen/ \
+ ftp://gnu.mirror.iweb.com/screen/ \
+ http://gnu.mirror.iweb.com/screen/ \
+ http://mirror.sdunix.com/gnu/ \
+ ftp://mirrors.kernel.org/gnu/screen/ \
+ http://cschubert.com/distfiles/ \
+ LOCAL/cy
-MASTERDIR= ${.CURDIR}/../screen${SCREEN_VERSION}
+MAINTAINER= cy@FreeBSD.org
+COMMENT= Multi-screen window manager
+WWW= https://www.gnu.org/software/screen/
-.include "${MASTERDIR}/Makefile"
+CONFLICTS+= screen-devel
+
+LICENSE= GPLv3
+
+OPTIONS_DEFINE= INFO SYSTEM_SCREENRC MULTIUSER \
+ NOSOCKETDIR
+OPTIONS_DEFAULT= INFO SYSTEM_SCREENRC \
+ NCURSES_DEFAULT MULTIUSER
+OPTIONS_SINGLE= NCURSES
+OPTIONS_SINGLE_NCURSES= NCURSES_DEFAULT NCURSES_BASE NCURSES_PORT
+SYSTEM_SCREENRC_DESC= Install system screenrc with helpful status line
+MULTIUSER_DESC= Install setuid-root screen to support multiuser
+MULTIUSER_PLIST_SUB= MULTISUID="@(,,4555) "
+MULTIUSER_PLIST_SUB_OFF=MULTISUID="@(,,0555) "
+NCURSES_DEFAULT_DESC= Depend on ncurses (ports if installed, otherwise base)
+NCURSES_BASE_DESC= Depend on ncurses in base
+NCURSES_PORT_DESC= Depend on devel/ncurses in ports
+NOSOCKETDIR_DESC= Use ~/.screen instead of socketdir
+
+NCURSES_DEFAULT_USES= ncurses
+NCURSES_BASE_USES= ncurses:base
+NCURSES_PORT_USES= ncurses:port
+
+OPTIONS_SUB=
+
+USES= autoreconf:build gmake cpe
+CONFIGURE_ARGS= --with-system_screenrc=${ETCDIR}/screenrc
+MAKE_ARGS+= WITH_MAN=1
+
+CPE_VENDOR= gnu
+
+.include <bsd.port.options.mk>
+
+GNU_CONFIGURE= yes
+GNU_CONFIGURE_MANPREFIX= ${PREFIX}/share
+CFLAGS+= -I${NCURSESINC} -DSVR4 -DGETUTENT
+LDFLAGS+= -L${NCURSESLIB}
+
+.if ${PORT_OPTIONS:MINFO}
+INFO= screen
+MAKE_ARGS+= WITH_INFO=1
+USES+= makeinfo
+.endif
+
+# Enables support for 256 colour xterm. Note that you may need to
+# set up a custom termcap entry or .screenrc which modifies termcap
+# to contain the following: Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm
+#
+.if ${PORT_OPTIONS:MNOSOCKETDIR}
+CONFIGURE_ARGS+= --disable-socket-dir
+.endif
+
+.if defined(SCREEN_SOCKET_DIR)
+CONFIGURE_ARGS+= --enable-socket-dir=${SCREEN_SOCKET_DIR}
+.endif
+
+# Bug 191029: Users can choose whether to use sockets or named pipes.
+# Choose sockets if you don't know what the difference is.
+# Choose named pipes if your environment is heterogeneous,
+# using both screen 4.0.3 and 4.2.1.
+# Bug 191017
+
+pre-configure:
+ cd ${WRKSRC} && ./autogen.sh
+
+ETCDIR?= ${PREFIX}/etc
+
+post-install:
+ @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKSRC}/etc/etcscreenrc \
+ ${STAGEDIR}${EXAMPLESDIR}/screenrc.sample-1
+ ${INSTALL_DATA} ${FILESDIR}/screenrc.sample \
+ ${STAGEDIR}${EXAMPLESDIR}/screenrc.sample-2
+ @${MKDIR} ${STAGEDIR}${ETCDIR}
+.if ${PORT_OPTIONS:MSYSTEM_SCREENRC}
+ ${INSTALL_DATA} ${FILESDIR}/screenrc.sample \
+ ${STAGEDIR}${ETCDIR}/screenrc.sample
+.else
+ ${INSTALL_DATA} ${WRKSRC}/etc/etcscreenrc \
+ ${STAGEDIR}${ETCDIR}/screenrc.sample
+.endif
+
+.include <bsd.port.mk>
diff --git a/sysutils/screen/distinfo b/sysutils/screen/distinfo
new file mode 100644
index 000000000000..ab41c246dddf
--- /dev/null
+++ b/sysutils/screen/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1747935093
+SHA256 (screen-5.0.1.tar.gz) = 2dae36f4db379ffcd14b691596ba6ec18ac3a9e22bc47ac239789ab58409869d
+SIZE (screen-5.0.1.tar.gz) = 897507
diff --git a/sysutils/screen/files/patch-doc__Makefile.in b/sysutils/screen/files/patch-doc__Makefile.in
new file mode 100644
index 000000000000..8666be063fe5
--- /dev/null
+++ b/sysutils/screen/files/patch-doc__Makefile.in
@@ -0,0 +1,34 @@
+--- doc/Makefile.in.orig 2014-04-29 20:26:42.618832001 -0700
++++ doc/Makefile.in 2014-04-29 20:29:26.379384101 -0700
+@@ -31,7 +31,10 @@
+ $(MAKEINFO) --no-split $(srcdir)/screen.texinfo -o screen.info
+
+ install: installdirs
++ifeq (${WITH_MAN},1)
+ $(INSTALL_DATA) $(srcdir)/screen.1 $(DESTDIR)$(mandir)/man1/screen.1
++endif
++ifeq (${WITH_INFO},1)
+ -$(MAKE) screen.info
+ -if test -f screen.info; then d=.; else d=$(srcdir); fi; \
+ if test -f $$d/screen.info; then \
+@@ -40,13 +43,19 @@
+ install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/screen.info; \
+ else true; fi; \
+ fi
++endif
+
+ uninstall:
+ rm -f $(DESTDIR)$(mandir)/man1/screen.1
+ rm -f $(DESTDIR)$(infodir)/screen.info*
+
+ installdirs:
+- $(srcdir)/../etc/mkinstalldirs $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(infodir)
++ifeq (${WITH_MAN},1)
++ $(srcdir)/../etc/mkinstalldirs $(DESTDIR)$(mandir)/man1
++endif
++ifeq (${WITH_INFO},1)
++ $(srcdir)/../etc/mkinstalldirs $(DESTDIR)$(infodir)
++endif
+
+ mostlyclean:
+ -rm -f *.cp *.cps *.fn *.fns *.ky *.kys *.pg *.tp *.vr
diff --git a/sysutils/screen/files/patch-doc_screen.1 b/sysutils/screen/files/patch-doc_screen.1
new file mode 100644
index 000000000000..59077d7be443
--- /dev/null
+++ b/sysutils/screen/files/patch-doc_screen.1
@@ -0,0 +1,11 @@
+--- doc/screen.1.orig 2023-08-15 11:01:59 UTC
++++ doc/screen.1
+@@ -241,7 +241,7 @@
+ .IR screen ,
+ but prints a list of
+ .I pid.tty.host
+-strings identifying your
++strings and creation timestamps identifying your
+ .I screen
+ sessions.
+ Sessions marked `detached' can be resumed with \*Qscreen \-r\*U. Those marked
diff --git a/sysutils/screen/files/patch-misc.c b/sysutils/screen/files/patch-misc.c
new file mode 100644
index 000000000000..238359b03671
--- /dev/null
+++ b/sysutils/screen/files/patch-misc.c
@@ -0,0 +1,39 @@
+--- misc.c.orig 2024-03-26 16:41:57.000000000 -0700
++++ misc.c 2024-04-03 11:32:35.844473000 -0700
+@@ -32,8 +32,10 @@
+
+ #include <poll.h>
+ #include <sys/types.h>
++#include <sys/user.h>
+ #include <sys/stat.h> /* mkdir() declaration */
+ #include <signal.h>
++#include <libutil.h>
+ #include <stdint.h>
+ #include <string.h>
+ #include <stdbool.h>
+@@ -225,6 +227,7 @@
+ char *p;
+
+ if (str == NULL) {
++
+ *buf = 0;
+ return 0;
+ }
+@@ -238,3 +241,17 @@
+ *p = 0;
+ return p - buf;
+ }
++
++time_t
++SessionCreationTime(fifo)
++const char *fifo;
++{
++ int pid = atoi(fifo);
++ if (pid <= 0) return 0;
++
++ struct kinfo_proc * kip = kinfo_getproc(pid);
++ if (kip == 0) return 0;
++ time_t start = kip->ki_start.tv_sec;
++ free (kip);
++ return start;
++}
diff --git a/sysutils/screen/files/patch-os.h b/sysutils/screen/files/patch-os.h
new file mode 100644
index 000000000000..a03d22029f93
--- /dev/null
+++ b/sysutils/screen/files/patch-os.h
@@ -0,0 +1,19 @@
+--- os.h.orig 2024-07-27 07:09:11.000000000 -0700
++++ os.h 2024-08-19 08:47:21.152670000 -0700
+@@ -148,7 +148,7 @@
+ */
+
+ #ifndef TERMCAP_BUFSIZE
+-# define TERMCAP_BUFSIZE 1023
++# define TERMCAP_BUFSIZE 1024
+ #endif
+
+ /*
+@@ -161,6 +161,6 @@
+ /* Changing those you won't be able to attach to your old sessions
+ * when changing those values in official tree don't forget to bump
+ * MSG_VERSION */
+-#define MAXTERMLEN 32
++#define MAXTERMLEN 63
+ #define MAXLOGINLEN 256
+
diff --git a/sysutils/screen/files/patch-socket.c b/sysutils/screen/files/patch-socket.c
new file mode 100644
index 000000000000..abd96ac9cb49
--- /dev/null
+++ b/sysutils/screen/files/patch-socket.c
@@ -0,0 +1,76 @@
+--- socket.c.orig 2024-03-26 16:41:57.000000000 -0700
++++ socket.c 2024-04-03 07:52:07.474617000 -0700
+@@ -122,11 +122,13 @@
+ char *firstn = NULL;
+ int nfound = 0, ngood = 0, ndead = 0, nwipe = 0, npriv = 0;
+ int nperfect = 0;
++ char timestr[64];
+ struct sent {
+ struct sent *next;
+ int mode;
+ char *name;
+- } *slist, **slisttail, *sent, *nsent;
++ time_t time_created;
++ } *slist, **slisttail, *sent, *nsent, *schosen;
+
+ if (match) {
+ matchlen = strlen(match);
+@@ -203,8 +205,12 @@
+ sent->next = NULL;
+ sent->name = SaveStr(name);
+ sent->mode = mode;
++ sent->time_created = SessionCreationTime(name);
++ for (slisttail = &slist; *slisttail; slisttail = &((*slisttail)->next)) {
++ if ((*slisttail)->time_created < sent->time_created) break;
++ }
++ sent->next = *slisttail;
+ *slisttail = sent;
+- slisttail = &sent->next;
+ nfound++;
+ sockfd = MakeClientSocket(0);
+ /* MakeClientSocket sets ids back to eff */
+@@ -283,31 +289,36 @@
+ break;
+ }
+ for (sent = slist; sent; sent = sent->next) {
++ if (sent->time_created == 0) {
++ sprintf(timestr, "??" "?");
++ } else {
++ strftime(timestr, 64, "%x %X", localtime(&sent->time_created));
++ }
+ switch (sent->mode) {
+ case 0700:
+- printf("\t%s\t(Attached)\n", sent->name);
++ printf("\t%s\t(%s)\t(Attached)\n", sent->name, timestr);
+ break;
+ case 0600:
+- printf("\t%s\t(Detached)\n", sent->name);
++ printf("\t%s\t(%s)\t(Detached)\n", sent->name, timestr);
+ break;
+ case 0701:
+- printf("\t%s\t(Multi, attached)\n", sent->name);
++ printf("\t%s\t(%s)\t(Multi, attached)\n", sent->name, timestr);
+ break;
+ case 0601:
+- printf("\t%s\t(Multi, detached)\n", sent->name);
++ printf("\t%s\t(%s)\t(Multi, detached)\n", sent->name, timestr);
+ break;
+ case -1:
+ /* No trigraphs here! */
+- printf("\t%s\t(Dead ?%c?)\n", sent->name, '?');
++ printf("\t%s\t(%s)\t(Dead ?%c?)\n", sent->name, timestr, '?');
+ break;
+ case -2:
+- printf("\t%s\t(Removed)\n", sent->name);
++ printf("\t%s\t(%s)\t(Removed)\n", sent->name, timestr);
+ break;
+ case -3:
+- printf("\t%s\t(Remote or dead)\n", sent->name);
++ printf("\t%s\t(%s)\t(Remote or dead)\n", sent->name, timestr);
+ break;
+ case -4:
+- printf("\t%s\t(Private)\n", sent->name);
++ printf("\t%s\t(%s)\t(Private)\n", sent->name, timestr);
+ break;
+ }
+ }
diff --git a/sysutils/screen/files/patch-terminfo__checktc.c b/sysutils/screen/files/patch-terminfo__checktc.c
new file mode 100644
index 000000000000..d4ffb75cc0c1
--- /dev/null
+++ b/sysutils/screen/files/patch-terminfo__checktc.c
@@ -0,0 +1,18 @@
+--- terminfo/checktc.c.orig Fri Sep 29 09:13:22 1995
++++ terminfo/checktc.c Tue Apr 22 20:37:18 2003
+@@ -171,6 +171,7 @@
+ fflush(stdout);
+ }
+
++#ifndef __FreeBSD__
+ void CPutStr(s, c)
+ char *s;
+ int c;
+@@ -178,6 +179,7 @@
+ tputs(tgoto(s, 0, c), 1, putcha);
+ fflush(stdout);
+ }
++#endif /* __FreeBSD__ */
+
+ void CCPutStr(s, x, y)
+ char *s;
diff --git a/sysutils/screen/files/patch-utmp.c b/sysutils/screen/files/patch-utmp.c
new file mode 100644
index 000000000000..3157dffa0a90
--- /dev/null
+++ b/sysutils/screen/files/patch-utmp.c
@@ -0,0 +1,20 @@
+--- utmp.c.orig 2024-03-26 16:41:57.000000000 -0700
++++ utmp.c 2024-04-03 11:21:49.696125000 -0700
+@@ -30,6 +30,7 @@
+
+ #include "utmp.h"
+
++#include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+@@ -64,9 +65,7 @@
+
+ static int utmpok;
+ static char UtmpName[] = UTMPXFILE;
+-#ifndef UTMP_HELPER
+ static int utmpfd = -1;
+-#endif
+
+ #undef D_loginhost
+ #define D_loginhost D_utmp_logintty.ut_host
diff --git a/sysutils/screen/files/screenrc.sample b/sysutils/screen/files/screenrc.sample
new file mode 100644
index 000000000000..8bfb5906d20c
--- /dev/null
+++ b/sysutils/screen/files/screenrc.sample
@@ -0,0 +1,10 @@
+startup_message off
+defscrollback 5000
+termcapinfo xterm ti@:te@
+termcapinfo xterm-color ti@:te@
+hardstatus alwayslastline
+hardstatus string '%{2;0}[%{+b10;0}%H%{-}][%= %{7;0}%?%-Lw%?%{+9;0}(%{+15;0}%n%f %t%?(%u)%?%{-})%{-} ^H%?%+Lw%?%= %{-}]%{+b14;0}[%m/%d/%y %c]%{-}%{-}'
+vbell off
+shell -$SHELL
+logtstamp on
+logtstamp after 1
diff --git a/sysutils/screen/pkg-descr b/sysutils/screen/pkg-descr
new file mode 100644
index 000000000000..7b753f95511d
--- /dev/null
+++ b/sysutils/screen/pkg-descr
@@ -0,0 +1,7 @@
+Screen is a full-screen window manager that multiplexes a physical terminal
+between several processes (typically interactive shells).
+Each virtual terminal provides the functions of a DEC VT100 terminal and, in
+addition, several control functions from the ANSI X3.64 (ISO 6429) and ISO
+2022 standards (e.g. insert/delete line and support for multiple character
+sets). There is a scrollback history buffer for each virtual terminal and a
+copy-and-paste mechanism that allows moving text regions between windows.
diff --git a/sysutils/screen/pkg-message b/sysutils/screen/pkg-message
new file mode 100644
index 000000000000..899fc017b061
--- /dev/null
+++ b/sysutils/screen/pkg-message
@@ -0,0 +1,11 @@
+[
+{ type: install
+ message: <<EOM
+As of GNU Screen 4.4.0:
+
+Note that there was fix to screen message structure field
+responsible for $TERM handling, making it impossible
+to attach to older versions.
+EOM
+}
+]
diff --git a/sysutils/screen/pkg-plist b/sysutils/screen/pkg-plist
new file mode 100644
index 000000000000..aabb61708efd
--- /dev/null
+++ b/sysutils/screen/pkg-plist
@@ -0,0 +1,27 @@
+bin/screen
+%%MULTISUID%%bin/screen-5.0.1
+share/man/man1/screen.1.gz
+%%DATADIR%%/utf8encodings/01
+%%DATADIR%%/utf8encodings/02
+%%DATADIR%%/utf8encodings/03
+%%DATADIR%%/utf8encodings/04
+%%DATADIR%%/utf8encodings/18
+%%DATADIR%%/utf8encodings/19
+%%DATADIR%%/utf8encodings/a1
+%%DATADIR%%/utf8encodings/a3
+%%DATADIR%%/utf8encodings/bf
+%%DATADIR%%/utf8encodings/c2
+%%DATADIR%%/utf8encodings/c3
+%%DATADIR%%/utf8encodings/c4
+%%DATADIR%%/utf8encodings/c6
+%%DATADIR%%/utf8encodings/c7
+%%DATADIR%%/utf8encodings/c8
+%%DATADIR%%/utf8encodings/cc
+%%DATADIR%%/utf8encodings/cd
+%%DATADIR%%/utf8encodings/d6
+@comment We always install the same screenrc it just depends on if we
+@comment are installing the the one bundled with source, or the one from
+@comment FILESDIR/screenrc.sample
+@sample %%ETCDIR%%/screenrc.sample
+%%EXAMPLESDIR%%/screenrc.sample-1
+%%EXAMPLESDIR%%/screenrc.sample-2