Gentoo Archives: gentoo-commits

From: Yuta SATOH <nigoro.gentoo@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gentoo-bsd:master commit in: app-misc/screen/, app-misc/screen/files/
Date: Thu, 29 Nov 2012 14:07:44
Message-Id: 1354196563.4942019a33606078eef8e0590928af9f0973d6bf.yuta_satoh@gentoo
1 commit: 4942019a33606078eef8e0590928af9f0973d6bf
2 Author: Yuta SATOH <nigoro <AT> gentoo <DOT> gr <DOT> jp>
3 AuthorDate: Thu Nov 29 13:42:43 2012 +0000
4 Commit: Yuta SATOH <nigoro.gentoo <AT> 0x100 <DOT> com>
5 CommitDate: Thu Nov 29 13:42:43 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bsd.git;a=commit;h=4942019a
7
8 added app-misc/screen -- fixed bug #409819
9
10 ---
11 app-misc/screen/Manifest | 17 +
12 app-misc/screen/files/4.0.2-64bit-time.patch | 11 +
13 app-misc/screen/files/4.0.2-no-libelf.patch | 18 +
14 app-misc/screen/files/4.0.2-no-pty.patch | 14 +
15 app-misc/screen/files/4.0.2-no-utempter.patch | 14 +
16 app-misc/screen/files/4.0.2-nonblock.patch | 11 +
17 .../files/4.0.2-windowlist-multiuser-fix.patch | 12 +
18 .../screen/files/4.0.3-extend-d_termname-ng2.patch | 203 +++++++
19 .../files/screen-4.0.1-int-overflow-fix.patch | 31 +
20 app-misc/screen/files/screen-4.0.1-vsprintf.patch | 13 +
21 .../screen-4.0.3-config.h-autoconf-2.62.patch | 14 +
22 app-misc/screen/files/screen-4.0.3-cppflags.patch | 20 +
23 .../screen/files/screen-4.0.3-crosscompile.patch | 598 ++++++++++++++++++++
24 app-misc/screen/files/screen-4.0.3-fbsd.patch | 55 ++
25 .../files/screen-4.0.3-setenv_autoconf.patch | 79 +++
26 app-misc/screen/files/screenrc | 356 ++++++++++++
27 app-misc/screen/screen-4.0.3-r7.ebuild | 159 ++++++
28 17 files changed, 1625 insertions(+), 0 deletions(-)
29
30 diff --git a/app-misc/screen/Manifest b/app-misc/screen/Manifest
31 new file mode 100644
32 index 0000000..c8c044c
33 --- /dev/null
34 +++ b/app-misc/screen/Manifest
35 @@ -0,0 +1,17 @@
36 +AUX 4.0.2-64bit-time.patch 298 SHA256 d974e14a1d8e32a0a05b211cd76d9335a066c6b85538505f1d95f25209c99057 SHA512 c6f90f0626d90fbd48a2ccbb769d0578915d0b804df8fa75fc8036c89b54a056d97116e82335908d84250f1576647be9ec43e3fd49227c181b88e8a1b2024b0d WHIRLPOOL 6f4b67237495a42f4495ab815b332bf13ca37df612bc6b96b89ebe84f208335acd7940f9c4ce09953f4dd4e48f75ae22eaf181c90e861e6ae9364a7e1f93382c
37 +AUX 4.0.2-no-libelf.patch 555 SHA256 56cc1f7b2d02ba230501c7c87da170fa791639cb1f36b2b0b87d8644e5372059 SHA512 384446f2e99e2f13bc10e1805c35a97fa83b78a5a2e64d18f5499f60053ac4bdc02ec3d64a14e2bd143c524c333c1179a0731c801eec4f7311e926ccbfeef661 WHIRLPOOL 4ce057418c587d93e6ee77a1e8c301eacd5ed24fb3639b3000dac0540a1c945d2057ff9745de980913434158768d80c9aef7b8350621fccc3057d24ebfb3aade
38 +AUX 4.0.2-no-pty.patch 392 SHA256 edc29bc7b7bea89c2f937ca9c95f2ce51b437e4ea042741d9f4ac6d7954178d5 SHA512 91ec6bc1f14636450492cbf4ab7dc5c0ecbbf1a7da6c3832798d9f5bc96c39e5c12f49f3ac7aa5b929956d2292a0f4d24f3d71017d29c5493cbf21607555c9a8 WHIRLPOOL 8869101f1ba94e660a140032bd3bcfa9fc857a76f477d44692a433d0cb27218909d68a936d634e87f628145c2b47bc22efabeabdc290e2ea622d265917093b71
39 +AUX 4.0.2-no-utempter.patch 440 SHA256 cc0178fb86971c0975e3d6d60677f2ad3a393ea126790dc5d56f566c42ebe384 SHA512 f506ae6f58b33040b406a4b3a18e40f1092da749ac96b4919ceb612608585fb29a87a3d8dca40e71bbf2c8c2a4c7e217a06e61e130a2356757759bf25e2219c6 WHIRLPOOL 205ab728570609883457136a95508f1ef57481f8e561c6d4d4c15f1bb316c3f0d18a61951b4c5c8b35d45ac6c5516c83b7738f776dd2b2f3f221f657b1480ad9
40 +AUX 4.0.2-nonblock.patch 423 SHA256 4a5f1666d7f680a9a8157969318b525bc08885ef673000e902c8ffc23ef49159 SHA512 138545a208c8c9df4b915baaecb9f8d3c8d71af970dc6e562ab37c12c78507fe471adca13b6625ef659765971959f1e15814a44a0ef74a2f6f533b3327364b4d WHIRLPOOL 3b5f3bde1fbb203c3668427c87aa60465019ba79ba20ce0b61d1a59ae0b140270541825fec306734b8d8114c491235c8ee3bb1f6200d8cb5c1bccdb115cbc5b9
41 +AUX 4.0.2-windowlist-multiuser-fix.patch 491 SHA256 edec52981859cfad0a2d780352405dc7575ad7901bc101d25e95baccf1060cc7 SHA512 095c58f4b21775965c4618553be35aacad832eb563e91fa4210a2f4f2d73e020870611354b9958cd876669a7f1fdc76c04989a567836638c09c8c18e64bed570 WHIRLPOOL 97b2637630c16f91a7228716b961a1ad5e4ee322c7cad01368cce1bc729af5bfdb3040396e2313be07acf4f695f1fe058c473a4d8f7dede211df44118ab72cf2
42 +AUX 4.0.3-extend-d_termname-ng2.patch 5136 SHA256 e87caeab9c4dfc59816c0faf237f26704e63079f8576b93f26029a9e7b550102 SHA512 b2c6488f022472c9b1db6490b73771d26f19c3c824ce082d8834a9453a06afa8dea5a64f11d2b3617c8c7b03a559f85accb5eb76a8c75ea2ca802b624564e8c5 WHIRLPOOL 67847b9ae86519bc2c2cdffdba83e07873d093fc59e977fd516eb5d2e8d2ceb68161d0fbe7df697a3bbcd1f76a6edd34759c232fc459ede61116fdbfb9056ab0
43 +AUX screen-4.0.1-int-overflow-fix.patch 930 SHA256 fe495d43c367082099cfcb890c7b66629d2ad656a7a15fee6fcd60884abee7d0 SHA512 cb678fb3b879ff61b79995f8a63aa7c84639c1daa4150abb527769c8e6f3dd993f3b0d126b71e60ecea1050bfa1bfc6d1c4756fc4f280ee01143ab8d6caa283b WHIRLPOOL ff0a6668b3531557584af3742a62179bdbb3e2adee1279761e9e4f4e2e6ec37c0107aec2279a679aacd3a6e745551124339611b0bd8202aab7e678e12c060491
44 +AUX screen-4.0.1-vsprintf.patch 480 SHA256 34d2f9d6101555fbc37e983542f3db549ea96ede89c7d87c21c69b7331d9c3cd SHA512 f221b84bb753538871000e545610f0b5d5bb221dfe4f963cea8f2ba195d90fc6d217d45bd82081247be2e5307b125225635bee27a618ae570bf2bc097e241871 WHIRLPOOL ed62e461f50bb8c0c14f5221a4beb525dd1fa8ae0cdc370e0a90cd82bb252b8f64d0ee6f617ced90063c70751bf69b9778200982276d16d7db50f586177ed29c
45 +AUX screen-4.0.3-config.h-autoconf-2.62.patch 388 SHA256 71897394211d9e00e008f7c34b3a37bff0cfa54bcfa31a23e849c7021471ca2f SHA512 e08abcdd2f339012cb53f953b1963021614c2de0626f2b23deadc7335f8b0b76138a9f3aa259b86b4fdf740619bf4416cd17cd0e88b97f2578e1ec4b26f736f5 WHIRLPOOL c0aec99c177dad57d506b6cc1b23333313767fa74342a1f1e1949392c8ebdeb4f444eb9f5e75afdd399b10cfbf0c3c58eaf3737fff1eb4bbbef8418f508dcb5b
46 +AUX screen-4.0.3-cppflags.patch 752 SHA256 40f4c4321170096984466665e3af9aead03490de521205da61a8d31d04cf718d SHA512 92c42ed8d9c2a9ee539784b2fb43119968bdce5b6cd371d82bcf21d9c12f9fd1353ae9630ee1bce3ed73c1528d7bdee64abd4fd1919aaf5ecd412c895ce4a3b4 WHIRLPOOL 8e7c2ef2b4d019cd8820a72660cee8614d0490c65c6ffa85a7c161753cae6f13ebf053623db33685d4cf15af53fbd894dfd224b0a5896d823f6ac165eb20e085
47 +AUX screen-4.0.3-crosscompile.patch 18900 SHA256 7e4109cd3f6d58ea799fe069472a58f16ea75c2397392c15f58bfcb7cbb354f9 SHA512 9d34d6245d50f0ea84735cad7148b2c6af70709efc788fe9113752081a05138172acc4d6dc33c87ac71739dead1338000b9bd64978c0edf3c44d9ead92487afb WHIRLPOOL 037ec13508ec669791fda248d4a056abb54c1d9aa6893ddcb8aa4785365231b8c4aea46e07cd5367853039c0876cc8e1ee18df4952d9aa3168806eea9f994846
48 +AUX screen-4.0.3-fbsd.patch 1726 SHA256 90e97fbf728240e828fa2c792fdd0d7d3b6fc5045977df232ba15a9dd3e55633 SHA512 b5d604c29d91b8ae6a610f8be91a2864356e0708764d8e2d2589deef7354e3fa07dccf2e81f4fa6c662f9b2a6288f0cef9f3d19145eeb52b29ce0b067c96eed7 WHIRLPOOL f05dbb11ce4d0c278a02e4e5e5c678c95656b13353da21de3afaa225d74a992c3501f56a8ada7b37ad7d3893a7d246691bb6c5769c1d700f30b58e551b633616
49 +AUX screen-4.0.3-setenv_autoconf.patch 2485 SHA256 091eb224a097bbc1b5f1b3dd8048dbb04b8c7476818a9444eae5bdb8b52bce75 SHA512 72dcfd9180d05edf85ce9f459e69ccd709a6c0a4593802d0f4e88ffe2daf56215ce8049a641701693dafeab3cc8a0df796338d92338ee0d39c51d46ed718af7b WHIRLPOOL fa7645c3488f75c8acdb2305864459e3eada89e7a29e39a6048cdda7459c707b090c68ce93023a53c57a7beabb3c66f9f9f26237126e68d00cc888a7581b867c
50 +AUX screenrc 10409 SHA256 f2fbb2de649df9d6b0afbb913d002eb7fdabec5525930515452c286dffcde072 SHA512 32783353cadb403999041e184c7c69570869d45793df4aff35c341f222903dab23d7872e24a78dcf84d82d636890950ad2719614c5475d7084f58769a24e8e71 WHIRLPOOL 3d1a75bcaad7870637dee9c4549062ffcddfd6be614e73e786d166b45f82b35a7f5311d9a60060a7d38afa96264b8eed3719f23244fc3799b7f8fe6ca774a754
51 +DIST screen-4.0.3.tar.gz 840602 SHA256 78f0d5b1496084a5902586304d4a73954b2bfe33ea13edceecf21615c39e6c77 SHA512 24c1f598972f3dc9ed49cd2c05852190a0190d22fa01401eee8484627c8dd2815f0a422d9b2697faa8aaa0b3efc6730a94e2d5aa787dbe5e9ec719143176c338 WHIRLPOOL 6774786126eb05749d432593bc2c1febdc57896959220a609feb138bdc16b8da278aea63af1ccfd5c7d38ccaa9e7d28980e9e14d0009d36a54cdbd9e4cb0fca7
52 +EBUILD screen-4.0.3-r7.ebuild 4725 SHA256 6fc348d5d78e676f75ad063ebdaca3955fb364f1cb5febb165c7a8715d656499 SHA512 3a650aef3ee4a7e617e3565196afdbff201e63b28294d1ceef7aebe9970b0128d07dc1b8939dc470db25704d90cfa97766d0b86e5f42bebea237e9b01570cb23 WHIRLPOOL f03eeea25dba3dd8dfb099d16e578bc758197d92f4aa0f05ab872483442300ee4a1b7fbdeb6201c738c096f8592a78ff552cb13fa36845e55ff6e485ab0f96bf
53
54 diff --git a/app-misc/screen/files/4.0.2-64bit-time.patch b/app-misc/screen/files/4.0.2-64bit-time.patch
55 new file mode 100644
56 index 0000000..645b37f
57 --- /dev/null
58 +++ b/app-misc/screen/files/4.0.2-64bit-time.patch
59 @@ -0,0 +1,11 @@
60 +--- utmp.c.orig 2004-11-14 23:15:28.000000000 +0100
61 ++++ utmp.c 2004-11-14 23:15:39.000000000 +0100
62 +@@ -618,7 +618,7 @@
63 + #endif /* sgi */
64 + strncpy(u->ut_line, line, sizeof(u->ut_line));
65 + u->ut_pid = pid;
66 +- (void)time((time_t *)&u->ut_time);
67 ++ u->ut_time = time(NULL);
68 + }
69 +
70 + static slot_t
71
72 diff --git a/app-misc/screen/files/4.0.2-no-libelf.patch b/app-misc/screen/files/4.0.2-no-libelf.patch
73 new file mode 100644
74 index 0000000..df06383
75 --- /dev/null
76 +++ b/app-misc/screen/files/4.0.2-no-libelf.patch
77 @@ -0,0 +1,18 @@
78 +--- screen-4.0.2/configure.in 2005-05-22 19:55:06.559874997 +0000
79 ++++ screen-4.0.2-no-libelf/configure.in 2005-05-22 19:56:05.895801017 +0000
80 +@@ -195,15 +195,6 @@
81 + #endif
82 + ], LIBS="$LIBS -lsocket -linet";seqptx=1)
83 +
84 +-oldlibs="$LIBS"
85 +-LIBS="$LIBS -lelf"
86 +-AC_CHECKING(SVR4)
87 +-AC_TRY_LINK([#include <utmpx.h>
88 +-],,
89 +-[AC_CHECK_HEADER(dwarf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN),
90 +-[AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN))])]
91 +-,LIBS="$oldlibs")
92 +-
93 + AC_CHECKING(for Solaris 2.x)
94 + AC_EGREP_CPP(yes,
95 + [#if defined(SVR4) && defined(sun)
96
97 diff --git a/app-misc/screen/files/4.0.2-no-pty.patch b/app-misc/screen/files/4.0.2-no-pty.patch
98 new file mode 100644
99 index 0000000..7b7b798
100 --- /dev/null
101 +++ b/app-misc/screen/files/4.0.2-no-pty.patch
102 @@ -0,0 +1,14 @@
103 +--- screen-4.0.2/pty.c.orig 2004-07-29 23:53:45.313533536 -0400
104 ++++ screen-4.0.2/pty.c 2004-07-29 23:53:59.011451136 -0400
105 +@@ -33,11 +33,6 @@
106 + # include <sys/ioctl.h>
107 + #endif
108 +
109 +-/* for solaris 2.1, Unixware (SVR4.2) and possibly others */
110 +-#ifdef HAVE_SVR4_PTYS
111 +-# include <sys/stropts.h>
112 +-#endif
113 +-
114 + #if defined(sun) && defined(LOCKPTY) && !defined(TIOCEXCL)
115 + # include <sys/ttold.h>
116 + #endif
117
118 diff --git a/app-misc/screen/files/4.0.2-no-utempter.patch b/app-misc/screen/files/4.0.2-no-utempter.patch
119 new file mode 100644
120 index 0000000..2a06119
121 --- /dev/null
122 +++ b/app-misc/screen/files/4.0.2-no-utempter.patch
123 @@ -0,0 +1,14 @@
124 +--- screen-4.0.2/configure.in.orig 2004-12-17 19:55:45.314670411 +0100
125 ++++ screen-4.0.2/configure.in 2004-12-17 19:55:50.575941541 +0100
126 +@@ -855,11 +855,6 @@
127 + #include <utmp.h>
128 + #endif
129 + ],[struct utmp u; u.ut_host[0] = 0;], AC_DEFINE(UTHOST))
130 +-AC_CHECK_HEADER(utempter.h, have_utempter=yes, have_utempter=no)
131 +-if test "$have_utempter" = yes; then
132 +- AC_DEFINE(HAVE_UTEMPTER)
133 +- LIBS="$LIBS -lutempter"
134 +-fi
135 +
136 + dnl
137 + dnl **** loadav ****
138
139 diff --git a/app-misc/screen/files/4.0.2-nonblock.patch b/app-misc/screen/files/4.0.2-nonblock.patch
140 new file mode 100644
141 index 0000000..f27c903
142 --- /dev/null
143 +++ b/app-misc/screen/files/4.0.2-nonblock.patch
144 @@ -0,0 +1,11 @@
145 +--- screen.c.orig 2006-04-02 17:05:28.000000000 +0200
146 ++++ screen.c 2006-04-02 17:05:39.000000000 +0200
147 +@@ -1197,7 +1197,7 @@ char **av;
148 + if (!detached)
149 + {
150 + /* reopen tty. must do this, because fd 0 may be RDONLY */
151 +- if ((n = secopen(attach_tty, O_RDWR, 0)) < 0)
152 ++ if ((n = secopen(attach_tty, O_RDWR | O_NONBLOCK, 0)) < 0)
153 + Panic(0, "Cannot reopen '%s' - please check.", attach_tty);
154 + }
155 + else
156
157 diff --git a/app-misc/screen/files/4.0.2-windowlist-multiuser-fix.patch b/app-misc/screen/files/4.0.2-windowlist-multiuser-fix.patch
158 new file mode 100644
159 index 0000000..09848e9
160 --- /dev/null
161 +++ b/app-misc/screen/files/4.0.2-windowlist-multiuser-fix.patch
162 @@ -0,0 +1,12 @@
163 +diff -Nur screen-4.0.2.orig/process.c screen-4.0.2/process.c
164 +--- screen-4.0.2.orig/process.c 2003-09-18 14:53:54.000000000 +0200
165 ++++ screen-4.0.2/process.c 2005-07-06 19:55:08.370772955 +0200
166 +@@ -4841,7 +4841,7 @@
167 + s = buf;
168 + for (display = displays; display; display = display->d_next)
169 + {
170 +- if (D_user == olddisplay->d_user)
171 ++ if (olddisplay && D_user == olddisplay->d_user)
172 + continue;
173 + for (cv = D_cvlist; cv; cv = cv->c_next)
174 + if (Layer2Window(cv->c_layer) == p)
175
176 diff --git a/app-misc/screen/files/4.0.3-extend-d_termname-ng2.patch b/app-misc/screen/files/4.0.3-extend-d_termname-ng2.patch
177 new file mode 100644
178 index 0000000..701682f
179 --- /dev/null
180 +++ b/app-misc/screen/files/4.0.3-extend-d_termname-ng2.patch
181 @@ -0,0 +1,203 @@
182 +diff --git a/acls.c b/acls.c
183 +index 0f98df2..5f26d70 100644
184 +--- a/acls.c
185 ++++ b/acls.c
186 +@@ -178,7 +178,7 @@ struct acluser **up;
187 + #endif
188 + (*up)->u_Esc = DefaultEsc;
189 + (*up)->u_MetaEsc = DefaultMetaEsc;
190 +- strncpy((*up)->u_name, name, 20);
191 ++ strncpy((*up)->u_name, name, MAXSTR);
192 + (*up)->u_password = NULL;
193 + if (pass)
194 + (*up)->u_password = SaveStr(pass);
195 +@@ -314,8 +314,8 @@ struct acluser **up;
196 + return UserAdd(name, pass, up);
197 + if (!strcmp(name, "nobody")) /* he remains without password */
198 + return -1;
199 +- strncpy((*up)->u_password, pass ? pass : "", 20);
200 +- (*up)->u_password[20] = '\0';
201 ++ strncpy((*up)->u_password, pass ? pass : "", MAXSTR);
202 ++ (*up)->u_password[MAXSTR] = '\0';
203 + return 0;
204 + }
205 + #endif
206 +diff --git a/acls.h b/acls.h
207 +index c41b714..7f20f55 100644
208 +--- a/acls.h
209 ++++ b/acls.h
210 +@@ -36,6 +36,16 @@
211 + #define ACLBYTE(data, w) ((data)[(w) >> 3])
212 + #define ACLBIT(w) (0x80 >> ((w) & 7))
213 +
214 ++#include <limits.h>
215 ++
216 ++#ifndef NAME_MAX
217 ++# ifndef MAXNAMELEN
218 ++# define NAME_MAX 255
219 ++# else
220 ++# define NAME_MAX MAXNAMELEN
221 ++# endif
222 ++#endif
223 ++
224 + typedef unsigned char * AclBits;
225 +
226 + /*
227 +@@ -73,7 +83,7 @@ struct plop
228 + typedef struct acluser
229 + {
230 + struct acluser *u_next; /* continue the main user list */
231 +- char u_name[20+1]; /* login name how he showed up */
232 ++ char u_name[NAME_MAX+1]; /* login name how he showed up */
233 + char *u_password; /* his password (may be NullStr). */
234 + int u_checkpassword; /* nonzero if this u_password is valid */
235 + int u_detachwin; /* the window where he last detached */
236 +diff --git a/display.h b/display.h
237 +index ef99954..563fcd0 100644
238 +--- a/display.h
239 ++++ b/display.h
240 +@@ -22,6 +22,16 @@
241 + * $Id: 4.0.3-extend-d_termname-ng2.patch,v 1.2 2010/12/08 21:28:15 jlec Exp $ FAU
242 + */
243 +
244 ++#include <limits.h>
245 ++
246 ++#ifndef NAME_MAX
247 ++# ifndef MAXNAMELEN
248 ++# define NAME_MAX 255
249 ++# else
250 ++# define NAME_MAX MAXNAMELEN
251 ++# endif
252 ++#endif
253 ++
254 + #ifdef MAPKEYS
255 +
256 + #define KMAP_KEYS (T_OCAPS-T_CAPS)
257 +@@ -85,7 +95,7 @@ struct display
258 + struct win *d_other; /* pointer to other window */
259 + int d_nonblock; /* -1 don't block if obufmax reached */
260 + /* >0: block after nonblock secs */
261 +- char d_termname[20 + 1]; /* $TERM */
262 ++ char d_termname[NAME_MAX + 1]; /* $TERM */
263 + char *d_tentry; /* buffer for tgetstr */
264 + char d_tcinited; /* termcap inited flag */
265 + int d_width, d_height; /* width/height of the screen */
266 +diff --git a/screen.c b/screen.c
267 +index 70741df..6f45b60 100644
268 +--- a/screen.c
269 ++++ b/screen.c
270 +@@ -106,6 +106,16 @@ FILE *dfp;
271 + #endif
272 +
273 +
274 ++#include <limits.h>
275 ++
276 ++#ifndef NAME_MAX
277 ++# ifndef MAXNAMELEN
278 ++# define NAME_MAX 255
279 ++# else
280 ++# define NAME_MAX MAXNAMELEN
281 ++# endif
282 ++#endif
283 ++
284 + extern char Term[], screenterm[], **environ, Termcap[];
285 + int force_vt = 1;
286 + int VBellWait, MsgWait, MsgMinWait, SilenceWait;
287 +@@ -877,13 +887,13 @@ char **av;
288 +
289 + if (home == 0 || *home == '\0')
290 + home = ppp->pw_dir;
291 +- if (strlen(LoginName) > 20)
292 ++ if (strlen(LoginName) > NAME_MAX)
293 + Panic(0, "LoginName too long - sorry.");
294 + #ifdef MULTIUSER
295 +- if (multi && strlen(multi) > 20)
296 ++ if (multi && strlen(multi) > NAME_MAX)
297 + Panic(0, "Screen owner name too long - sorry.");
298 + #endif
299 +- if (strlen(home) > MAXPATHLEN - 25)
300 ++ if (strlen(home) > MAXPATHLEN - NAME_MAX)
301 + Panic(0, "$HOME too long - sorry.");
302 +
303 + attach_tty = "";
304 +diff --git a/screen.h b/screen.h
305 +index 4f9f354..bcaaaf6 100644
306 +--- a/screen.h
307 ++++ b/screen.h
308 +@@ -43,6 +43,15 @@
309 + #include "comm.h"
310 + #include "layer.h"
311 + #include "term.h"
312 ++#include <limits.h>
313 ++
314 ++#ifndef NAME_MAX
315 ++# ifndef MAXNAMELEN
316 ++# define NAME_MAX 255
317 ++# else
318 ++# define NAME_MAX MAXNAMELEN
319 ++# endif
320 ++#endif
321 +
322 +
323 + #ifdef DEBUG
324 +@@ -195,26 +204,26 @@ struct msg
325 + create;
326 + struct
327 + {
328 +- char auser[20 + 1]; /* username */
329 ++ char auser[NAME_MAX + 1]; /* username */
330 + int apid; /* pid of frontend */
331 + int adaptflag; /* adapt window size? */
332 + int lines, columns; /* display size */
333 + char preselect[20];
334 + int esc; /* his new escape character unless -1 */
335 + int meta_esc; /* his new meta esc character unless -1 */
336 +- char envterm[20 + 1]; /* terminal type */
337 ++ char envterm[NAME_MAX + 1]; /* terminal type */
338 + int encoding; /* encoding of display */
339 + }
340 + attach;
341 + struct
342 + {
343 +- char duser[20 + 1]; /* username */
344 ++ char duser[NAME_MAX + 1]; /* username */
345 + int dpid; /* pid of frontend */
346 + }
347 + detach;
348 + struct
349 + {
350 +- char auser[20 + 1]; /* username */
351 ++ char auser[NAME_MAX + 1]; /* username */
352 + int nargs;
353 + char cmd[MAXPATHLEN]; /* command */
354 + int apid; /* pid of frontend */
355 +diff --git a/socket.c b/socket.c
356 +index 62a73af..1cc9c27 100644
357 +--- a/socket.c
358 ++++ b/socket.c
359 +@@ -45,6 +45,16 @@
360 +
361 + #include "extern.h"
362 +
363 ++#include <limits.h>
364 ++
365 ++#ifndef NAME_MAX
366 ++# ifndef MAXNAMELEN
367 ++# define NAME_MAX 255
368 ++# else
369 ++# define NAME_MAX MAXNAMELEN
370 ++# endif
371 ++#endif
372 ++
373 + static int CheckPid __P((int));
374 + static void ExecCreate __P((struct msg *));
375 + static void DoCommandMsg __P((struct msg *));
376 +@@ -1248,7 +1258,7 @@ static void PasswordProcessInput __P((char *, int));
377 +
378 + struct pwdata {
379 + int l;
380 +- char buf[20 + 1];
381 ++ char buf[NAME_MAX + 1];
382 + struct msg m;
383 + };
384 +
385
386 diff --git a/app-misc/screen/files/screen-4.0.1-int-overflow-fix.patch b/app-misc/screen/files/screen-4.0.1-int-overflow-fix.patch
387 new file mode 100644
388 index 0000000..4a40c8d
389 --- /dev/null
390 +++ b/app-misc/screen/files/screen-4.0.1-int-overflow-fix.patch
391 @@ -0,0 +1,31 @@
392 +--- ansi.c.orig 2003-09-08 10:24:44.000000000 -0400
393 ++++ ansi.c 2003-11-29 10:41:15.000000000 -0500
394 +@@ -559,7 +559,7 @@
395 + {
396 + case '0': case '1': case '2': case '3': case '4':
397 + case '5': case '6': case '7': case '8': case '9':
398 +- if (curr->w_NumArgs < MAXARGS)
399 ++ if (curr->w_NumArgs >= 0 && curr->w_NumArgs < MAXARGS)
400 + {
401 + if (curr->w_args[curr->w_NumArgs] < 100000000)
402 + curr->w_args[curr->w_NumArgs] =
403 +--- resize.c.orig 2003-09-08 10:26:31.000000000 -0400
404 ++++ resize.c 2003-11-29 10:41:50.000000000 -0500
405 +@@ -682,6 +682,17 @@
406 + if (wi == 0)
407 + he = hi = 0;
408 +
409 ++ if (wi > 1000)
410 ++ {
411 ++ Msg(0, "Window width too large, truncated");
412 ++ wi = 1000;
413 ++ }
414 ++ if (he > 1000)
415 ++ {
416 ++ Msg(0, "Window height too large, truncated");
417 ++ he = 1000;
418 ++ }
419 ++
420 + if (p->w_width == wi && p->w_height == he && p->w_histheight == hi)
421 + {
422 + debug("ChangeWindowSize: No change.\n");
423
424 diff --git a/app-misc/screen/files/screen-4.0.1-vsprintf.patch b/app-misc/screen/files/screen-4.0.1-vsprintf.patch
425 new file mode 100644
426 index 0000000..b2f7a20
427 --- /dev/null
428 +++ b/app-misc/screen/files/screen-4.0.1-vsprintf.patch
429 @@ -0,0 +1,13 @@
430 +--- screen-4.0.1/configure.in 2003-06-03 07:58:24.000000000 -0400
431 ++++ screen-4.0.1/configure.in.agriffis 2004-01-13 12:07:37.000000000 -0500
432 +@@ -1206,7 +1206,9 @@
433 + rm -f /tmp/conftest*
434 +
435 + AC_MSG_CHECKING(for vsprintf)
436 +-AC_TRY_LINK(,[vsprintf(0,0,0);], AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS), AC_MSG_RESULT(no))
437 ++AC_TRY_LINK([#include <stdarg.h>],[va_list valist; vsprintf(0,0,valist);],
438 ++ [AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS)],
439 ++ [AC_MSG_RESULT(no)])
440 +
441 + AC_HEADER_DIRENT
442 +
443
444 diff --git a/app-misc/screen/files/screen-4.0.3-config.h-autoconf-2.62.patch b/app-misc/screen/files/screen-4.0.3-config.h-autoconf-2.62.patch
445 new file mode 100644
446 index 0000000..5605fda
447 --- /dev/null
448 +++ b/app-misc/screen/files/screen-4.0.3-config.h-autoconf-2.62.patch
449 @@ -0,0 +1,14 @@
450 +compability for sys-devel/autoconf-2.62
451 +
452 +https://bugs.gentoo.org/show_bug.cgi?id=217311
453 +
454 +--- screen/config.h.in
455 ++++ screen/config.h.in
456 +@@ -563,7 +563,6 @@
457 + * If you are on a SYS V machine that restricts filename length to 14
458 + * characters, you may need to enforce that by setting NAME_MAX to 14
459 + */
460 +-#undef NAME_MAX /* KEEP_UNDEF_HERE override system value */
461 + #undef NAME_MAX
462 +
463 + /*
464
465 diff --git a/app-misc/screen/files/screen-4.0.3-cppflags.patch b/app-misc/screen/files/screen-4.0.3-cppflags.patch
466 new file mode 100644
467 index 0000000..ee3455f
468 --- /dev/null
469 +++ b/app-misc/screen/files/screen-4.0.3-cppflags.patch
470 @@ -0,0 +1,20 @@
471 +--- screen-4.0.3/Makefile.in
472 ++++ screen-4.0.3/Makefile.in
473 +@@ -68,7 +68,7 @@
474 + $(CC) $(LDFLAGS) -o $@ $(OFILES) $(LIBS)
475 +
476 + .c.o:
477 +- $(CC) -c -I. -I$(srcdir) $(M_CFLAGS) $(DEFS) $(OPTIONS) $(CFLAGS) $<
478 ++ $(CC) -c -I. -I$(srcdir) $(M_CFLAGS) $(DEFS) $(OPTIONS) $(CPPFLAGS) $(CFLAGS) $<
479 +
480 + install_bin: .version screen
481 + -if [ -f $(DESTDIR)$(bindir)/$(SCREEN) ] && [ ! -f $(DESTDIR)$(bindir)/$(SCREEN).old ]; \
482 +@@ -122,7 +122,7 @@
483 + sh $(srcdir)/tty.sh tty.c
484 +
485 + comm.h: comm.c comm.sh config.h
486 +- AWK=$(AWK) CC="$(CC) $(CFLAGS)" srcdir=${srcdir} sh $(srcdir)/comm.sh
487 ++ AWK=$(AWK) CC="$(CC) $(CFLAGS) $(CPPFLAGS)" srcdir=${srcdir} sh $(srcdir)/comm.sh
488 +
489 + osdef.h: osdef.sh config.h osdef.h.in
490 + CPP="$(CPP) $(CPPFLAGS)" srcdir=${srcdir} sh $(srcdir)/osdef.sh
491
492 diff --git a/app-misc/screen/files/screen-4.0.3-crosscompile.patch b/app-misc/screen/files/screen-4.0.3-crosscompile.patch
493 new file mode 100644
494 index 0000000..6e6bb94
495 --- /dev/null
496 +++ b/app-misc/screen/files/screen-4.0.3-crosscompile.patch
497 @@ -0,0 +1,598 @@
498 +--- configure.in~ 2008-11-23 17:43:48.000000000 +0000
499 ++++ configure.in 2008-11-23 17:43:48.000000000 +0000
500 +@@ -46,6 +46,7 @@
501 + AC_PROG_GCC_TRADITIONAL
502 + AC_ISC_POSIX
503 +
504 ++AC_MSG_CHECKING([for compiler sanity])
505 + AC_TRY_RUN(main(){exit(0);},,[
506 + if test $CC != cc ; then
507 + AC_NOTE(Your $CC failed - restarting with CC=cc)
508 +@@ -54,22 +55,17 @@
509 + export CC
510 + exec $0 $configure_args
511 + fi
512 +-])
513 +-
514 +-AC_TRY_RUN(main(){exit(0);},,
515 +-exec 5>&2
516 +-eval $ac_link
517 +-AC_NOTE(CC=$CC; CFLAGS=$CFLAGS; LIBS=$LIBS;)
518 +-AC_NOTE($ac_compile)
519 +-AC_MSG_ERROR(Can't run the compiler - sorry))
520 ++],AC_MSG_WARN([skipping test due to crosscompilation]))
521 +
522 ++AC_MSG_CHECKING([if compiler sets exit status])
523 + AC_TRY_RUN([
524 + main()
525 + {
526 + int __something_strange_();
527 + __something_strange_(0);
528 + }
529 +-],AC_MSG_ERROR(Your compiler does not set the exit status - sorry))
530 ++],AC_MSG_ERROR(Your compiler does not set the exit status - sorry),,
531 ++AC_MSG_WARN(skipping test due to crosscompilation))
532 +
533 + AC_PROG_AWK
534 +
535 +@@ -103,6 +99,7 @@
536 + dnl
537 + dnl **** special unix variants ****
538 + dnl
539 ++AH_TEMPLATE(ISC,[])
540 + if test -n "$ISC"; then
541 + AC_DEFINE(ISC) LIBS="$LIBS -linet"
542 + fi
543 +@@ -114,11 +111,13 @@
544 + dnl fi
545 + dnl fi
546 +
547 ++AH_TEMPLATE([sysV68],[])
548 + if test -f /sysV68 ; then
549 + AC_DEFINE(sysV68)
550 + fi
551 +
552 + AC_CHECKING(for MIPS)
553 ++AH_TEMPLATE([MIPS],[])
554 + if test -f /lib/libmld.a || test -f /usr/lib/libmld.a || test -f /usr/lib/cmplrs/cc/libmld.a; then
555 + oldlibs="$LIBS"
556 + test -f /bin/mx || LIBS="$LIBS -lmld" # for nlist. But not on alpha.
557 +@@ -132,6 +131,8 @@
558 + AC_CHECKING(wait3)
559 + AC_TRY_LINK(,[wait3();], ,
560 + AC_CHECKING(wait2)
561 ++AH_TEMPLATE([USE_WAIT2],[On RISCOS we prefer wait2() over wait3(). rouilj@×××××××.com])
562 ++dnl TODO(Hannes) shipped config.h.in wraps the define in #ifdef BSDWAIT
563 + AC_TRY_LINK(,[wait2();],
564 + dnl John Rouillard (rouilj@×××××××.com):
565 + dnl need -I/usr/include/bsd in RISCOS otherwise sockets are broken, no
566 +@@ -154,9 +155,11 @@
567 + oldlibs="$LIBS"
568 + LIBS="$LIBS -lpyr"
569 + AC_CHECKING(Pyramid OSX)
570 ++AH_TEMPLATE([OSX], [Pyramid OSX])
571 + AC_TRY_LINK(,[open_controlling_pty("")], AC_DEFINE(OSX), LIBS="$oldlibs")
572 + fi
573 +
574 ++AH_TEMPLATE([POSIX],[Define POSIX if your system supports IEEE Std 1003.1-1988 (POSIX).])
575 + dnl ghazi@××××××××××××.edu (Kaveh R. Ghazi):
576 + dnl BBN butterfly is not POSIX, but a MACH BSD system.
577 + dnl Do not define POSIX and TERMIO.
578 +@@ -183,6 +186,7 @@
579 + fi
580 +
581 + AC_CHECKING(for System V)
582 ++AH_TEMPLATE([SYSV], [Define SYSV if your machine is SYSV complient (Sys V, HPUX, A/UX)])
583 + AC_TRY_COMPILE(
584 + [#include <sys/types.h>
585 + #include <signal.h>
586 +@@ -226,6 +230,9 @@
587 + dnl
588 +
589 + AC_CHECKING(BSD job jontrol)
590 ++AH_TEMPLATE([BSDJOBS],
591 ++[Define BSDJOBS if you have BSD-style job control (both process
592 ++ groups and a tty that deals correctly with them)])
593 + AC_TRY_LINK(
594 + [#include <sys/types.h>
595 + #include <sys/ioctl.h>
596 +@@ -246,6 +253,10 @@
597 + dnl **** setreuid(), seteuid() ****
598 + dnl
599 + AC_CHECKING(setreuid)
600 ++AH_TEMPLATE([HAVE_SETREUID],
601 ++[If your system has the calls setreuid() and setregid(),
602 ++ define HAVE_SETREUID. Otherwise screen will use a forked process to
603 ++ safely create output files without retaining any special privileges.])
604 + AC_TRY_LINK(,[
605 + #ifdef __hpux
606 + setresuid(0, 0, 0);
607 +@@ -260,6 +271,9 @@
608 + dnl Solaris seteuid doesn't change the saved uid, bad for
609 + dnl multiuser screen sessions
610 + AC_CHECKING(seteuid)
611 ++AH_TEMPLATE([HAVE_SETEUID],
612 ++[If your system supports BSD4.4's seteuid() and setegid(), define
613 ++ HAVE_SETEUID.])
614 + AC_TRY_LINK(,[
615 + #if defined(linux) || defined(NeXT) || defined(_AUX_SOURCE) || defined(AUX) || defined(ultrix) || (defined(sun) && defined(SVR4)) || defined(ISC) || defined(sony_news)
616 + seteuid_is_broken(0);
617 +@@ -284,6 +298,8 @@
618 + dnl
619 +
620 + AC_CHECKING(fifos)
621 ++AC_CACHE_CHECK([usable fifos],
622 ++ [screen_cv_sys_fifo_usable],
623 + AC_TRY_RUN([
624 + #include <sys/types.h>
625 + #include <sys/stat.h>
626 +@@ -348,12 +364,15 @@
627 + exit(1);
628 + exit(0);
629 + }
630 +-], AC_NOTE(- your fifos are usable) fifo=1,
631 +-AC_NOTE(- your fifos are not usable))
632 ++], screen_cv_sys_fifo_usable=yes, screen_cv_sys_fifo_usable=no))
633 + rm -f /tmp/conftest*
634 +
635 +-if test -n "$fifo"; then
636 +-AC_CHECKING(for broken fifo implementation)
637 ++if test X"$screen_cv_sys_fifo_usable" = Xyes; then
638 ++AH_TEMPLATE([BROKEN_PIPE],
639 ++[Define this if your system exits select() immediatly if a pipe is
640 ++ opened read-only and no writer has opened it.])
641 ++AC_CACHE_CHECK([broken fifo implementation],
642 ++ [screen_cv_sys_fifo_broken_impl],
643 + AC_TRY_RUN([
644 + #include <sys/types.h>
645 + #include <fcntl.h>
646 +@@ -398,9 +416,12 @@
647 + exit(1);
648 + exit(0);
649 + }
650 +-], AC_NOTE(- your implementation is ok),
651 +-AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1)
652 ++], screen_cv_sys_fifo_broken_impl=no,
653 ++screen_cv_sys_fifo_broken_impl=yes))
654 ++if test X"$screen_cv_sys_fifo_broken_impl" = Xyes; then
655 ++ AC_DEFINE(BROKEN_PIPE)
656 ++fi
657 + rm -f /tmp/conftest*
658 + fi
659 +
660 + dnl
661 +@@ -410,6 +430,8 @@
662 + dnl
663 +
664 + AC_CHECKING(sockets)
665 ++AC_CACHE_CHECK([sockets are usable],
666 ++ [screen_cv_sys_sockets_usable],
667 + AC_TRY_RUN([
668 + #include <sys/types.h>
669 + #include <sys/socket.h>
670 +@@ -460,12 +482,16 @@
671 + exit(1);
672 + exit(0);
673 + }
674 +-], AC_NOTE(- your sockets are usable) sock=1,
675 +-AC_NOTE(- your sockets are not usable))
676 +-rm -f /tmp/conftest*
677 ++], screen_cv_sys_sockets_usable=yes,
678 ++screen_cv_sys_sockets_usable=no))
679 +
680 +-if test -n "$sock"; then
681 ++if test X"$screen_cv_sys_sockets_usable" = Xyes; then
682 + AC_CHECKING(socket implementation)
683 ++AH_TEMPLATE([SOCK_NOT_IN_FS],
684 ++[Define this if the unix-domain socket implementation doesn't
685 ++ create a socket in the filesystem.])
686 ++AC_CACHE_CHECK([if sockets are not stored in the filesystem],
687 ++ [screen_cv_sys_sockets_nofs],
688 + AC_TRY_RUN([
689 + #include <sys/types.h>
690 + #include <sys/stat.h>
691 +@@ -491,22 +517,25 @@
692 + close(s);
693 + exit(0);
694 + }
695 +-],AC_NOTE(- you are normal),
696 +-AC_NOTE(- unix domain sockets are not kept in the filesystem)
697 +-AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1)
698 +-rm -f /tmp/conftest*
699 ++], screen_cv_sys_sockets_nofs=no,
700 ++screen_cv_sys_sockets_nofs=yes))
701 ++
702 ++if test X"$screen_cv_sys_sockets_nofs" = Xyes; then
703 ++ AC_DEFINE(SOCK_NOT_IN_FS)
704 ++fi
705 + fi
706 +
707 +
708 + dnl
709 + dnl **** choose sockets or fifos ****
710 + dnl
711 +-if test -n "$fifo"; then
712 +- if test -n "$sock"; then
713 +- if test -n "$nore"; then
714 ++AH_TEMPLATE([NAMEDPIPE], [Define this if your system supports named pipes.])
715 ++if test X"$screen_cv_sys_fifo_usable" = Xyes; then
716 ++ if test X"$screen_cv_sys_sockets_usable" = Xyes; then
717 ++ if test X"$screen_cv_sys_sockets_nofs" = Xyes; then
718 + AC_NOTE(- hmmm... better take the fifos)
719 + AC_DEFINE(NAMEDPIPE)
720 +- elif test -n "$fifobr"; then
721 ++ elif test X"$screen_cv_sys_fifo_broken_impl" = Xyes; then
722 + AC_NOTE(- as your fifos are broken lets use the sockets.)
723 + else
724 + AC_NOTE(- both sockets and fifos usable. let's take fifos.)
725 +@@ -516,7 +545,7 @@
726 + AC_NOTE(- using named pipes, of course)
727 + AC_DEFINE(NAMEDPIPE)
728 + fi
729 +-elif test -n "$sock"; then
730 ++elif test X"$screen_cv_sys_sockets_usable" = Xyes; then
731 + AC_NOTE(- using unix-domain sockets, of course)
732 + else
733 + AC_MSG_ERROR(you have neither usable sockets nor usable pipes -> no screen)
734 +@@ -526,7 +555,11 @@
735 + dnl **** check the select implementation ****
736 + dnl
737 +
738 +-AC_CHECKING(select return value)
739 ++AH_TEMPLATE([SELECT_BROKEN],
740 ++[If the select return value doesn't treat a descriptor that is
741 ++ usable for reading and writing as two hits, define SELECT_BROKEN.])
742 ++AC_CACHE_CHECK([for broken select return value],
743 ++ [screen_cv_sys_select_broken_retval],
744 + AC_TRY_RUN([
745 + #include <sys/types.h>
746 + #include <sys/stat.h>
747 +@@ -625,17 +658,26 @@
748 + exit(1);
749 + exit(0);
750 + }
751 +-],AC_NOTE(- select is ok),
752 +-AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN))
753 ++], screen_cv_sys_select_broken_retval=no,
754 ++screen_cv_sys_select_broken_retval=yes))
755 ++if test X"$screen_cv_sys_select_broken_retval" = Xyes; then
756 ++ AC_DEFINE(SELECT_BROKEN)
757 ++fi
758 +
759 + dnl
760 + dnl **** termcap or terminfo ****
761 + dnl
762 ++AH_TEMPLATE([TERMINFO],
763 ++[Define TERMINFO if your machine emulates the termcap routines
764 ++ with the terminfo database.
765 ++ Thus the .screenrc file is parsed for
766 ++ the command 'terminfo' and not 'termcap'])
767 ++
768 + AC_CHECKING(for tgetent)
769 + AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
770 + olibs="$LIBS"
771 +-LIBS="-lcurses $olibs"
772 + AC_CHECKING(libcurses)
773 ++AC_CHECK_LIB(ncursesw,tgetent)
774 + AC_TRY_LINK(,[
775 + #ifdef __hpux
776 + __sorry_hpux_libcurses_is_totally_broken_in_10_10();
777 +@@ -654,24 +696,39 @@
778 + AC_TRY_LINK(,tgetent((char *)0, (char *)0);,,
779 + AC_MSG_ERROR(!!! no tgetent - no screen))))))
780 +
781 +-AC_TRY_RUN([
782 ++AC_CACHE_CHECK([using terminfo database],[screen_cv_sys_terminfo_used],
783 ++ AC_TRY_RUN([
784 + main()
785 + {
786 + exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
787 +-}], AC_NOTE(- you use the termcap database),
788 +-AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO))
789 ++}
790 ++ ], screen_cv_sys_terminfo_used=no,
791 ++ screen_cv_sys_terminfo_used=yes)
792 ++)
793 ++
794 ++if test X"$screen_cv_sys_terminfo_used" = Xyes; then
795 ++ AC_DEFINE(TERMINFO)
796 ++fi
797 ++
798 + AC_CHECKING(ospeed)
799 ++AH_TEMPLATE([NEED_OSPEED],[If your library does not define ospeed, define this.])
800 + AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
801 +
802 + dnl
803 + dnl **** PTY specific things ****
804 + dnl
805 ++AH_TEMPLATE([HAVE_DEV_PTC],
806 ++[define HAVE_DEV_PTC if you have a /dev/ptc character special
807 ++ device.])
808 + AC_CHECKING(for /dev/ptc)
809 + if test -r /dev/ptc; then
810 + AC_DEFINE(HAVE_DEV_PTC)
811 + fi
812 +
813 + AC_CHECKING(for SVR4 ptys)
814 ++AH_TEMPLATE([HAVE_SVR4_PTYS],
815 ++[define HAVE_SVR4_PTYS if you have a /dev/ptmx character special
816 ++ device and support the ptsname(), grantpt(), unlockpt() functions.])
817 + sysvr4ptys=
818 + if test -c /dev/ptmx ; then
819 + AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],[AC_DEFINE(HAVE_SVR4_PTYS)
820 +@@ -687,6 +744,13 @@
821 + fi
822 +
823 + AC_CHECKING(for ptyranges)
824 ++AH_TEMPLATE([PTYRANGE0],
825 ++[define PTYRANGE0 and or PTYRANGE1 if you want to adapt screen
826 ++ to unusual environments. E.g. For SunOs the defaults are "qpr" and
827 ++ "0123456789abcdef". For SunOs 4.1.2
828 ++ #define PTYRANGE0 "pqrstuvwxyzPQRST"
829 ++ is recommended by Dan Jacobson.])
830 ++AH_TEMPLATE([PTYRANGE1],[])
831 + if test -d /dev/ptym ; then
832 + pdir='/dev/ptym'
833 + else
834 +@@ -850,20 +914,39 @@
835 + dnl
836 + dnl **** loadav ****
837 + dnl
838 ++
839 ++AH_TEMPLATE([LOADAV],
840 ++[If you want the "time" command to display the current load average
841 ++ define LOADAV. Maybe you must install screen with the needed
842 ++ privileges to read /dev/kmem.
843 ++ Note that NLIST_ stuff is only checked, when getloadavg() is not available.
844 ++])
845 ++AH_TEMPLATE([LOADAV_NUM])
846 ++AH_TEMPLATE([LOADAV_TYPE])
847 ++AH_TEMPLATE([LOADAV_SCALE])
848 ++AH_TEMPLATE([LOADAV_GETLOADAVG])
849 ++AH_TEMPLATE([LOADAV_UNIX])
850 ++AH_TEMPLATE([LOADAV_AVENRUN])
851 ++AH_TEMPLATE([LOADAV_USE_NLIST64])
852 ++
853 ++AH_TEMPLATE([NLIST_DECLARED])
854 ++AH_TEMPLATE([NLIST_STRUCT])
855 ++AH_TEMPLATE([NLIST_NAME_UNION])
856 ++
857 + AC_CHECKING(for libutil(s))
858 +-test -f /usr/lib/libutils.a && LIBS="$LIBS -lutils"
859 +-test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil"
860 ++dnl I have no idea whether "login" is an appropriate symbol to check for here - Hannes
861 ++AC_CHECK_LIB(utils,login)
862 ++AC_CHECK_LIB(util,login)
863 +
864 + AC_CHECKING(getloadavg)
865 + AC_TRY_LINK(,[getloadavg((double *)0, 0);],
866 + AC_DEFINE(LOADAV_GETLOADAVG) load=1,
867 +-if test -f /usr/lib/libkvm.a ; then
868 + olibs="$LIBS"
869 +-LIBS="$LIBS -lkvm"
870 ++AC_CHECK_LIB(kvm,kvm_open,
871 + AC_CHECKING(getloadavg with -lkvm)
872 + AC_TRY_LINK(,[getloadavg((double *)0, 0);],
873 + AC_DEFINE(LOADAV_GETLOADAVG) load=1, LIBS="$olibs")
874 +-fi
875 ++)
876 + )
877 +
878 + if test -z "$load" ; then
879 +@@ -1005,6 +1088,11 @@
880 + dnl
881 + dnl **** signal handling ****
882 + dnl
883 ++
884 ++AH_TEMPLATE([SIGVOID],
885 ++[Define SIGVOID if your signal handlers return void. On older
886 ++ systems, signal returns int, but on newer ones, it returns void.])
887 ++
888 + if test -n "$posix" ; then
889 +
890 + dnl POSIX has reliable signals with void return type.
891 +@@ -1014,6 +1102,7 @@
892 + else
893 +
894 + AC_CHECKING(return type of signal handlers)
895 ++AH_TEMPLATE([USESIGSET], [Define USESIGSET if you have sigset for BSD 4.1 reliable signals.])
896 + AC_TRY_COMPILE(
897 + [#include <sys/types.h>
898 + #include <signal.h>
899 +@@ -1033,6 +1122,9 @@
900 + #endif
901 + ], AC_DEFINE(USESIGSET))
902 + AC_CHECKING(signal implementation)
903 ++AH_TEMPLATE([SYSVSIGS],
904 ++[Define SYSVSIGS if signal handlers must be reinstalled after
905 ++ they have been called.])
906 + AC_TRY_RUN([
907 + #include <sys/types.h>
908 + #include <signal.h>
909 +@@ -1075,13 +1167,14 @@
910 + dnl
911 +
912 + AC_CHECKING(for crypt and sec libraries)
913 +-test -f /lib/libcrypt_d.a || test -f /usr/lib/libcrypt_d.a && LIBS="$LIBS -lcrypt_d"
914 ++dnl I have no idea whether "crypt" is an appropriate symbol to check for here - Hannes
915 ++AC_CHECK_LIB(crypt_d,crypt)
916 + oldlibs="$LIBS"
917 +-LIBS="$LIBS -lcrypt"
918 + AC_CHECKING(crypt)
919 + AC_TRY_LINK(,,,LIBS="$oldlibs")
920 +-test -f /lib/libsec.a || test -f /usr/lib/libsec.a && LIBS="$LIBS -lsec"
921 +-test -f /lib/libshadow.a || test -f /usr/lib/libshadow.a && LIBS="$LIBS -lshadow"
922 ++AC_CHECK_LIB(crypt,crypt)
923 ++AC_CHECK_LIB(sec,crypt)
924 ++AC_CHECK_LIB(shadow,getspnam)
925 + oldlibs="$LIBS"
926 + LIBS="$LIBS -lsun"
927 + AC_CHECKING(IRIX sun library)
928 +@@ -1104,6 +1197,13 @@
929 + dnl **** misc things ****
930 + dnl
931 + AC_CHECKING(wait union)
932 ++AH_TEMPLATE([BSDWAIT],
933 ++[Define BSDWAIT if your system defines a 'union wait' in <sys/wait.h>
934 ++
935 ++ Only allow BSDWAIT i.e. wait3 on nonposix systems, since
936 ++ posix implies wait(3) and waitpid(3). vdlinden@×××××××.nl
937 ++ TODO(Hannes) shipped config.h.in does that with a #ifdef
938 ++])
939 + AC_TRY_COMPILE([#include <sys/types.h>
940 + #include <sys/wait.h>
941 + ],[
942 +@@ -1114,6 +1214,13 @@
943 + #endif
944 + ],AC_DEFINE(BSDWAIT))
945 +
946 ++AH_TEMPLATE([TERMIO],
947 ++[Define TERMIO if you have struct termio instead of struct sgttyb.
948 ++ This is usually the case for SVID systems, where BSD uses sgttyb.
949 ++ POSIX systems should define this anyway, even though they use
950 ++ struct termios.])
951 ++
952 ++
953 + if test -z "$butterfly"; then
954 + AC_CHECKING(for termio or termios)
955 + AC_TRY_CPP([#include <termio.h>], AC_DEFINE(TERMIO),
956 +@@ -1123,17 +1230,35 @@
957 + )
958 + fi
959 +
960 ++AH_TEMPLATE([CYTERMIO], [Define CYTERMIO if you have cyrillic termio modes.])
961 ++
962 + dnl AC_CHECK_HEADER(shadow.h, AC_DEFINE(SHADOWPW))
963 + AC_CHECKING(getspnam)
964 ++AH_TEMPLATE([SHADOWPW],
965 ++[If the passwords are stored in a shadow file and you want the
966 ++ builtin lock to work properly, define SHADOWPW.])
967 + AC_TRY_LINK([#include <shadow.h>], [getspnam("x");],AC_DEFINE(SHADOWPW))
968 +
969 + AC_CHECKING(getttyent)
970 ++AH_TEMPLATE([GETTTYENT],
971 ++[If your system has the new format /etc/ttys (like 4.3 BSD) and the
972 ++ getttyent(3) library functions, define GETTTYENT.])
973 + AC_TRY_LINK(,[getttyent();], AC_DEFINE(GETTTYENT))
974 +
975 + AC_CHECKING(fdwalk)
976 ++AH_TEMPLATE([HAVE_FDWALK],
977 ++[Newer versions of Solaris include fdwalk, which can greatly improve
978 ++ the startup time of screen; otherwise screen spends a lot of time
979 ++ closing file descriptors.])
980 + AC_TRY_LINK([#include <stdlib.h>], [fdwalk(NULL, NULL);],AC_DEFINE(HAVE_FDWALK))
981 +
982 +-AC_CHECKING(whether memcpy/memmove/bcopy handles overlapping arguments)
983 ++AH_TEMPLATE([USEBCOPY],
984 ++[Define USEBCOPY if the bcopy/memcpy from your system's C library
985 ++ supports the overlapping of source and destination blocks. When
986 ++ undefined, screen uses its own (probably slower) version of bcopy().])
987 ++
988 ++AC_CACHE_CHECK([if bcopy handles overlap],
989 ++ [screen_cv_sys_bcopy_overlap],
990 + AC_TRY_RUN([
991 + main() {
992 + char buf[10];
993 +@@ -1146,7 +1271,21 @@
994 + if (strncmp(buf, "cdedef", 6))
995 + exit(1);
996 + exit(0); /* libc version works properly. */
997 +-}], AC_DEFINE(USEBCOPY))
998 ++}], screen_cv_sys_bcopy_overlap=yes,
999 ++screen_cv_sys_bcopy_overlap=no))
1000 ++if test X"$screen_cv_sys_bcopy_overlap" = Xyes; then
1001 ++ AC_DEFINE(USEBCOPY)
1002 ++fi
1003 ++
1004 ++AH_TEMPLATE([USEMEMMOVE],
1005 ++[SYSV machines may have a working memcpy() -- Oh, this is
1006 ++ quite unlikely. Tell me if you see one.
1007 ++ "But then, memmove() should work, if at all available" he thought...
1008 ++ Boing, never say "works everywhere" unless you checked SCO UNIX.
1009 ++ Their memove fails the test in the configure script. Sigh. (Juergen)
1010 ++])
1011 ++AC_CACHE_CHECK([if memmove handles overlap],
1012 ++ [screen_cv_sys_memmove_overlap],
1013 +
1014 + AC_TRY_RUN([
1015 + #define bcopy(s,d,l) memmove(d,s,l)
1016 +@@ -1161,9 +1300,15 @@
1017 + if (strncmp(buf, "cdedef", 6))
1018 + exit(1);
1019 + exit(0); /* libc version works properly. */
1020 +-}], AC_DEFINE(USEMEMMOVE))
1021 +-
1022 ++}], screen_cv_sys_memmove_overlap=yes,
1023 ++screen_cv_sys_memmove_overlap=no))
1024 ++if test X"$screen_cv_sys_memmove_overlap" = Xyes; then
1025 ++ AC_DEFINE(USEMEMMOVE)
1026 ++fi
1027 +
1028 ++AH_TEMPLATE([USEMEMCPY],[])
1029 ++AC_CACHE_CHECK([if memcpy handles overlap],
1030 ++ [screen_cv_sys_memcpy_overlap],
1031 + AC_TRY_RUN([
1032 + #define bcopy(s,d,l) memcpy(d,s,l)
1033 + main() {
1034 +@@ -1177,9 +1322,19 @@
1035 + if (strncmp(buf, "cdedef", 6))
1036 + exit(1);
1037 + exit(0); /* libc version works properly. */
1038 +-}], AC_DEFINE(USEMEMCPY))
1039 ++}], screen_cv_sys_memcpy_overlap=yes,
1040 ++screen_cv_sys_memcpy_overlap=no))
1041 ++if test X"$screen_cv_sys_memcpy_overlap" = Xyes; then
1042 ++ AC_DEFINE(USEMEMCPY)
1043 ++fi
1044 +
1045 + AC_MSG_CHECKING(long file names)
1046 ++AH_TEMPLATE([NAME_MAX],
1047 ++[If you are on a SYS V machine that restricts filename length to 14
1048 ++ characters, you may need to enforce that by setting NAME_MAX to 14])
1049 ++dnl TODO(Hannes) shipped config.h.in has
1050 ++dnl #undef NAME_MAX /* KEEP_UNDEF_HERE override system value */
1051 ++dnl ahead of this
1052 + (echo 1 > /tmp/conftest9012345) 2>/dev/null
1053 + (echo 2 > /tmp/conftest9012346) 2>/dev/null
1054 + val=`cat /tmp/conftest9012345 2>/dev/null`
1055 +@@ -1192,6 +1347,10 @@
1056 + rm -f /tmp/conftest*
1057 +
1058 + AC_MSG_CHECKING(for vsprintf)
1059 ++AH_TEMPLATE([USEVARARGS],
1060 ++[If your system has vsprintf() and requires the use of the macros in
1061 ++ "varargs.h" to use functions with variable arguments,
1062 ++ define USEVARARGS.])
1063 + AC_TRY_LINK([#include <stdarg.h>],[va_list valist; vsprintf(0,0,valist);],
1064 + [AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS)],
1065 + [AC_MSG_RESULT(no)])
1066 +@@ -1199,12 +1358,19 @@
1067 + AC_HEADER_DIRENT
1068 +
1069 + AC_MSG_CHECKING(for setenv)
1070 ++AH_TEMPLATE([USESETENV], [If your system has setenv() and unsetenv() define USESETENV])
1071 + AC_TRY_LINK(,[setenv((char *)0,(char *)0);unsetenv((char *)0);], AC_MSG_RESULT(yes);AC_DEFINE(USESETENV),
1072 + AC_MSG_RESULT(no)
1073 + AC_MSG_CHECKING(for putenv)
1074 ++AH_TEMPLATE([NEEDPUTENV],
1075 ++[If your system does not come with a setenv()/putenv()/getenv()
1076 ++ functions, you may bring in our own code by defining NEEDPUTENV.])
1077 + AC_TRY_LINK(,[putenv((char *)0);unsetenv((char *)0);], AC_MSG_RESULT(yes) , AC_MSG_RESULT(no);AC_DEFINE(NEEDPUTENV)
1078 + ))
1079 + AC_MSG_CHECKING([for nl_langinfo(CODESET)])
1080 ++AH_TEMPLATE([HAVE_NL_LANGINFO],
1081 ++[define HAVE_NL_LANGINFO if your system has the nl_langinfo() call
1082 ++ and <langinfo.h> defines CODESET.])
1083 + AC_TRY_LINK([
1084 + #include <langinfo.h>
1085 + ],[nl_langinfo(CODESET);], AC_MSG_RESULT(yes);AC_DEFINE(HAVE_NL_LANGINFO), AC_MSG_RESULT(no))
1086 +@@ -1254,7 +1420,8 @@
1087 + dnl Ptx bug workaround -- insert -lc after -ltermcap
1088 + test -n "$seqptx" && LIBS="-ltermcap -lc -lsocket -linet -lnsl -lsec -lseq"
1089 +
1090 +-AC_TRY_RUN(main(){exit(0);},,AC_MSG_ERROR(Can't run the compiler - internal error. Sorry.))
1091 ++AC_MSG_CHECKING(compiler sanity)
1092 ++AC_TRY_RUN(main(){exit(0);},,AC_MSG_ERROR(Can't run the compiler - internal error. Sorry.), AC_MSG_WARN(Skipping test due to crosscompilation))
1093 +
1094 + ETCSCREENRC="\"/usr/local/etc/screenrc\""
1095 + if test -n "$prefix"; then
1096
1097 diff --git a/app-misc/screen/files/screen-4.0.3-fbsd.patch b/app-misc/screen/files/screen-4.0.3-fbsd.patch
1098 new file mode 100644
1099 index 0000000..773f15f
1100 --- /dev/null
1101 +++ b/app-misc/screen/files/screen-4.0.3-fbsd.patch
1102 @@ -0,0 +1,55 @@
1103 +diff -Nur screen-4.0.3.orig/os.h screen-4.0.3/os.h
1104 +--- screen-4.0.3.orig/os.h 2002-01-09 00:42:33.000000000 +0900
1105 ++++ screen-4.0.3/os.h 2012-11-29 22:36:22.000000000 +0900
1106 +@@ -260,9 +260,13 @@
1107 + #endif
1108 +
1109 + #if defined(UTMPOK) || defined(BUGGYGETLOGIN)
1110 +-# if defined(SVR4) && !defined(DGUX) && !defined(__hpux) && !defined(linux)
1111 ++# if (defined(SVR4) && !defined(DGUX) && !defined(__hpux) && !defined(linux)) || defined(__FreeBSD__)
1112 ++# ifdef UTMPX_FILE
1113 ++# define UTMPFILE UTMPX_FILE
1114 ++# else
1115 ++# define UTMPFILE "/nonexistent"
1116 ++# endif
1117 + # include <utmpx.h>
1118 +-# define UTMPFILE UTMPX_FILE
1119 + # define utmp utmpx
1120 + # define getutent getutxent
1121 + # define getutid getutxid
1122 +@@ -271,6 +275,10 @@
1123 + # define setutent setutxent
1124 + # define endutent endutxent
1125 + # define ut_time ut_xtime
1126 ++# ifdef __FreeBSD__
1127 ++# define ut_time ut_tv.tv_sec
1128 ++# define GETUTENT
1129 ++# endif
1130 + # else /* SVR4 */
1131 + # include <utmp.h>
1132 + # endif /* SVR4 */
1133 +diff -Nur screen-4.0.3.orig/screen.h screen-4.0.3/screen.h
1134 +--- screen-4.0.3.orig/screen.h 2003-08-22 21:28:43.000000000 +0900
1135 ++++ screen-4.0.3/screen.h 2012-11-29 22:38:16.000000000 +0900
1136 +@@ -22,6 +22,9 @@
1137 + * $Id: screen.h,v 1.12 1994/05/31 12:32:54 mlschroe Exp $ FAU
1138 + */
1139 +
1140 ++#if defined(__FreeBSD__)
1141 ++# include <string.h>
1142 ++#endif
1143 + #include "os.h"
1144 +
1145 + #if defined(__STDC__)
1146 +diff -Nur screen-4.0.3.orig/utmp.c screen-4.0.3/utmp.c
1147 +--- screen-4.0.3.orig/utmp.c 2003-09-08 23:27:17.000000000 +0900
1148 ++++ screen-4.0.3/utmp.c 2012-11-29 22:36:22.000000000 +0900
1149 +@@ -589,7 +589,7 @@
1150 + struct utmp *u;
1151 + {
1152 + u->ut_type = DEAD_PROCESS;
1153 +-#if !defined(linux) || defined(EMPTY)
1154 ++#if (!defined(__FreeBSD__) && (!defined(linux) || defined(EMPTY)))
1155 + u->ut_exit.e_termination = 0;
1156 + u->ut_exit.e_exit = 0;
1157 + #endif
1158
1159 diff --git a/app-misc/screen/files/screen-4.0.3-setenv_autoconf.patch b/app-misc/screen/files/screen-4.0.3-setenv_autoconf.patch
1160 new file mode 100644
1161 index 0000000..e47a15d
1162 --- /dev/null
1163 +++ b/app-misc/screen/files/screen-4.0.3-setenv_autoconf.patch
1164 @@ -0,0 +1,79 @@
1165 +--- configure.in.DIST 2006-10-31 21:39:07.010473000 -0800
1166 ++++ configure.in 2006-10-31 21:43:05.630162000 -0800
1167 +@@ -1211,15 +1211,32 @@
1168 + AC_HEADER_DIRENT
1169 +
1170 + AC_MSG_CHECKING(for setenv)
1171 +-AH_TEMPLATE([USESETENV], [If your system has setenv() and unsetenv() define USESETENV])
1172 +-AC_TRY_LINK(,[setenv((char *)0,(char *)0);unsetenv((char *)0);], AC_MSG_RESULT(yes);AC_DEFINE(USESETENV),
1173 +-AC_MSG_RESULT(no)
1174 +-AC_MSG_CHECKING(for putenv)
1175 +-AH_TEMPLATE([NEEDPUTENV],
1176 +-[If your system does not come with a setenv()/putenv()/getenv()
1177 +- functions, you may bring in our own code by defining NEEDPUTENV.])
1178 +-AC_TRY_LINK(,[putenv((char *)0);unsetenv((char *)0);], AC_MSG_RESULT(yes) , AC_MSG_RESULT(no);AC_DEFINE(NEEDPUTENV)
1179 +-))
1180 ++if test -z "$ac_setenv_args"; then
1181 ++ AC_TRY_LINK(
1182 ++ [#include <stdlib.h>],
1183 ++ [
1184 ++ setenv((char *) 0, (char *) 0, 0);
1185 ++ ], ac_setenv_args=3)
1186 ++fi
1187 ++if test -z "$ac_setenv_args"; then
1188 ++ AC_TRY_LINK(
1189 ++ [#include <stdlib.h>],
1190 ++ [
1191 ++ setenv((char *) 0, (char *) 0);
1192 ++ ], ac_setenv_args=2)
1193 ++fi
1194 ++if test -n "$ac_setenv_args"; then
1195 ++ AC_DEFINE(USESETENV)
1196 ++ if test "$ac_setenv_args" = 3; then
1197 ++ AC_DEFINE(HAVE_SETENV_3)
1198 ++ elif test "$ac_setenv_args" = 2; then
1199 ++ AC_DEFINE(HAVE_SETENV_2)
1200 ++ fi
1201 ++else
1202 ++ AC_MSG_RESULT(no)
1203 ++ AC_MSG_CHECKING(for putenv)
1204 ++ AC_TRY_LINK(,[putenv((char *)0);unsetenv((char *)0);], AC_MSG_RESULT(yes) , AC_MSG_RESULT(no);AC_DEFINE(NEEDPUTENV))
1205 ++fi
1206 + AC_MSG_CHECKING([for nl_langinfo(CODESET)])
1207 + AH_TEMPLATE([HAVE_NL_LANGINFO],
1208 + [define HAVE_NL_LANGINFO if your system has the nl_langinfo() call
1209 +--- config.h.in.DIST 2006-10-31 21:43:23.233714000 -0800
1210 ++++ config.h.in 2006-10-31 21:44:27.346275000 -0800
1211 +@@ -548,6 +548,16 @@
1212 + #undef USESETENV
1213 +
1214 + /*
1215 ++ * If setenv() takes 3 arguments define HAVE_SETENV_3
1216 ++ */
1217 ++#undef HAVE_SETENV_3
1218 ++
1219 ++/*
1220 ++ * If setenv() takes 2 arguments define HAVE_SETENV_2
1221 ++ */
1222 ++#undef HAVE_SETENV_2
1223 ++
1224 ++/*
1225 + * If your system does not come with a setenv()/putenv()/getenv()
1226 + * functions, you may bring in our own code by defining NEEDPUTENV.
1227 + */
1228 +--- misc.c.DIST 2006-10-31 20:55:42.481760000 -0800
1229 ++++ misc.c 2006-10-31 21:53:24.143551000 -0800
1230 +@@ -613,11 +613,11 @@
1231 + */
1232 + # endif /* NEEDSETENV */
1233 + #else /* USESETENV */
1234 +-# if defined(linux) || defined(__convex__) || (BSD >= 199103)
1235 ++# if HAVE_SETENV_3
1236 + setenv(var, value, 1);
1237 + # else
1238 + setenv(var, value);
1239 +-# endif /* linux || convex || BSD >= 199103 */
1240 ++# endif /* HAVE_SETENV_3 */
1241 + #endif /* USESETENV */
1242 + }
1243 +
1244
1245 diff --git a/app-misc/screen/files/screenrc b/app-misc/screen/files/screenrc
1246 new file mode 100644
1247 index 0000000..02e63bf
1248 --- /dev/null
1249 +++ b/app-misc/screen/files/screenrc
1250 @@ -0,0 +1,356 @@
1251 +# Copyright 1999-2011 Gentoo Foundation
1252 +# Distributed under the terms of the GNU General Public License v2
1253 +#
1254 +# /etc/screenrc
1255 +#
1256 +# This is the system wide screenrc.
1257 +#
1258 +# You can use this file to change the default behavior of screen system wide
1259 +# or copy it to ~/.screenrc and use it as a starting point for your own
1260 +# settings.
1261 +#
1262 +# Commands in this file are used to set options, bind screen functions to
1263 +# keys, redefine terminal capabilities, and to automatically establish one or
1264 +# more windows at the beginning of your screen session.
1265 +#
1266 +# This is not a comprehensive list of options, look at the screen manual for
1267 +# details on everything that you can put in this file.
1268 +#
1269 +#
1270 +
1271 +# ==============================================================================
1272 +# SCREEN SETTINGS
1273 +# ==============================================================================
1274 +
1275 +# ESCAPE - the COMMAND CHARACTER
1276 +# ===============================================================
1277 +# escape ^aa # default
1278 +# escape ^^^^ # suggested binding (Control-^) for Emacs users
1279 +
1280 +
1281 +# PASSWORD
1282 +# ===============================================================
1283 +# This commands sets the *internal* password for the screen session.
1284 +# WARNING!! If this is set then a "lock" command will only let you in to the
1285 +# session after you enter the user's account password and then *also*
1286 +# the internal password for that session. This gives additional safety but,
1287 +# if you forget the internal password then you cannot resume your session.
1288 +# Use :password to generate a password
1289 +# password ODSJQf.4IJN7E # "1234"
1290 +
1291 +
1292 +# VARIABLES
1293 +# ===============================================================
1294 +# No annoying audible bell, using "visual bell"
1295 +# vbell on # default: off
1296 +# vbell_msg " -- Bell,Bell!! -- " # default: "Wuff,Wuff!!"
1297 +
1298 +# Automatically detach on hangup.
1299 + autodetach on # default: on
1300 +
1301 +# Don't display the copyright page
1302 + startup_message off # default: on
1303 +
1304 +# Uses nethack-style messages
1305 +# nethack on # default: off
1306 +
1307 +# Affects the copying of text regions
1308 + crlf off # default: off
1309 +
1310 +# Enable/disable multiuser mode. Standard screen operation is singleuser.
1311 +# In multiuser mode the commands acladd, aclchg, aclgrp and acldel can be used
1312 +# to enable (and disable) other user accessing this screen session.
1313 +# Requires suid-root.
1314 + multiuser off
1315 +
1316 +# Change default scrollback value for new windows
1317 + defscrollback 1000 # default: 100
1318 +
1319 +# Define the time that all windows monitored for silence should
1320 +# wait before displaying a message. Default 30 seconds.
1321 + silencewait 15 # default: 30
1322 +
1323 +# bufferfile: The file to use for commands
1324 +# "readbuf" ('<') and "writebuf" ('>'):
1325 + bufferfile $HOME/.screen_exchange
1326 +#
1327 +# hardcopydir: The directory which contains all hardcopies.
1328 +# hardcopydir ~/.hardcopy
1329 +# hardcopydir ~/.screen
1330 +#
1331 +# shell: Default process started in screen's windows.
1332 +# Makes it possible to use a different shell inside screen
1333 +# than is set as the default login shell.
1334 +# If begins with a '-' character, the shell will be started as a login shell.
1335 +# shell zsh
1336 +# shell bash
1337 +# shell ksh
1338 + shell -$SHELL
1339 +
1340 +# shellaka '> |tcsh'
1341 +# shelltitle '$ |bash'
1342 +
1343 +# emulate .logout message
1344 + pow_detach_msg "Screen session of \$LOGNAME \$:cr:\$:nl:ended."
1345 +
1346 +# caption always " %w --- %c:%s"
1347 +# caption always "%3n %t%? @%u%?%? [%h]%?%=%c"
1348 +
1349 +# advertise hardstatus support to $TERMCAP
1350 +# termcapinfo * '' 'hs:ts=\E_:fs=\E\\:ds=\E_\E\\'
1351 +
1352 +# set every new windows hardstatus line to somenthing descriptive
1353 +# defhstatus "screen: ^En (^Et)"
1354 +
1355 +# don't kill window after the process died
1356 +# zombie "^["
1357 +
1358 +# ignore displays that block on output
1359 +defnonblock on
1360 +
1361 +# XTERM TWEAKS
1362 +# ===============================================================
1363 +
1364 +# xterm understands both im/ic and doesn't have a status line.
1365 +# Note: Do not specify im and ic in the real termcap/info file as
1366 +# some programs (e.g. vi) will not work anymore.
1367 + termcap xterm hs@:cs=\E[%i%d;%dr:im=\E[4h:ei=\E[4l
1368 + terminfo xterm hs@:cs=\E[%i%p1%d;%p2%dr:im=\E[4h:ei=\E[4l
1369 +
1370 +# 80/132 column switching must be enabled for ^AW to work
1371 +# change init sequence to not switch width
1372 + termcapinfo xterm Z0=\E[?3h:Z1=\E[?3l:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l
1373 +
1374 +# Make the output buffer large for (fast) xterms.
1375 +# termcapinfo xterm* OL=10000
1376 + termcapinfo xterm* OL=100
1377 +
1378 +# tell screen that xterm can switch to dark background and has function
1379 +# keys.
1380 + termcapinfo xterm 'VR=\E[?5h:VN=\E[?5l'
1381 + termcapinfo xterm 'k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~'
1382 + termcapinfo xterm 'kh=\EOH:kI=\E[2~:kD=\E[3~:kH=\EOF:kP=\E[5~:kN=\E[6~'
1383 +
1384 +# special xterm hardstatus: use the window title.
1385 + termcapinfo xterm 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'
1386 +
1387 +#terminfo xterm 'vb=\E[?5h$<200/>\E[?5l'
1388 + termcapinfo xterm 'vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l'
1389 +
1390 +# emulate part of the 'K' charset
1391 + termcapinfo xterm 'XC=K%,%\E(B,[\304,\\\\\326,]\334,{\344,|\366,}\374,~\337'
1392 +
1393 +# xterm-52 tweaks:
1394 +# - uses background color for delete operations
1395 + termcapinfo xterm* be
1396 +
1397 +# Do not use xterm's alternative window buffer, it breaks scrollback (see bug #61195)
1398 + termcapinfo xterm|xterms|xs ti@:te=\E[2J
1399 +
1400 +# WYSE TERMINALS
1401 +# ===============================================================
1402 +
1403 +#wyse-75-42 must have flow control (xo = "terminal uses xon/xoff")
1404 +#essential to have it here, as this is a slow terminal.
1405 + termcapinfo wy75-42 xo:hs@
1406 +
1407 +# New termcap sequences for cursor application mode.
1408 + termcapinfo wy* CS=\E[?1h:CE=\E[?1l:vi=\E[?25l:ve=\E[?25h:VR=\E[?5h:VN=\E[?5l:cb=\E[1K:CD=\E[1J
1409 +
1410 +
1411 +# OTHER TERMINALS
1412 +# ===============================================================
1413 +
1414 +# make hp700 termcap/info better
1415 + termcapinfo hp700 'Z0=\E[?3h:Z1=\E[?3l:hs:ts=\E[62"p\E[0$~\E[2$~\E[1$}:fs=\E[0}\E[61"p:ds=\E[62"p\E[1$~\E[61"p:ic@'
1416 +
1417 +# Extend the vt100 desciption by some sequences.
1418 + termcap vt100* ms:AL=\E[%dL:DL=\E[%dM:UP=\E[%dA:DO=\E[%dB:LE=\E[%dD:RI=\E[%dC
1419 + terminfo vt100* ms:AL=\E[%p1%dL:DL=\E[%p1%dM:UP=\E[%p1%dA:DO=\E[%p1%dB:LE=\E[%p1%dD:RI=\E[%p1%dC
1420 + termcapinfo linux C8
1421 +# old rxvt versions also need this
1422 +# termcapinfo rxvt C8
1423 +
1424 +
1425 +# KEYBINDINGS
1426 +# ==============================================================
1427 +# The "bind" command assign keys to (internal) commands
1428 +# SCREEN checks all the keys you type; you type the key
1429 +# which is known as the "command character" then SCREEN
1430 +# eats this key, too, and checks whether this key is
1431 +# "bound" to a command. If so then SCREEN will execute it.
1432 +#
1433 +# The command "bind" allows you to chose which keys
1434 +# will be assigned to the commands.
1435 +#
1436 +# Some commands are bound to several keys -
1437 +# usually to both some letter and its corresponding
1438 +# control key combination, eg the command
1439 +# "(create) screen" is bound to both 'c' and '^C'.
1440 +#
1441 +# The following list shows the default bindings:
1442 +#
1443 +# break ^B b
1444 +# clear C
1445 +# colon :
1446 +# copy ^[ [
1447 +# detach ^D d
1448 +# digraph ^V
1449 +# displays *
1450 +# dumptermcap .
1451 +# fit F
1452 +# flow ^F f
1453 +# focus ^I
1454 +# hardcopy h
1455 +# help ?
1456 +# history { }
1457 +# info i
1458 +# kill K k
1459 +# lastmsg ^M m
1460 +# license ,
1461 +# log H
1462 +# login L
1463 +# meta x
1464 +# monitor M
1465 +# next ^@ ^N sp n
1466 +# number N
1467 +# only Q
1468 +# other ^X
1469 +# pow_break B
1470 +# pow_detach D
1471 +# prev ^H ^P p ^?
1472 +# quit \
1473 +# readbuf <
1474 +# redisplay ^L l
1475 +# remove X
1476 +# removebuf =
1477 +# reset Z
1478 +# screen ^C c
1479 +# select " '
1480 +# silence _
1481 +# split S
1482 +# suspend ^Z z
1483 +# time ^T t
1484 +# title A
1485 +# vbell ^G
1486 +# version v
1487 +# width W
1488 +# windows ^W w
1489 +# wrap ^R r
1490 +# writebuf >
1491 +# xoff ^S s
1492 +# xon ^Q q
1493 +# ^] paste .
1494 +# - select -
1495 +# 0 select 0
1496 +# 1 select 1
1497 +# 2 select 2
1498 +# 3 select 3
1499 +# 4 select 4
1500 +# 5 select 5
1501 +# 6 select 6
1502 +# 7 select 7
1503 +# 8 select 8
1504 +# 9 select 9
1505 +# I login on
1506 +# O login off
1507 +# ] paste .
1508 +#
1509 +
1510 +# And here are the default bind commands if you need them:
1511 +#
1512 +# bind A title
1513 +# bind C clear
1514 +# bind D pow_detach
1515 +# bind F fit
1516 +# bind H log
1517 +# bind I login on
1518 +# bind K kill
1519 +# bind L login
1520 +# bind M monitor
1521 +# bind N number
1522 +# bind O login off
1523 +# bind Q only
1524 +# bind S split
1525 +# bind W width
1526 +# bind X remove
1527 +# bind Z reset
1528 +
1529 +# Let's remove some dangerous key bindings ...
1530 + bind k
1531 + bind ^k
1532 +# bind . dumptermcap # default
1533 + bind .
1534 +# bind ^\ quit # default
1535 + bind ^\
1536 +# bind \\ quit # default
1537 + bind \\
1538 +# bind ^h ??? # default
1539 + bind ^h
1540 +# bind h hardcopy # default
1541 + bind h
1542 +
1543 +# ... and make them better.
1544 + bind 'K' kill
1545 + bind 'I' login on
1546 + bind 'O' login off
1547 + bind '}' history
1548 +
1549 +# Yet another hack:
1550 +# Prepend/append register [/] to the paste if ^a^] is pressed.
1551 +# This lets me have autoindent mode in vi.
1552 + register [ "\033:se noai\015a"
1553 + register ] "\033:se ai\015a"
1554 + bind ^] paste [.]
1555 +
1556 +
1557 +# hardstatus alwaysignore
1558 +# hardstatus alwayslastline "%Lw"
1559 +
1560 +# Resize the current region. The space will be removed from or added to
1561 +# the region below or if there's not enough space from the region above.
1562 + bind = resize =
1563 + bind + resize +3
1564 + bind - resize -3
1565 +# bind _ resize max
1566 +#
1567 +# attrcolor u "-u b"
1568 +# attrcolor b "R"
1569 +
1570 +# STARTUP SCREENS
1571 +# ===============================================================
1572 +# Defines the time screen delays a new message when one message
1573 +# is currently displayed. The default is 1 second.
1574 +# msgminwait 2
1575 +
1576 +# Time a message is displayed if screen is not disturbed by
1577 +# other activity. The dafault is 5 seconds:
1578 +# msgwait 2
1579 +
1580 +# Briefly show the version number of this starting
1581 +# screen session - but only for *one* second:
1582 +# msgwait 1
1583 +# version
1584 +
1585 +# Welcome the user:
1586 +# echo "welcome :-)"
1587 +# echo "I love you today."
1588 +
1589 +# Uncomment one/some following lines to automatically let
1590 +# SCREEN start some programs in the given window numbers:
1591 +# screen -t MAIL 0 mutt
1592 +# screen -t EDIT 1 vim
1593 +# screen -t GOOGLE 2 links http://www.google.com
1594 +# screen -t NEWS 3 slrn
1595 +# screen -t WWW 4 links http://www.math.fu-berlin.de/~guckes/
1596 +# screen 5
1597 +# screen 6
1598 +
1599 +# Set the environment variable var to value string. If only var is specified,
1600 +# you'll be prompted to enter a value. If no parameters are specified,
1601 +# you'll be prompted for both variable and value. The environment is
1602 +# inherited by all subsequently forked shells.
1603 +# setenv PROMPT_COMMAND 'echo -n -e "\033k\033\134"'
1604 +
1605 +# Don't you want to start programs which need a DISPLAY ?
1606 +# setenv DISPLAY ''
1607
1608 diff --git a/app-misc/screen/screen-4.0.3-r7.ebuild b/app-misc/screen/screen-4.0.3-r7.ebuild
1609 new file mode 100644
1610 index 0000000..a3751cc
1611 --- /dev/null
1612 +++ b/app-misc/screen/screen-4.0.3-r7.ebuild
1613 @@ -0,0 +1,159 @@
1614 +# Copyright 1999-2012 Gentoo Foundation
1615 +# Distributed under the terms of the GNU General Public License v2
1616 +# $Header: $
1617 +
1618 +EAPI=4
1619 +
1620 +WANT_AUTOCONF="2.5"
1621 +
1622 +inherit eutils flag-o-matic toolchain-funcs pam autotools user
1623 +
1624 +DESCRIPTION="Full-screen window manager that multiplexes physical terminals between several processes"
1625 +HOMEPAGE="http://www.gnu.org/software/screen/"
1626 +SRC_URI="ftp://ftp.uni-erlangen.de/pub/utilities/${PN}/${P}.tar.gz"
1627 +
1628 +LICENSE="GPL-2"
1629 +SLOT="0"
1630 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~hppa-hpux ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
1631 +IUSE="debug nethack pam selinux multiuser"
1632 +
1633 +RDEPEND=">=sys-libs/ncurses-5.2
1634 + pam? ( virtual/pam )
1635 + selinux? ( sec-policy/selinux-screen )"
1636 +DEPEND="${RDEPEND}"
1637 +
1638 +pkg_setup() {
1639 + # Make sure utmp group exists, as it's used later on.
1640 + enewgroup utmp 406
1641 +}
1642 +
1643 +src_prepare() {
1644 + # Bug 34599: integer overflow in 4.0.1
1645 + # (Nov 29 2003 -solar)
1646 + epatch "${FILESDIR}"/screen-4.0.1-int-overflow-fix.patch
1647 +
1648 + # Bug 31070: configure problem which affects alpha
1649 + # (13 Jan 2004 agriffis)
1650 + epatch "${FILESDIR}"/screen-4.0.1-vsprintf.patch
1651 +
1652 + # uclibc doesnt have sys/stropts.h
1653 + if ! (echo '#include <sys/stropts.h>' | $(tc-getCC) -E - &>/dev/null) ; then
1654 + epatch "${FILESDIR}"/4.0.2-no-pty.patch
1655 + fi
1656 +
1657 + # Don't use utempter even if it is found on the system
1658 + epatch "${FILESDIR}"/4.0.2-no-utempter.patch
1659 +
1660 + # Don't link against libelf even if it is found on the system
1661 + epatch "${FILESDIR}"/4.0.2-no-libelf.patch
1662 +
1663 + # Patch for time function on 64bit systems
1664 + epatch "${FILESDIR}"/4.0.2-64bit-time.patch
1665 +
1666 + # Patch that makes %u work for windowlist -b formats
1667 + epatch "${FILESDIR}"/4.0.2-windowlist-multiuser-fix.patch
1668 +
1669 + # Open tty in non-blocking mode
1670 + epatch "${FILESDIR}"/4.0.2-nonblock.patch
1671 +
1672 + # compability for sys-devel/autoconf-2.62
1673 + epatch "${FILESDIR}"/screen-4.0.3-config.h-autoconf-2.62.patch
1674 +
1675 + # crosscompile patch
1676 + epatch "${FILESDIR}"/"${P}"-crosscompile.patch
1677 +
1678 + # sched.h is a system header and causes problems with some C libraries
1679 + mv sched.h _sched.h || die
1680 + sed -i '/include/s:sched.h:_sched.h:' screen.h || die
1681 +
1682 + # Allow for more rendition (color/attribute) changes in status bars
1683 + sed -i \
1684 + -e "s:#define MAX_WINMSG_REND 16:#define MAX_WINMSG_REND 64:" \
1685 + screen.c \
1686 + || die "sed screen.c failed"
1687 +
1688 + # Fix manpage.
1689 + sed -i \
1690 + -e "s:/usr/local/etc/screenrc:${EPREFIX}/etc/screenrc:g" \
1691 + -e "s:/usr/local/screens:${EPREFIX}/var/run/screen:g" \
1692 + -e "s:/local/etc/screenrc:${EPREFIX}/etc/screenrc:g" \
1693 + -e "s:/etc/utmp:${EPREFIX}/var/run/utmp:g" \
1694 + -e "s:/local/screens/S-:${EPREFIX}/var/run/screen/S-:g" \
1695 + doc/screen.1 \
1696 + || die "sed doc/screen.1 failed"
1697 +
1698 + # proper setenv detection for Solaris
1699 + epatch "${FILESDIR}"/${P}-setenv_autoconf.patch
1700 +
1701 + # Allow TERM string large enough to use with rxvt-unicode-256color
1702 + # Allow usernames up to 32 chars
1703 + epatch "${FILESDIR}"/${PV}-extend-d_termname-ng2.patch
1704 +
1705 + # support CPPFLAGS
1706 + epatch "${FILESDIR}"/${P}-cppflags.patch
1707 +
1708 + # support >=Gentoo/FreeBSD 9.0, bug #409819
1709 + epatch "${FILESDIR}"/${P}-fbsd.patch
1710 +
1711 + # reconfigure
1712 + eautoconf
1713 +}
1714 +
1715 +src_configure() {
1716 + append-cppflags "-DMAXWIN=${MAX_SCREEN_WINDOWS:-100}"
1717 +
1718 + [[ ${CHOST} == *-solaris* ]] && append-libs -lsocket -lnsl
1719 +
1720 + use nethack || append-cppflags "-DNONETHACK"
1721 + use debug && append-cppflags "-DDEBUG"
1722 +
1723 + econf \
1724 + --with-socket-dir="${EPREFIX}/var/run/screen" \
1725 + --with-sys-screenrc="${EPREFIX}/etc/screenrc" \
1726 + --with-pty-mode=0620 \
1727 + --with-pty-group=5 \
1728 + --enable-rxvt_osc \
1729 + --enable-telnet \
1730 + --enable-colors256 \
1731 + $(use_enable pam) \
1732 + $(use multiuser || echo --disable-socket-dir)
1733 +
1734 + # Second try to fix bug 12683, this time without changing term.h
1735 + # The last try seemed to break screen at run-time.
1736 + # (16 Jan 2003 agriffis)
1737 + LC_ALL=POSIX make term.h || die "Failed making term.h"
1738 +}
1739 +
1740 +src_install() {
1741 + dobin screen
1742 +
1743 + if use multiuser || use prefix
1744 + then
1745 + fperms 4755 /usr/bin/screen
1746 + else
1747 + fowners root:utmp /usr/bin/screen
1748 + fperms 2755 /usr/bin/screen
1749 + fi
1750 +
1751 + insinto /usr/share/screen
1752 + doins terminfo/{screencap,screeninfo.src}
1753 + insinto /usr/share/screen/utf8encodings
1754 + doins utf8encodings/??
1755 + insinto /etc
1756 + doins "${FILESDIR}"/screenrc
1757 +
1758 + pamd_mimic_system screen auth
1759 +
1760 + dodoc \
1761 + README ChangeLog INSTALL TODO NEWS* patchlevel.h \
1762 + doc/{FAQ,README.DOTSCREEN,fdpat.ps,window_to_display.ps}
1763 +
1764 + doman doc/screen.1
1765 + doinfo doc/screen.info*
1766 +}
1767 +
1768 +pkg_postinst() {
1769 + elog "Some dangerous key bindings have been removed or changed to more safe values."
1770 + elog "We enable some xterm hacks in our default screenrc, which might break some"
1771 + elog "applications. Please check /etc/screenrc for information on these changes."
1772 +}