1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 [[ "${PV}" = 9999 ]] && SCM="git-r3"
8 inherit autotools eutils flag-o-matic pam toolchain-funcs user ${SCM}
11 DESCRIPTION="screen manager with VT100/ANSI terminal emulation"
12 HOMEPAGE="https://www.gnu.org/software/screen/"
14 if [[ "${PV}" != 9999 ]] ; then
15 SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
16 KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
18 EGIT_REPO_URI="git://git.savannah.gnu.org/screen.git"
19 EGIT_CHECKOUT_DIR="${WORKDIR}/${P}" # needed for setting S later on
20 S="${WORKDIR}"/${P}/src
25 IUSE="debug nethack pam selinux multiuser"
28 >=sys-libs/ncurses-5.2:0=
31 selinux? ( sec-policy/selinux-screen )"
36 # Don't use utempter even if it is found on the system.
37 "${FILESDIR}"/${PN}-4.3.0-no-utempter.patch
41 # Make sure utmp group exists, as it's used later on.
48 # sched.h is a system header and causes problems with some C libraries
49 mv sched.h _sched.h || die
50 sed -i '/include/ s:sched.h:_sched.h:' screen.h || die
54 -e "s:/usr/local/etc/screenrc:${EPREFIX}/etc/screenrc:g" \
55 -e "s:/usr/local/screens:${EPREFIX}/tmp/screen:g" \
56 -e "s:/local/etc/screenrc:${EPREFIX}/etc/screenrc:g" \
57 -e "s:/etc/utmp:${EPREFIX}/var/run/utmp:g" \
58 -e "s:/local/screens/S\\\-:${EPREFIX}/tmp/screen/S\\\-:g" \
62 if [[ ${CHOST} == *-darwin* ]] ; then
63 sed -i -e '/^#define UTMPOK/s/define/undef/' acconfig.h || die
71 append-cppflags "-DMAXWIN=${MAX_SCREEN_WINDOWS:-100}"
73 if [[ ${CHOST} == *-solaris* ]] ; then
74 # enable msg_header by upping the feature standard compatible
76 append-cppflags -D_XOPEN_SOURCE=600
79 use nethack || append-cppflags "-DNONETHACK"
80 use debug && append-cppflags "-DDEBUG"
83 --with-socket-dir="${EPREFIX}/tmp/screen" \
84 --with-sys-screenrc="${EPREFIX}/etc/screenrc" \
85 --with-pty-mode=0620 \
94 LC_ALL=POSIX emake comm.h term.h
97 emake -C doc screen.info
103 README ChangeLog INSTALL TODO NEWS* patchlevel.h
104 doc/{FAQ,README.DOTSCREEN,fdpat.ps,window_to_display.ps}
109 local tmpfiles_perms tmpfiles_group
111 if use multiuser || use prefix
113 fperms 4755 /usr/bin/screen-${PV}
114 tmpfiles_perms="0755"
115 tmpfiles_group="root"
117 fowners root:utmp /usr/bin/screen-${PV}
118 fperms 2755 /usr/bin/screen-${PV}
119 tmpfiles_perms="0775"
120 tmpfiles_group="utmp"
123 dodir /etc/tmpfiles.d
124 echo "d /tmp/screen ${tmpfiles_perms} root ${tmpfiles_group}" \
125 > "${ED}"/etc/tmpfiles.d/screen.conf
127 insinto /usr/share/screen
128 doins terminfo/{screencap,screeninfo.src}
131 doins "${FILESDIR}"/screenrc
133 pamd_mimic_system screen auth
137 if [[ -z ${REPLACING_VERSIONS} ]]
139 elog "Some dangerous key bindings have been removed or changed to more safe values."
140 elog "We enable some xterm hacks in our default screenrc, which might break some"
141 elog "applications. Please check /etc/screenrc for information on these changes."
144 # Add /tmp/screen in case it doesn't exist yet. This should solve
145 # problems like bug #508634 where tmpfiles.d isn't in effect.
146 local rundir="${EROOT%/}/tmp/screen"
147 if [[ ! -d ${rundir} ]] ; then
148 if use multiuser || use prefix ; then
149 tmpfiles_group="root"
151 tmpfiles_group="utmp"
153 mkdir -m 0775 "${rundir}"
154 chgrp ${tmpfiles_group} "${rundir}"
157 ewarn "This revision changes the screen socket location to ${rundir}"