update screen
Hanno Böck

Hanno Böck commited on 2024-05-18 16:22:58
Zeige 1 geänderte Dateien mit 145 Einfügungen und 0 Löschungen.

... ...
@@ -0,0 +1,145 @@
1
+# Copyright 1999-2024 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.9.1-utmp-exit.patch
37
+)
38
+
39
+src_prepare() {
40
+	default
41
+
42
+	# sched.h is a system header and causes problems with some C libraries
43
+	mv sched.h _sched.h || die
44
+	sed -i '/include/ s:sched.h:_sched.h:' screen.h || die
45
+
46
+	# Fix manpage
47
+	sed -i \
48
+		-e "s:/usr/local/etc/screenrc:${EPREFIX}/etc/screenrc:g" \
49
+		-e "s:/usr/local/screens:${EPREFIX}/tmp/screen:g" \
50
+		-e "s:/local/etc/screenrc:${EPREFIX}/etc/screenrc:g" \
51
+		-e "s:/etc/utmp:${EPREFIX}/var/run/utmp:g" \
52
+		-e "s:/local/screens/S\\\-:${EPREFIX}/tmp/screen/S\\\-:g" \
53
+		doc/screen.1 || die
54
+
55
+	if [[ ${CHOST} == *-darwin* ]] || use elibc_musl; then
56
+		sed -i -e '/^#define UTMPOK/s/define/undef/' acconfig.h || die
57
+	fi
58
+
59
+	# disable musl dummy headers for utmp[x]
60
+	use elibc_musl && append-cppflags "-D_UTMP_H -D_UTMPX_H"
61
+
62
+	# reconfigure
63
+	eautoreconf
64
+}
65
+
66
+src_configure() {
67
+	append-lfs-flags
68
+	append-cppflags "-DMAXWIN=${MAX_SCREEN_WINDOWS:-100}"
69
+
70
+	if [[ ${CHOST} == *-solaris* ]]; then
71
+		# enable msg_header by upping the feature standard compatible
72
+		# with c99 mode
73
+		append-cppflags -D_XOPEN_SOURCE=600
74
+	fi
75
+
76
+	use nethack || append-cppflags "-DNONETHACK"
77
+	use debug && append-cppflags "-DDEBUG"
78
+
79
+	local myeconfargs=(
80
+		--with-sys-screenrc="${EPREFIX}/etc/screenrc"
81
+		--with-pty-mode=0620
82
+		--with-pty-group=5
83
+		--enable-rxvt_osc
84
+		--enable-telnet
85
+		--enable-colors256
86
+		$(use_enable pam)
87
+	)
88
+	econf "${myeconfargs[@]}"
89
+}
90
+
91
+src_compile() {
92
+	LC_ALL=POSIX emake comm.h term.h
93
+	emake osdef.h
94
+
95
+	emake -C doc screen.info
96
+	default
97
+}
98
+
99
+src_install() {
100
+	local DOCS=(
101
+		README ChangeLog INSTALL TODO NEWS* patchlevel.h
102
+		doc/{FAQ,README.DOTSCREEN,fdpat.ps,window_to_display.ps}
103
+	)
104
+
105
+	emake DESTDIR="${D}" SCREEN="${P}" install
106
+
107
+	local tmpfiles_perms tmpfiles_group
108
+
109
+	if use multiuser || use prefix ; then
110
+		fperms 4755 /usr/bin/${P}
111
+		tmpfiles_perms="0755"
112
+		tmpfiles_group="root"
113
+	else
114
+		fowners root:utmp /usr/bin/${P}
115
+		fperms 2755 /usr/bin/${P}
116
+		tmpfiles_perms="0775"
117
+		tmpfiles_group="utmp"
118
+	fi
119
+
120
+	newtmpfiles - screen.conf <<<"d /tmp/screen ${tmpfiles_perms} root ${tmpfiles_group}"
121
+
122
+	insinto /usr/share/${PN}
123
+	doins terminfo/{screencap,screeninfo.src}
124
+
125
+	insinto /etc
126
+	doins "${FILESDIR}"/screenrc
127
+
128
+	if use pam; then
129
+		pamd_mimic_system screen auth
130
+	fi
131
+
132
+	dodoc "${DOCS[@]}"
133
+}
134
+
135
+pkg_postinst() {
136
+	if [[ -z ${REPLACING_VERSIONS} ]]; then
137
+		elog "Some dangerous key bindings have been removed or changed to more safe values."
138
+		elog "We enable some xterm hacks in our default screenrc, which might break some"
139
+		elog "applications. Please check /etc/screenrc for information on these changes."
140
+	fi
141
+
142
+	tmpfiles_process screen.conf
143
+
144
+	ewarn "This revision changes the screen socket location to ${EROOT}/tmp/${PN}"
145
+}
0 146