aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authorcy <cy@FreeBSD.org>2014-04-30 12:16:24 +0800
committercy <cy@FreeBSD.org>2014-04-30 12:16:24 +0800
commit51547cf4cc183c095434d16ee7bb5b1f86e16fd3 (patch)
tree6c79c46b3e2f9e9866097c7e2c427f219e890c68 /sysutils
parent87a8eb8af03e8417db53493960e8a71dedf2ad86 (diff)
downloadfreebsd-ports-gnome-51547cf4cc183c095434d16ee7bb5b1f86e16fd3.tar.gz
freebsd-ports-gnome-51547cf4cc183c095434d16ee7bb5b1f86e16fd3.tar.zst
freebsd-ports-gnome-51547cf4cc183c095434d16ee7bb5b1f86e16fd3.zip
Prepare for screen 4.2.1. Screen 4.0.3 becomes screen-legacy.
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/screen-legacy/Makefile82
-rw-r--r--sysutils/screen-legacy/distinfo2
-rw-r--r--sysutils/screen-legacy/files/opt-cjkwidth227
-rw-r--r--sysutils/screen-legacy/files/opt-hostinlocked21
-rw-r--r--sysutils/screen-legacy/files/opt-showencoding31
-rw-r--r--sysutils/screen-legacy/files/patch-Makefile.in20
-rw-r--r--sysutils/screen-legacy/files/patch-aa19
-rw-r--r--sysutils/screen-legacy/files/patch-ab20
-rw-r--r--sysutils/screen-legacy/files/patch-ad121
-rw-r--r--sysutils/screen-legacy/files/patch-af15
-rw-r--r--sysutils/screen-legacy/files/patch-ansi.c11
-rw-r--r--sysutils/screen-legacy/files/patch-attacher.c24
-rw-r--r--sysutils/screen-legacy/files/patch-display.h11
-rw-r--r--sysutils/screen-legacy/files/patch-doc_Makefile.in34
-rw-r--r--sysutils/screen-legacy/files/patch-os.h33
-rw-r--r--sysutils/screen-legacy/files/patch-osdef.h.in11
-rw-r--r--sysutils/screen-legacy/files/patch-process.c11
-rw-r--r--sysutils/screen-legacy/files/patch-pty.c15
-rw-r--r--sysutils/screen-legacy/files/patch-resize.c20
-rw-r--r--sysutils/screen-legacy/files/patch-screen.c11
-rw-r--r--sysutils/screen-legacy/files/patch-screen.h20
-rw-r--r--sysutils/screen-legacy/files/patch-terminfo::checktc.c18
-rw-r--r--sysutils/screen-legacy/files/patch-tty.sh22
-rw-r--r--sysutils/screen-legacy/files/patch-utmp.c87
-rw-r--r--sysutils/screen-legacy/pkg-descr9
-rw-r--r--sysutils/screen-legacy/pkg-plist25
26 files changed, 920 insertions, 0 deletions
diff --git a/sysutils/screen-legacy/Makefile b/sysutils/screen-legacy/Makefile
new file mode 100644
index 000000000000..f5e6c1764687
--- /dev/null
+++ b/sysutils/screen-legacy/Makefile
@@ -0,0 +1,82 @@
+# Created by: Andrey Chernov <ache@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME= screen
+PORTVERSION= 4.0.3
+PORTREVISION= 14
+CATEGORIES= sysutils
+MASTER_SITES= http://ftp.gnu.org/gnu/screen/ \
+ 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://komquats.com/distfiles/ \
+ http://people.freebsd.org/~cy/distfiles/ \
+ GNU
+
+MAINTAINER= cy@FreeBSD.org
+COMMENT= Multi-screen window manager
+
+OPTIONS_DEFINE= CJK INFO MAN NETHACK XTERM_256 HOSTINLOCKED SHOWENC
+OPTIONS_DEFAULT= INFO MAN NETHACK XTERM_256
+CJK_DESC= Treat CJK ambiguous characters as full width
+INFO_DESC= Build and install info documentation
+MAN_DESC= Build and install man pages
+NETHACK_DESC= Enable nethack-style messages
+XTERM_256_DESC= Enable support for 256 colour xterm
+HOSTINLOCKED_DESC= Print user@host in locked message
+SHOWENC_DESC= Show encoding on the status line
+
+OPTIONS_SUB=
+
+.include <bsd.port.options.mk>
+
+GNU_CONFIGURE= yes
+.if ${PORT_OPTIONS:MMAN}
+MAKE_ARGS+= -DWITH_MAN
+.endif
+.if ${PORT_OPTIONS:MINFO}
+.if !exists(/usr/bin/install-info)
+RUN_DEPENDS+= install-info:${PORTSDIR}/print/texinfo
+.endif
+INFO= screen
+MAKE_ARGS+= -DWITH_INFO
+.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:MXTERM_256}
+CFLAGS+= -DCOLORS256
+.endif
+
+.if ! ${PORT_OPTIONS:MNETHACK}
+CFLAGS+= -DNONETHACK
+.endif
+
+# treat CJK ambiguous characters as full width via option "cjkwidth"
+.if ${PORT_OPTIONS:MCJK}
+EXTRA_PATCHES+= ${FILESDIR}/opt-cjkwidth
+.endif
+
+.if ${PORT_OPTIONS:MHOSTINLOCKED}
+EXTRA_PATCHES+= ${FILESDIR}/opt-hostinlocked
+.endif
+
+# show encoding on the status line via option "showenc"
+.if ${PORT_OPTIONS:MSHOWENC}
+EXTRA_PATCHES+= ${FILESDIR}/opt-showencoding
+.endif
+
+post-patch:
+ @${RM} ${WRKSRC}/doc/screen.info*
+ @${REINPLACE_CMD} -e 's|/dev/ptmx|/nonexistent|' ${WRKSRC}/configure
+
+post-install:
+ @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKSRC}/etc/etcscreenrc \
+ ${STAGEDIR}${EXAMPLESDIR}/screenrc
+
+.include <bsd.port.mk>
diff --git a/sysutils/screen-legacy/distinfo b/sysutils/screen-legacy/distinfo
new file mode 100644
index 000000000000..1b0aa35f34a8
--- /dev/null
+++ b/sysutils/screen-legacy/distinfo
@@ -0,0 +1,2 @@
+SHA256 (screen-4.0.3.tar.gz) = 78f0d5b1496084a5902586304d4a73954b2bfe33ea13edceecf21615c39e6c77
+SIZE (screen-4.0.3.tar.gz) = 840602
diff --git a/sysutils/screen-legacy/files/opt-cjkwidth b/sysutils/screen-legacy/files/opt-cjkwidth
new file mode 100644
index 000000000000..69a6deef495c
--- /dev/null
+++ b/sysutils/screen-legacy/files/opt-cjkwidth
@@ -0,0 +1,227 @@
+--- ansi.c.orig Tue Jun 17 08:00:47 2003
++++ ansi.c Wed Jun 18 00:55:21 2003
+@@ -701,7 +701,7 @@
+ curr->w_rend.font = 0;
+ }
+ # ifdef DW_CHARS
+- if (curr->w_encoding == UTF8 && c >= 0x1100 && utf8_isdouble(c))
++ if (curr->w_encoding == UTF8 && utf8_isdouble(c))
+ curr->w_mbcs = 0xff;
+ # endif
+ if (curr->w_encoding == UTF8 && c >= 0x0300 && utf8_iscomb(c))
+--- comm.c.orig Mon Sep 8 22:25:08 2003
++++ comm.c Fri May 6 19:06:12 2005
+@@ -112,6 +112,9 @@
+ #endif
+ { "charset", NEED_FORE|ARGS_1 },
+ { "chdir", ARGS_01 },
++#ifdef DW_CHARS
++ { "cjkwidth", ARGS_01 },
++#endif
+ { "clear", NEED_FORE|ARGS_0 },
+ { "colon", NEED_LAYER|ARGS_01 },
+ { "command", NEED_DISPLAY|ARGS_02 },
+--- encoding.c.orig Mon Sep 8 22:25:23 2003
++++ encoding.c Fri May 6 20:05:24 2005
+@@ -35,6 +35,10 @@
+
+ extern char *screenencodings;
+
++#ifdef DW_CHARS
++extern int cjkwidth;
++#endif
++
+ static int encmatch __P((char *, char *));
+ # ifdef UTF8
+ static int recode_char __P((int, int, int));
+@@ -845,22 +849,107 @@
+ }
+
+ #ifdef DW_CHARS
++struct interval {
++ int first;
++ int last;
++};
++
++/* auxiliary function for binary search in interval table */
++static int bisearch(int ucs, const struct interval *table, int max) {
++ int min = 0;
++ int mid;
++
++ if (ucs < table[0].first || ucs > table[max].last)
++ return 0;
++ while (max >= min) {
++ mid = (min + max) / 2;
++ if (ucs > table[mid].last)
++ min = mid + 1;
++ else if (ucs < table[mid].first)
++ max = mid - 1;
++ else
++ return 1;
++ }
++
++ return 0;
++}
++
+ int
+ utf8_isdouble(c)
+ int c;
+ {
+- return
+- (c >= 0x1100 &&
+- (c <= 0x115f || /* Hangul Jamo init. consonants */
+- (c >= 0x2e80 && c <= 0xa4cf && (c & ~0x0011) != 0x300a &&
+- c != 0x303f) || /* CJK ... Yi */
+- (c >= 0xac00 && c <= 0xd7a3) || /* Hangul Syllables */
+- (c >= 0xdf00 && c <= 0xdfff) || /* dw combining sequence */
+- (c >= 0xf900 && c <= 0xfaff) || /* CJK Compatibility Ideographs */
+- (c >= 0xfe30 && c <= 0xfe6f) || /* CJK Compatibility Forms */
+- (c >= 0xff00 && c <= 0xff5f) || /* Fullwidth Forms */
+- (c >= 0xffe0 && c <= 0xffe6) ||
+- (c >= 0x20000 && c <= 0x2ffff)));
++ /* sorted list of non-overlapping intervals of East Asian Ambiguous
++ * characters, generated by "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c" */
++ static const struct interval ambiguous[] = {
++ { 0x00A1, 0x00A1 }, { 0x00A4, 0x00A4 }, { 0x00A7, 0x00A8 },
++ { 0x00AA, 0x00AA }, { 0x00AE, 0x00AE }, { 0x00B0, 0x00B4 },
++ { 0x00B6, 0x00BA }, { 0x00BC, 0x00BF }, { 0x00C6, 0x00C6 },
++ { 0x00D0, 0x00D0 }, { 0x00D7, 0x00D8 }, { 0x00DE, 0x00E1 },
++ { 0x00E6, 0x00E6 }, { 0x00E8, 0x00EA }, { 0x00EC, 0x00ED },
++ { 0x00F0, 0x00F0 }, { 0x00F2, 0x00F3 }, { 0x00F7, 0x00FA },
++ { 0x00FC, 0x00FC }, { 0x00FE, 0x00FE }, { 0x0101, 0x0101 },
++ { 0x0111, 0x0111 }, { 0x0113, 0x0113 }, { 0x011B, 0x011B },
++ { 0x0126, 0x0127 }, { 0x012B, 0x012B }, { 0x0131, 0x0133 },
++ { 0x0138, 0x0138 }, { 0x013F, 0x0142 }, { 0x0144, 0x0144 },
++ { 0x0148, 0x014B }, { 0x014D, 0x014D }, { 0x0152, 0x0153 },
++ { 0x0166, 0x0167 }, { 0x016B, 0x016B }, { 0x01CE, 0x01CE },
++ { 0x01D0, 0x01D0 }, { 0x01D2, 0x01D2 }, { 0x01D4, 0x01D4 },
++ { 0x01D6, 0x01D6 }, { 0x01D8, 0x01D8 }, { 0x01DA, 0x01DA },
++ { 0x01DC, 0x01DC }, { 0x0251, 0x0251 }, { 0x0261, 0x0261 },
++ { 0x02C4, 0x02C4 }, { 0x02C7, 0x02C7 }, { 0x02C9, 0x02CB },
++ { 0x02CD, 0x02CD }, { 0x02D0, 0x02D0 }, { 0x02D8, 0x02DB },
++ { 0x02DD, 0x02DD }, { 0x02DF, 0x02DF }, { 0x0391, 0x03A1 },
++ { 0x03A3, 0x03A9 }, { 0x03B1, 0x03C1 }, { 0x03C3, 0x03C9 },
++ { 0x0401, 0x0401 }, { 0x0410, 0x044F }, { 0x0451, 0x0451 },
++ { 0x2010, 0x2010 }, { 0x2013, 0x2016 }, { 0x2018, 0x2019 },
++ { 0x201C, 0x201D }, { 0x2020, 0x2022 }, { 0x2024, 0x2027 },
++ { 0x2030, 0x2030 }, { 0x2032, 0x2033 }, { 0x2035, 0x2035 },
++ { 0x203B, 0x203B }, { 0x203E, 0x203E }, { 0x2074, 0x2074 },
++ { 0x207F, 0x207F }, { 0x2081, 0x2084 }, { 0x20AC, 0x20AC },
++ { 0x2103, 0x2103 }, { 0x2105, 0x2105 }, { 0x2109, 0x2109 },
++ { 0x2113, 0x2113 }, { 0x2116, 0x2116 }, { 0x2121, 0x2122 },
++ { 0x2126, 0x2126 }, { 0x212B, 0x212B }, { 0x2153, 0x2154 },
++ { 0x215B, 0x215E }, { 0x2160, 0x216B }, { 0x2170, 0x2179 },
++ { 0x2190, 0x2199 }, { 0x21B8, 0x21B9 }, { 0x21D2, 0x21D2 },
++ { 0x21D4, 0x21D4 }, { 0x21E7, 0x21E7 }, { 0x2200, 0x2200 },
++ { 0x2202, 0x2203 }, { 0x2207, 0x2208 }, { 0x220B, 0x220B },
++ { 0x220F, 0x220F }, { 0x2211, 0x2211 }, { 0x2215, 0x2215 },
++ { 0x221A, 0x221A }, { 0x221D, 0x2220 }, { 0x2223, 0x2223 },
++ { 0x2225, 0x2225 }, { 0x2227, 0x222C }, { 0x222E, 0x222E },
++ { 0x2234, 0x2237 }, { 0x223C, 0x223D }, { 0x2248, 0x2248 },
++ { 0x224C, 0x224C }, { 0x2252, 0x2252 }, { 0x2260, 0x2261 },
++ { 0x2264, 0x2267 }, { 0x226A, 0x226B }, { 0x226E, 0x226F },
++ { 0x2282, 0x2283 }, { 0x2286, 0x2287 }, { 0x2295, 0x2295 },
++ { 0x2299, 0x2299 }, { 0x22A5, 0x22A5 }, { 0x22BF, 0x22BF },
++ { 0x2312, 0x2312 }, { 0x2460, 0x24E9 }, { 0x24EB, 0x254B },
++ { 0x2550, 0x2573 }, { 0x2580, 0x258F }, { 0x2592, 0x2595 },
++ { 0x25A0, 0x25A1 }, { 0x25A3, 0x25A9 }, { 0x25B2, 0x25B3 },
++ { 0x25B6, 0x25B7 }, { 0x25BC, 0x25BD }, { 0x25C0, 0x25C1 },
++ { 0x25C6, 0x25C8 }, { 0x25CB, 0x25CB }, { 0x25CE, 0x25D1 },
++ { 0x25E2, 0x25E5 }, { 0x25EF, 0x25EF }, { 0x2605, 0x2606 },
++ { 0x2609, 0x2609 }, { 0x260E, 0x260F }, { 0x2614, 0x2615 },
++ { 0x261C, 0x261C }, { 0x261E, 0x261E }, { 0x2640, 0x2640 },
++ { 0x2642, 0x2642 }, { 0x2660, 0x2661 }, { 0x2663, 0x2665 },
++ { 0x2667, 0x266A }, { 0x266C, 0x266D }, { 0x266F, 0x266F },
++ { 0x273D, 0x273D }, { 0x2776, 0x277F }, { 0xE000, 0xF8FF },
++ { 0xFFFD, 0xFFFD }, { 0xF0000, 0xFFFFD }, { 0x100000, 0x10FFFD }
++ };
++
++ return ((c >= 0x1100 &&
++ (c <= 0x115f || /* Hangul Jamo init. consonants */
++ c == 0x2329 || c == 0x232a ||
++ (c >= 0x2e80 && c <= 0xa4cf &&
++ c != 0x303f) || /* CJK ... Yi */
++ (c >= 0xac00 && c <= 0xd7a3) || /* Hangul Syllables */
++ (c >= 0xf900 && c <= 0xfaff) || /* CJK Compatibility Ideographs */
++ (c >= 0xfe30 && c <= 0xfe6f) || /* CJK Compatibility Forms */
++ (c >= 0xff00 && c <= 0xff60) || /* Fullwidth Forms */
++ (c >= 0xffe0 && c <= 0xffe6) ||
++ (c >= 0x20000 && c <= 0x2fffd) ||
++ (c >= 0x30000 && c <= 0x3fffd))) ||
++ (cjkwidth &&
++ bisearch(c, ambiguous,
++ sizeof(ambiguous) / sizeof(struct interval) - 1)));
+ }
+ #endif
+
+--- process.c.orig Thu Sep 18 20:53:54 2003
++++ process.c Fri May 6 19:43:53 2005
+@@ -103,6 +103,9 @@
+ #ifdef UTF8
+ extern char *screenencodings;
+ #endif
++#ifdef DW_CHARS
++extern int cjkwidth;
++#endif
+
+ static int CheckArgNum __P((int, char **));
+ static void ClearAction __P((struct action *));
+@@ -3821,6 +3824,15 @@
+ Msg(0, "idle off");
+ }
+ break;
++#ifdef DW_CHARS
++ case RC_CJKWIDTH:
++ if(ParseSwitch(act, &cjkwidth) == 0)
++ {
++ if(msgok)
++ Msg(0, "Treat ambiguous width characters as %s width", cjkwidth ? "full" : "half");
++ }
++ break;
++#endif
+ default:
+ #ifdef HAVE_BRAILLE
+ /* key == -2: input from braille keybord, msgok always 0 */
+--- screen.c.orig Mon Sep 8 22:26:41 2003
++++ screen.c Sat May 7 05:16:38 2005
+@@ -221,6 +221,10 @@
+ char *screenencodings;
+ #endif
+
++#ifdef DW_CHARS
++int cjkwidth;
++#endif
++
+ #ifdef NETHACK
+ int nethackflag = 0;
+ #endif
+@@ -468,6 +472,9 @@
+ InitBuiltinTabs();
+ screenencodings = SaveStr(SCREENENCODINGS);
+ #endif
++#ifdef DW_CHARS
++ cjkwidth = 0;
++#endif
+ nwin = nwin_undef;
+ nwin_options = nwin_undef;
+ strcpy(screenterm, "screen");
+@@ -762,6 +769,19 @@
+ debug1("environment says encoding=%d\n", nwin_options.encoding);
+ #endif
+ }
++# ifdef DW_CHARS
++ {
++ char *s;
++ if((s = getenv("LC_ALL")) || (s = getenv("LC_CTYPE")) ||
++ (s = getenv("LANG")))
++ {
++ if(!strncmp(s, "zh_", 3) || !strncmp(s, "ja_", 3) || !strncmp(s, "ko_", 3))
++ {
++ cjkwidth = 1;
++ }
++ }
++ }
++#endif
+ #endif
+ if (SockMatch && strlen(SockMatch) >= MAXSTR)
+ Panic(0, "Ridiculously long socketname - try again.");
diff --git a/sysutils/screen-legacy/files/opt-hostinlocked b/sysutils/screen-legacy/files/opt-hostinlocked
new file mode 100644
index 000000000000..ee3b31f23534
--- /dev/null
+++ b/sysutils/screen-legacy/files/opt-hostinlocked
@@ -0,0 +1,21 @@
+--- attacher.c Sun Oct 2 10:29:36 2005
++++ attacher.c Sun Oct 2 10:30:18 2005
+@@ -809,6 +809,7 @@
+ #else
+ char *pass, mypass[16 + 1], salt[3];
+ #endif
++ extern char HostName[];
+
+ #ifndef USE_PAM
+ pass = ppp->pw_passwd;
+@@ -859,8 +860,8 @@
+ *cp1 -= 'a' - 'A';
+ }
+
+- sprintf(message, "Screen used by %s <%s>.\nPassword:\007",
+- fullname, ppp->pw_name);
++ sprintf(message, "Screen used by %s <%s@%s>.\nPassword:\007",
++ fullname, ppp->pw_name, HostName);
+
+ /* loop here to wait for correct password */
+ for (;;)
diff --git a/sysutils/screen-legacy/files/opt-showencoding b/sysutils/screen-legacy/files/opt-showencoding
new file mode 100644
index 000000000000..dfc2ed4f25cb
--- /dev/null
+++ b/sysutils/screen-legacy/files/opt-showencoding
@@ -0,0 +1,31 @@
+--- process.c.orig 2008-05-08 02:37:33.000000000 +0800
++++ process.c 2008-05-08 02:37:49.000000000 +0800
+@@ -3422,6 +3422,7 @@
+ {
+ WinSwitchEncoding(fore, n);
+ ResetCharsets(fore);
++ RedisplayDisplays(0);
+ }
+ else if (i && display)
+ D_encoding = n;
+--- screen.c.orig 2008-05-08 02:37:22.000000000 +0800
++++ screen.c 2008-05-20 20:34:37.000000000 +0800
+@@ -2584,6 +2584,18 @@
+ }
+ p += strlen(p) - 1;
+ break;
++#ifdef ENCODINGS
++ case 'e':
++ *p = 0;
++ D_encoding = nwin_options.encoding > 0 ? nwin_options.encoding : 0;
++ if (win && win->w_encoding)
++ {
++ *p++ = ' ';
++ strcpy(p, EncodingName(win->w_encoding));
++ }
++ p += strlen(p) - 1;
++ break;
++#endif
+ case '{':
+ {
+ char rbuf[128];
diff --git a/sysutils/screen-legacy/files/patch-Makefile.in b/sysutils/screen-legacy/files/patch-Makefile.in
new file mode 100644
index 000000000000..d5966dc1d1ab
--- /dev/null
+++ b/sysutils/screen-legacy/files/patch-Makefile.in
@@ -0,0 +1,20 @@
+--- Makefile.in.orig 2007-07-30 12:38:38.000000000 +0200
++++ Makefile.in 2007-07-30 12:39:34.000000000 +0200
+@@ -77,7 +77,7 @@
+
+ ###############################################################################
+ install: installdirs install_bin
+- cd doc ; $(MAKE) install
++ cd doc ; $(MAKE) $(MAKE_ARGS) install
+ -if [ -d /usr/lib/terminfo ]; then \
+ PATH="$$PATH:/usr/5bin" tic ${srcdir}/terminfo/screeninfo.src; \
+ chmod 644 /usr/lib/terminfo/s/screen*; \
+@@ -90,7 +90,7 @@
+ installdirs:
+ # Path leading to ETCSCREENRC and Socketdirectory not checked.
+ $(srcdir)/etc/mkinstalldirs $(DESTDIR)$(bindir) $(DESTDIR)$(SCREENENCODINGS)
+- cd doc ; $(MAKE) installdirs
++ cd doc ; $(MAKE) $(MAKE_ARGS) installdirs
+
+ uninstall: .version
+ rm -f $(DESTDIR)$(bindir)/$(SCREEN)
diff --git a/sysutils/screen-legacy/files/patch-aa b/sysutils/screen-legacy/files/patch-aa
new file mode 100644
index 000000000000..66d9aa54793e
--- /dev/null
+++ b/sysutils/screen-legacy/files/patch-aa
@@ -0,0 +1,19 @@
+--- Makefile.in.orig Thu Feb 14 22:36:33 2002
++++ Makefile.in Tue Feb 19 13:18:38 2002
+@@ -71,14 +71,8 @@
+ $(CC) -c -I. -I$(srcdir) $(M_CFLAGS) $(DEFS) $(OPTIONS) $(CFLAGS) $<
+
+ install_bin: .version screen
+- -if [ -f $(DESTDIR)$(bindir)/$(SCREEN) ] && [ ! -f $(DESTDIR)$(bindir)/$(SCREEN).old ]; \
+- then mv $(DESTDIR)$(bindir)/$(SCREEN) $(DESTDIR)$(bindir)/$(SCREEN).old; fi
+- $(INSTALL_PROGRAM) screen $(DESTDIR)$(bindir)/$(SCREEN)
+- -chown root $(DESTDIR)$(bindir)/$(SCREEN) && chmod 4755 $(DESTDIR)$(bindir)/$(SCREEN)
+-# This doesn't work if $(bindir)/screen is a symlink
+- -if [ -f $(DESTDIR)$(bindir)/screen ] && [ ! -f $(DESTDIR)$(bindir)/screen.old ]; then mv $(DESTDIR)$(bindir)/screen $(DESTDIR)$(bindir)/screen.old; fi
+- rm -f $(DESTDIR)$(bindir)/screen
+- (cd $(DESTDIR)$(bindir) && ln -sf $(SCREEN) screen)
++ $(INSTALL_PROGRAM) screen $(DESTDIR)$(bindir)/screen
++ -chown root:wheel $(DESTDIR)$(bindir)/screen && chmod 4755 $(DESTDIR)$(bindir)/screen
+ cp $(srcdir)/utf8encodings/?? $(DESTDIR)$(SCREENENCODINGS)
+
+ ###############################################################################
diff --git a/sysutils/screen-legacy/files/patch-ab b/sysutils/screen-legacy/files/patch-ab
new file mode 100644
index 000000000000..ff1673015a5a
--- /dev/null
+++ b/sysutils/screen-legacy/files/patch-ab
@@ -0,0 +1,20 @@
+--- doc/Makefile.in.orig Fri May 25 18:50:55 2001
++++ doc/Makefile.in Mon Jun 25 08:42:08 2001
+@@ -27,7 +27,7 @@
+
+ info screen.info: screen.texinfo
+ @rm -f screen.info*
+- $(MAKEINFO) $(srcdir)/screen.texinfo -o screen.info
++ $(MAKEINFO) --no-split $(srcdir)/screen.texinfo -o screen.info
+
+ install: installdirs
+ $(INSTALL_DATA) $(srcdir)/screen.1 $(DESTDIR)$(mandir)/man1/screen.1
+@@ -36,7 +36,7 @@
+ if test -f $$d/screen.info; then \
+ for f in $$d/screen.info*; do $(INSTALL_DATA) $$f $(DESTDIR)$(infodir);done; \
+ if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
+- install-info --info-dir=$(DESTDIR)$(infodir) $$d/screen.info; \
++ install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/screen.info; \
+ else true; fi; \
+ fi
+
diff --git a/sysutils/screen-legacy/files/patch-ad b/sysutils/screen-legacy/files/patch-ad
new file mode 100644
index 000000000000..75cc40566f7d
--- /dev/null
+++ b/sysutils/screen-legacy/files/patch-ad
@@ -0,0 +1,121 @@
+--- configure.orig Fri Dec 5 15:46:53 2003
++++ configure Sat Mar 4 10:18:24 2006
+@@ -4746,48 +4746,6 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ olibs="$LIBS"
+-LIBS="-lcurses $olibs"
+-{ echo "$as_me:$LINENO: checking libcurses..." >&5
+-echo "$as_me: checking libcurses..." >&6;}
+-cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-
+-int
+-main ()
+-{
+-
+-#ifdef __hpux
+-__sorry_hpux_libcurses_is_totally_broken_in_10_10();
+-#else
+-tgetent((char *)0, (char *)0);
+-#endif
+-
+- ;
+- return 0;
+-}
+-_ACEOF
+-rm -f conftest.$ac_objext conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -s conftest$ac_exeext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- :
+-else
+- echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+ LIBS="-ltermcap $olibs"
+ { echo "$as_me:$LINENO: checking libtermcap..." >&5
+ echo "$as_me: checking libtermcap..." >&6;}
+@@ -4907,8 +4865,6 @@
+ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ fi
+ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+-fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+ if test "$cross_compiling" = yes; then
+ { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+@@ -4927,7 +4883,8 @@
+
+ main()
+ {
+- exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
++ char *tgoto(const char *, int, int);
++ exit(strcmp(tgoto("%d%d", 0, 1), "1") ? 0 : 1);
+ }
+ _ACEOF
+ rm -f conftest$ac_exeext
+@@ -5314,19 +5271,16 @@
+ fi
+ rm -f conftest*
+
+-if test "$ptys" != "$pdir/pty??" ; then
+-p0=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'`
+-p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'`
++# XXX: hardcoded, since port must be devfs and various setups independent
++
+ cat >>confdefs.h <<_ACEOF
+-#define PTYRANGE0 "$p0"
++#define PTYRANGE0 "pqrsPQRSlmnoLMNO"
+ _ACEOF
+
+ cat >>confdefs.h <<_ACEOF
+-#define PTYRANGE1 "$p1"
++#define PTYRANGE1 "0123456789abcdefghijklmnopqrstuv"
+ _ACEOF
+
+-fi
+-
+
+ # Check whether --with-pty-mode or --without-pty-mode was given.
+ if test "${with_pty_mode+set}" = set; then
+@@ -5575,6 +5529,8 @@
+ #if defined(SVR4) && !defined(DGUX)
+ #include <utmpx.h>
+ #define utmp utmpx
++#define pututline pututxline
++#define getutent getutxent
+ #else
+ #include <utmp.h>
+ #endif
+@@ -5627,6 +5583,8 @@
+ #if defined(SVR4) && !defined(DGUX)
+ #include <utmpx.h>
+ #define utmp utmpx
++#define pututline pututxline
++#define getutent getutxent
+ #else
+ #include <utmp.h>
+ #endif
+@@ -5683,6 +5641,8 @@
+ #if defined(SVR4) && !defined(DGUX)
+ #include <utmpx.h>
+ #define utmp utmpx
++#define pututline pututxline
++#define getutent getutxent
+ #else
+ #include <utmp.h>
+ #endif
diff --git a/sysutils/screen-legacy/files/patch-af b/sysutils/screen-legacy/files/patch-af
new file mode 100644
index 000000000000..426bb1516fd6
--- /dev/null
+++ b/sysutils/screen-legacy/files/patch-af
@@ -0,0 +1,15 @@
+--- termcap.c.orig Wed Jul 5 16:33:30 2000
++++ termcap.c Wed Oct 11 05:40:12 2000
+@@ -355,11 +355,7 @@
+ if (D_CG0)
+ {
+ if (D_CS0 == 0)
+-#ifdef TERMINFO
+- D_CS0 = "\033(%p1%c";
+-#else
+- D_CS0 = "\033(%.";
+-#endif
++ D_CS0 = "\033(%p1%c"; /* Old ncurses can't handle %. */
+ if (D_CE0 == 0)
+ D_CE0 = "\033(B";
+ D_AC = 0;
diff --git a/sysutils/screen-legacy/files/patch-ansi.c b/sysutils/screen-legacy/files/patch-ansi.c
new file mode 100644
index 000000000000..dc5ba91b521a
--- /dev/null
+++ b/sysutils/screen-legacy/files/patch-ansi.c
@@ -0,0 +1,11 @@
+--- ansi.c.orig Mon Sep 8 07:24:44 2003
++++ ansi.c Mon Dec 1 17:17:17 2003
+@@ -559,7 +559,7 @@
+ {
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+- if (curr->w_NumArgs < MAXARGS)
++ if (curr->w_NumArgs >= 0 && curr->w_NumArgs < MAXARGS)
+ {
+ if (curr->w_args[curr->w_NumArgs] < 100000000)
+ curr->w_args[curr->w_NumArgs] =
diff --git a/sysutils/screen-legacy/files/patch-attacher.c b/sysutils/screen-legacy/files/patch-attacher.c
new file mode 100644
index 000000000000..0f89189898e3
--- /dev/null
+++ b/sysutils/screen-legacy/files/patch-attacher.c
@@ -0,0 +1,24 @@
+--- attacher.c.orig 2003-09-08 07:24:48.000000000 -0700
++++ attacher.c 2011-01-02 21:42:39.547897531 -0800
+@@ -662,7 +662,7 @@
+ printf("\n");
+
+ prg = getenv("LOCKPRG");
+- if (prg && strcmp(prg, "builtin") && !access(prg, X_OK))
++ if (prg && (strcmp(prg, "builtin") || strcmp(prg,"builtin-passwd")) && !access(prg, X_OK))
+ {
+ signal(SIGCHLD, SIG_DFL);
+ debug1("lockterminal: '%s' seems executable, execl it!\n", prg);
+@@ -676,7 +676,11 @@
+ setuid(real_uid); /* this should be done already */
+ #endif
+ closeallfiles(0); /* important: /etc/shadow may be open */
+- execl(prg, "SCREEN-LOCK", NULL);
++ if (strcmp(prg,"builtin-passwd"))
++ /* use system passsword for lock */
++ execl(prg, "SCREEN-LOCK", "-p", "-n", NULL);
++ else
++ execl(prg, "SCREEN-LOCK", NULL);
+ exit(errno);
+ }
+ if (pid == -1)
diff --git a/sysutils/screen-legacy/files/patch-display.h b/sysutils/screen-legacy/files/patch-display.h
new file mode 100644
index 000000000000..cb3610bdfbd0
--- /dev/null
+++ b/sysutils/screen-legacy/files/patch-display.h
@@ -0,0 +1,11 @@
+--- display.h.orig 2003-07-01 07:01:42.000000000 -0700
++++ display.h 2011-11-07 11:54:32.842183150 -0800
+@@ -85,7 +85,7 @@
+ struct win *d_other; /* pointer to other window */
+ int d_nonblock; /* -1 don't block if obufmax reached */
+ /* >0: block after nonblock secs */
+- char d_termname[20 + 1]; /* $TERM */
++ char d_termname[63 + 1]; /* $TERM */
+ char *d_tentry; /* buffer for tgetstr */
+ char d_tcinited; /* termcap inited flag */
+ int d_width, d_height; /* width/height of the screen */
diff --git a/sysutils/screen-legacy/files/patch-doc_Makefile.in b/sysutils/screen-legacy/files/patch-doc_Makefile.in
new file mode 100644
index 000000000000..a20134f212fc
--- /dev/null
+++ b/sysutils/screen-legacy/files/patch-doc_Makefile.in
@@ -0,0 +1,34 @@
+--- doc/Makefile.in.orig 2007-10-29 13:08:52.000000000 -0700
++++ doc/Makefile.in 2007-10-29 13:11:09.000000000 -0700
+@@ -30,7 +30,10 @@
+ $(MAKEINFO) --no-split $(srcdir)/screen.texinfo -o screen.info
+
+ install: installdirs
++.if defined(WITH_MAN)
+ $(INSTALL_DATA) $(srcdir)/screen.1 $(DESTDIR)$(mandir)/man1/screen.1
++.endif
++.if defined(WITH_INFO)
+ -$(MAKE) screen.info
+ -if test -f screen.info; then d=.; else d=$(srcdir); fi; \
+ if test -f $$d/screen.info; then \
+@@ -39,13 +42,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)
++.if defined(WITH_MAN)
++ $(srcdir)/../etc/mkinstalldirs $(DESTDIR)$(mandir)/man1
++.endif
++.if defined(WITH_INFO)
++ $(srcdir)/../etc/mkinstalldirs $(DESTDIR)$(infodir)
++.endif
+
+ mostlyclean:
+ -rm -f *.cp *.cps *.fn *.fns *.ky *.kys *.pg *.tp *.vr
diff --git a/sysutils/screen-legacy/files/patch-os.h b/sysutils/screen-legacy/files/patch-os.h
new file mode 100644
index 000000000000..9826ba4f9ea5
--- /dev/null
+++ b/sysutils/screen-legacy/files/patch-os.h
@@ -0,0 +1,33 @@
+--- os.h.orig Tue Jan 8 07:42:33 2002
++++ os.h Tue Sep 9 17:39:58 2003
+@@ -161,7 +161,7 @@
+ # define setregid(rgid, egid) setresgid(rgid, egid, -1)
+ #endif
+
+-#if defined(HAVE_SETEUID) || defined(HAVE_SETREUID)
++#if (defined(HAVE_SETEUID) || defined(HAVE_SETREUID)) && __FreeBSD_version < 500000
+ # define USE_SETEUID
+ #endif
+
+@@ -262,7 +262,11 @@
+ #if defined(UTMPOK) || defined(BUGGYGETLOGIN)
+ # if defined(SVR4) && !defined(DGUX) && !defined(__hpux) && !defined(linux)
+ # include <utmpx.h>
+-# define UTMPFILE UTMPX_FILE
++# ifdef UTMPX_FILE
++# define UTMPFILE UTMPX_FILE
++# else
++# define UTMPFILE "/nonexistent"
++# endif
+ # define utmp utmpx
+ # define getutent getutxent
+ # define getutid getutxid
+@@ -270,7 +274,7 @@
+ # define pututline pututxline
+ # define setutent setutxent
+ # define endutent endutxent
+-# define ut_time ut_xtime
++# define ut_time ut_tv.tv_sec
+ # else /* SVR4 */
+ # include <utmp.h>
+ # endif /* SVR4 */
diff --git a/sysutils/screen-legacy/files/patch-osdef.h.in b/sysutils/screen-legacy/files/patch-osdef.h.in
new file mode 100644
index 000000000000..72435743c0eb
--- /dev/null
+++ b/sysutils/screen-legacy/files/patch-osdef.h.in
@@ -0,0 +1,11 @@
+--- osdef.h.in.orig Sat Apr 28 22:26:43 2001
++++ osdef.h.in Tue Apr 9 10:24:18 2002
+@@ -111,7 +111,7 @@
+ extern int setpgid __P((int, int));
+ extern int tcsetpgrp __P((int, int));
+ #endif
+-extern int ioctl __P((int, int, char *));
++extern int ioctl __P((int, unsigned long, ...));
+
+ extern int kill __P((int, int));
+
diff --git a/sysutils/screen-legacy/files/patch-process.c b/sysutils/screen-legacy/files/patch-process.c
new file mode 100644
index 000000000000..b7e8f99133b5
--- /dev/null
+++ b/sysutils/screen-legacy/files/patch-process.c
@@ -0,0 +1,11 @@
+--- process.c
++++ process.c
+@@ -37,7 +37,7 @@
+ #include "config.h"
+
+ /* for solaris 2.1, Unixware (SVR4.2) and possibly others: */
+-#ifdef SVR4
++#if defined(SVR4) && !defined(__FreeBSD__)
+ # include <sys/stropts.h>
+ #endif
+
diff --git a/sysutils/screen-legacy/files/patch-pty.c b/sysutils/screen-legacy/files/patch-pty.c
new file mode 100644
index 000000000000..352a37e704b5
--- /dev/null
+++ b/sysutils/screen-legacy/files/patch-pty.c
@@ -0,0 +1,15 @@
+--- pty.c.orig Mon Feb 6 18:54:37 2006
++++ pty.c Mon Feb 6 18:56:50 2006
+@@ -33,10 +33,12 @@
+ # include <sys/ioctl.h>
+ #endif
+
++#ifndef __FreeBSD__
+ /* for solaris 2.1, Unixware (SVR4.2) and possibly others */
+ #ifdef HAVE_SVR4_PTYS
+ # include <sys/stropts.h>
+ #endif
++#endif
+
+ #if defined(sun) && defined(LOCKPTY) && !defined(TIOCEXCL)
+ # include <sys/ttold.h>
diff --git a/sysutils/screen-legacy/files/patch-resize.c b/sysutils/screen-legacy/files/patch-resize.c
new file mode 100644
index 000000000000..a2af125f12ff
--- /dev/null
+++ b/sysutils/screen-legacy/files/patch-resize.c
@@ -0,0 +1,20 @@
+--- resize.c.orig Mon Sep 8 07:26:31 2003
++++ resize.c Mon Dec 1 17:16:29 2003
+@@ -682,6 +682,17 @@
+ if (wi == 0)
+ he = hi = 0;
+
++ if (wi > 1000)
++ {
++ Msg(0, "Window width too large, truncated");
++ wi = 1000;
++ }
++ if (he > 1000)
++ {
++ Msg(0, "Window height too large, truncated");
++ he = 1000;
++ }
++
+ if (p->w_width == wi && p->w_height == he && p->w_histheight == hi)
+ {
+ debug("ChangeWindowSize: No change.\n");
diff --git a/sysutils/screen-legacy/files/patch-screen.c b/sysutils/screen-legacy/files/patch-screen.c
new file mode 100644
index 000000000000..59b1a72762d3
--- /dev/null
+++ b/sysutils/screen-legacy/files/patch-screen.c
@@ -0,0 +1,11 @@
+--- screen.c
++++ screen.c
+@@ -50,7 +50,7 @@
+
+ #include "config.h"
+
+-#ifdef SVR4
++#if defined(SVR4) && !defined(__FreeBSD__)
+ # include <sys/stropts.h>
+ #endif
+
diff --git a/sysutils/screen-legacy/files/patch-screen.h b/sysutils/screen-legacy/files/patch-screen.h
new file mode 100644
index 000000000000..d8fa112b5769
--- /dev/null
+++ b/sysutils/screen-legacy/files/patch-screen.h
@@ -0,0 +1,20 @@
+--- screen.h.orig 2003-08-22 05:28:43.000000000 -0700
++++ screen.h 2011-11-07 11:53:41.739890820 -0800
+@@ -22,6 +22,8 @@
+ * $Id: screen.h,v 1.12 1994/05/31 12:32:54 mlschroe Exp $ FAU
+ */
+
++#include <string.h>
++
+ #include "os.h"
+
+ #if defined(__STDC__)
+@@ -202,7 +204,7 @@
+ char preselect[20];
+ int esc; /* his new escape character unless -1 */
+ int meta_esc; /* his new meta esc character unless -1 */
+- char envterm[20 + 1]; /* terminal type */
++ char envterm[63 + 1]; /* terminal type */
+ int encoding; /* encoding of display */
+ }
+ attach;
diff --git a/sysutils/screen-legacy/files/patch-terminfo::checktc.c b/sysutils/screen-legacy/files/patch-terminfo::checktc.c
new file mode 100644
index 000000000000..d4ffb75cc0c1
--- /dev/null
+++ b/sysutils/screen-legacy/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-legacy/files/patch-tty.sh b/sysutils/screen-legacy/files/patch-tty.sh
new file mode 100644
index 000000000000..1b40f3c939fd
--- /dev/null
+++ b/sysutils/screen-legacy/files/patch-tty.sh
@@ -0,0 +1,22 @@
+--- tty.sh
++++ tty.sh
+@@ -76,7 +76,7 @@
+ #endif
+
+ #include "config.h"
+-#ifdef SVR4
++#if defined(SVR4) && !defined(__FreeBSD__)
+ #include <sys/stropts.h> /* for I_POP */
+ #endif
+
+@@ -562,7 +562,9 @@
+ XIF{VLNEXT} np->tio.c_cc[VLNEXT] = VDISABLE;
+ XIF{VSTATUS} np->tio.c_cc[VSTATUS] = VDISABLE;
+ XIF{VSUSP} np->tio.c_cc[VSUSP] = VDISABLE;
+-XIF{VERASE} np->tio.c_cc[VERASE] = VDISABLE;
++ /* Set VERASE to DEL, rather than VDISABLE, to avoid libvte
++ "autodetect" issues. */
++XIF{VERASE} np->tio.c_cc[VERASE] = 0x7f;
+ XIF{VKILL} np->tio.c_cc[VKILL] = VDISABLE;
+ # ifdef HPUX_LTCHARS_HACK
+ np->m_ltchars.t_suspc = VDISABLE;
diff --git a/sysutils/screen-legacy/files/patch-utmp.c b/sysutils/screen-legacy/files/patch-utmp.c
new file mode 100644
index 000000000000..496c53bc2831
--- /dev/null
+++ b/sysutils/screen-legacy/files/patch-utmp.c
@@ -0,0 +1,87 @@
+--- utmp.c
++++ utmp.c
+@@ -404,12 +404,6 @@
+ register slot_t slot;
+ struct utmp u;
+ int saved_ut;
+-#ifdef UTHOST
+- char *p;
+- char host[sizeof(D_loginhost) + 15];
+-#else
+- char *host = 0;
+-#endif /* UTHOST */
+
+ wi->w_slot = (slot_t)0;
+ if (!utmpok || wi->w_type != W_TYPE_PTY)
+@@ -430,51 +424,12 @@
+ makeuser(&u, stripdev(wi->w_tty), LoginName, wi->w_pid);
+
+ #ifdef UTHOST
+- host[sizeof(host) - 15] = '\0';
+- if (display)
+- {
+- strncpy(host, D_loginhost, sizeof(host) - 15);
+- if (D_loginslot != (slot_t)0 && D_loginslot != (slot_t)-1 && host[0] != '\0')
+- {
+- /*
+- * we want to set our ut_host field to something like
+- * ":ttyhf:s.0" or
+- * "faui45:s.0" or
+- * "132.199.81.4:s.0" (even this may hurt..), but not
+- * "faui45.informati"......:s.0
+- * HPUX uses host:0.0, so chop at "." and ":" (Eric Backus)
+- */
+- for (p = host; *p; p++)
+- if ((*p < '0' || *p > '9') && (*p != '.'))
+- break;
+- if (*p)
+- {
+- for (p = host; *p; p++)
+- if (*p == '.' || (*p == ':' && p != host))
+- {
+- *p = '\0';
+- break;
+- }
+- }
+- }
+- else
+- {
+- strncpy(host + 1, stripdev(D_usertty), sizeof(host) - 15 - 1);
+- host[0] = ':';
+- }
+- }
+- else
+- strncpy(host, "local", sizeof(host) - 15);
+-
+- sprintf(host + strlen(host), ":S.%d", wi->w_number);
+- debug1("rlogin hostname: '%s'\n", host);
+-
+ # if !defined(_SEQUENT_) && !defined(sequent)
+- strncpy(u.ut_host, host, sizeof(u.ut_host));
++ strncpy(u.ut_host, D_loginhost, sizeof(u.ut_host));
+ # endif
+ #endif /* UTHOST */
+
+- if (pututslot(slot, &u, host, wi) == 0)
++ if (pututslot(slot, &u, D_loginhost, wi) == 0)
+ {
+ Msg(errno,"Could not write %s", UtmpName);
+ UT_CLOSE;
+@@ -589,7 +544,7 @@
+ struct utmp *u;
+ {
+ u->ut_type = DEAD_PROCESS;
+-#if !defined(linux) || defined(EMPTY)
++#if (!defined(linux) || defined(EMPTY)) && !defined(__FreeBSD__)
+ u->ut_exit.e_termination = 0;
+ u->ut_exit.e_exit = 0;
+ #endif
+@@ -728,7 +683,7 @@
+ {
+ strncpy(u->ut_line, line, sizeof(u->ut_line));
+ strncpy(u->ut_name, user, sizeof(u->ut_name));
+- (void)time((time_t *)&u->ut_time);
++ u->ut_time = time(NULL);
+ }
+
+ static slot_t
diff --git a/sysutils/screen-legacy/pkg-descr b/sysutils/screen-legacy/pkg-descr
new file mode 100644
index 000000000000..36b1048e0a0a
--- /dev/null
+++ b/sysutils/screen-legacy/pkg-descr
@@ -0,0 +1,9 @@
+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.
+
+WWW: http://www.gnu.org/software/screen/
diff --git a/sysutils/screen-legacy/pkg-plist b/sysutils/screen-legacy/pkg-plist
new file mode 100644
index 000000000000..5deb6fcc1d85
--- /dev/null
+++ b/sysutils/screen-legacy/pkg-plist
@@ -0,0 +1,25 @@
+bin/screen
+%%MAN%%man/man1/screen.1.gz
+@unexec if cmp -s %D/etc/screenrc %D/%%EXAMPLESDIR%%/screenrc; then rm -f %D/etc/screenrc; else echo If permanently deleting this package, %%PREFIX%%/etc/screenrc must be removed manually; fi
+%%EXAMPLESDIR%%/screenrc
+@exec [ -f %D/etc/screenrc ] || cp %B/%f %D/etc/screenrc
+%%DATADIR%%/utf8encodings/01
+%%DATADIR%%/utf8encodings/02
+%%DATADIR%%/utf8encodings/03
+%%DATADIR%%/utf8encodings/04
+%%DATADIR%%/utf8encodings/18
+%%DATADIR%%/utf8encodings/19
+%%DATADIR%%/utf8encodings/a1
+%%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
+@dirrm %%DATADIR%%/utf8encodings
+@dirrm %%DATADIR%%
+@dirrm %%EXAMPLESDIR%%