update screen
Hanno Böck

Hanno Böck commited on 2023-10-01 08:43:59
Zeige 2 geänderte Dateien mit 160 Einfügungen und 0 Löschungen.

... ...
@@ -0,0 +1,12 @@
1
+Bug: https://bugs.gentoo.org/894562
2
+Taken from: https://git.savannah.gnu.org/cgit/screen.git/commit/?id=7f320d3a643ec95682a7213b7e991e27038d8a57
3
+--- a/display.c
4
++++ b/display.c
5
+@@ -27,6 +27,7 @@
6
+  */
7
+ 
8
+ #include <sys/types.h>
9
++#include <sys/stat.h>
10
+ #include <signal.h>
11
+ #include <fcntl.h>
12
+ #ifndef sun
... ...
@@ -0,0 +1,148 @@
1
+# Copyright 1999-2023 Gentoo Authors
2
+# Distributed under the terms of the GNU General Public License v2
3
+
4
+EAPI=8
5
+
6
+inherit autotools flag-o-matic pam tmpfiles
7
+
8
+DESCRIPTION="screen manager with VT100/ANSI terminal emulation"
9
+HOMEPAGE="https://www.gnu.org/software/screen/"
10
+
11
+if [[ ${PV} != 9999 ]] ; then
12
+	SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
13
+	KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
14
+else
15
+	inherit git-r3
16
+	EGIT_REPO_URI="https://git.savannah.gnu.org/git/screen.git"
17
+	EGIT_CHECKOUT_DIR="${WORKDIR}/${P}" # needed for setting S later on
18
+	S="${WORKDIR}"/${P}/src
19
+fi
20
+
21
+LICENSE="GPL-3+"
22
+SLOT="0"
23
+IUSE="debug nethack pam selinux multiuser"
24
+
25
+DEPEND=">=sys-libs/ncurses-5.2:=
26
+	virtual/libcrypt:=
27
+	pam? ( sys-libs/pam )"
28
+RDEPEND="${DEPEND}
29
+	acct-group/utmp
30
+	selinux? ( sec-policy/selinux-screen )"
31
+BDEPEND="sys-apps/texinfo"
32
+
33
+PATCHES=(
34
+	# Don't use utempter even if it is found on the system.
35
+	"${FILESDIR}"/${PN}-4.3.0-no-utempter.patch
36
+	"${FILESDIR}"/${PN}-4.6.2-utmp-exit.patch
37
+	"${FILESDIR}"/${PN}-4.9.0-configure-implicit-function-decls.patch
38
+	"${FILESDIR}"/${P}-CVE-2023-24626.patch
39
+	"${FILESDIR}"/${PN}-4.9.0-clang16-chmod.patch
40
+)
41
+
42
+src_prepare() {
43
+	default
44
+
45
+	# sched.h is a system header and causes problems with some C libraries
46
+	mv sched.h _sched.h || die
47
+	sed -i '/include/ s:sched.h:_sched.h:' screen.h || die
48
+
49
+	# Fix manpage
50
+	sed -i \
51
+		-e "s:/usr/local/etc/screenrc:${EPREFIX}/etc/screenrc:g" \
52
+		-e "s:/usr/local/screens:${EPREFIX}/tmp/screen:g" \
53
+		-e "s:/local/etc/screenrc:${EPREFIX}/etc/screenrc:g" \
54
+		-e "s:/etc/utmp:${EPREFIX}/var/run/utmp:g" \
55
+		-e "s:/local/screens/S\\\-:${EPREFIX}/tmp/screen/S\\\-:g" \
56
+		doc/screen.1 || die
57
+
58
+	if [[ ${CHOST} == *-darwin* ]] || use elibc_musl; then
59
+		sed -i -e '/^#define UTMPOK/s/define/undef/' acconfig.h || die
60
+	fi
61
+
62
+	# disable musl dummy headers for utmp[x]
63
+	use elibc_musl && append-cppflags "-D_UTMP_H -D_UTMPX_H"
64
+
65
+	# reconfigure
66
+	eautoreconf
67
+}
68
+
69
+src_configure() {
70
+	append-cppflags "-DMAXWIN=${MAX_SCREEN_WINDOWS:-100}"
71
+
72
+	if [[ ${CHOST} == *-solaris* ]]; then
73
+		# enable msg_header by upping the feature standard compatible
74
+		# with c99 mode
75
+		append-cppflags -D_XOPEN_SOURCE=600
76
+	fi
77
+
78
+	use nethack || append-cppflags "-DNONETHACK"
79
+	use debug && append-cppflags "-DDEBUG"
80
+
81
+	local myeconfargs=(
82
+		--with-socket-dir="${EPREFIX}/tmp/${PN}"
83
+		--with-sys-screenrc="${EPREFIX}/etc/screenrc"
84
+		--with-pty-mode=0620
85
+		--with-pty-group=5
86
+		--enable-rxvt_osc
87
+		--enable-telnet
88
+		--enable-colors256
89
+		$(use_enable pam)
90
+	)
91
+	econf "${myeconfargs[@]}"
92
+}
93
+
94
+src_compile() {
95
+	LC_ALL=POSIX emake comm.h term.h
96
+	emake osdef.h
97
+
98
+	emake -C doc screen.info
99
+	default
100
+}
101
+
102
+src_install() {
103
+	local DOCS=(
104
+		README ChangeLog INSTALL TODO NEWS* patchlevel.h
105
+		doc/{FAQ,README.DOTSCREEN,fdpat.ps,window_to_display.ps}
106
+	)
107
+
108
+	emake DESTDIR="${D}" SCREEN="${P}" install
109
+
110
+	local tmpfiles_perms tmpfiles_group
111
+
112
+	if use multiuser || use prefix ; then
113
+		fperms 4755 /usr/bin/${P}
114
+		tmpfiles_perms="0755"
115
+		tmpfiles_group="root"
116
+	else
117
+		fowners root:utmp /usr/bin/${P}
118
+		fperms 2755 /usr/bin/${P}
119
+		tmpfiles_perms="0775"
120
+		tmpfiles_group="utmp"
121
+	fi
122
+
123
+	newtmpfiles - screen.conf <<<"d /tmp/screen ${tmpfiles_perms} root ${tmpfiles_group}"
124
+
125
+	insinto /usr/share/${PN}
126
+	doins terminfo/{screencap,screeninfo.src}
127
+
128
+	insinto /etc
129
+	doins "${FILESDIR}"/screenrc
130
+
131
+	if use pam; then
132
+		pamd_mimic_system screen auth
133
+	fi
134
+
135
+	dodoc "${DOCS[@]}"
136
+}
137
+
138
+pkg_postinst() {
139
+	if [[ -z ${REPLACING_VERSIONS} ]]; then
140
+		elog "Some dangerous key bindings have been removed or changed to more safe values."
141
+		elog "We enable some xterm hacks in our default screenrc, which might break some"
142
+		elog "applications. Please check /etc/screenrc for information on these changes."
143
+	fi
144
+
145
+	tmpfiles_process screen.conf
146
+
147
+	ewarn "This revision changes the screen socket location to ${EROOT}/tmp/${PN}"
148
+}
0 149