Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app-misc/screen/Manifest
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
DIST screen-5.0.0.tar.gz 895882 BLAKE2B 5ff218afc1692ae201776f759ff2217a51dcf02202e4ba5d12de50a768df83e0e2a7a3511a5f85a3b21362892f31a4fd90d6444918915165ae12a8c0c2b3af39 SHA512 18a163313025c58950ec65fa83037ba1df0fa8e2346925593217fb0a6596f2f51914a4f0aec7f0e1c280d3d3ef964e7a886521f41f4b96f4ff08935be7f62117
DIST screen-5.0.1.tar.gz 897507 BLAKE2B ce8478718903ea4f9f7d5de2c77008cee304fef1065f3d564844844cb3ba7acb88bfe2cda051cecee0f034b19ea4e52a0fcc1549f9339eac33e7748ab59cd0f5 SHA512 9bda35689d73a816515df30f50101531cf3af8906cb47f086d1f97c464cb729f4ee6e3d4aca220acc4c6125d81e923ee3a11fb3a85fe6994002bf1e0f3cc46fb
142 changes: 142 additions & 0 deletions app-misc/screen/screen-5.0.1-r1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit autotools flag-o-matic pam tmpfiles

DESCRIPTION="screen manager with VT100/ANSI terminal emulation"
HOMEPAGE="https://www.gnu.org/software/screen/"

SRC_URI="https://ftp.gnu.org/gnu/screen/screen-5.0.1.tar.gz -> screen-5.0.1.tar.gz
"
KEYWORDS="*"

LICENSE="GPL-2"
SLOT="0"
IUSE="debug nethack pam selinux multiuser"

# Don't need this depdency until we support musl, at which point we'll need to create virtual/libcrypt
# virtual/libcrypt:=
DEPEND=">=sys-libs/ncurses-5.2:=
pam? ( sys-libs/pam )"
RDEPEND="${DEPEND}
selinux? ( sec-policy/selinux-screen )"
BDEPEND=">=sys-apps/texinfo-7"

PATCHES=(
# Don't use utempter even if it is found on the system.
"${FILESDIR}"/${PN}-no-utempter.patch
)

pkg_setup() {
enewgroup utmp
}

src_prepare() {
default

# sched.h is a system header and causes problems with some C libraries
mv sched.h _sched.h || die
sed -i '/include/ s:sched\.h:_sched.h:' \
screen.h winmsg.c window.h sched.c canvas.h || die
sed -i 's@[[:space:]]sched\.h@ _sched.h@' Makefile.in || die

# Fix manpage
sed -i \
-e "s:/usr/local/etc/screenrc:${EPREFIX}/etc/screenrc:g" \
-e "s:/usr/local/screens:${EPREFIX}/tmp/screen:g" \
-e "s:/local/etc/screenrc:${EPREFIX}/etc/screenrc:g" \
-e "s:/etc/utmp:${EPREFIX}/var/run/utmp:g" \
-e "s:/local/screens/S\\\-:${EPREFIX}/tmp/screen/S\\\-:g" \
doc/screen.1 || die

if [[ ${CHOST} == *-darwin* ]] || use elibc_musl; then
sed -i -e '/^#define UTMPOK/s/define/undef/' acconfig.h || die
fi

# disable musl dummy headers for utmp[x]
use elibc_musl && append-cppflags "-D_UTMP_H -D_UTMPX_H"

# reconfigure
eautoreconf
}

src_configure() {
append-cppflags "-DMAXWIN=${MAX_SCREEN_WINDOWS:-100}"

if [[ ${CHOST} == *-solaris* ]]; then
# enable msg_header by upping the feature standard compatible
# with c99 mode
append-cppflags -D_XOPEN_SOURCE=600
fi

use nethack || append-cppflags "-DNONETHACK"
use debug && append-cppflags "-DDEBUG"

local myeconfargs=(
--with-socket-dir="${EPREFIX}/tmp/${PN}"
--with-sys-screenrc="${EPREFIX}/etc/screenrc"
--with-pty-mode=0620
--with-pty-group=5
--enable-rxvt_osc
--enable-telnet
--enable-colors256
$(use_enable pam)
)
econf "${myeconfargs[@]}"
}

src_compile() {
LC_ALL=POSIX emake comm.h term.h

emake -C doc screen.texinfo
default
}

src_install() {
local DOCS=(
README ChangeLog INSTALL TODO NEWS*
doc/{FAQ,README.DOTSCREEN,fdpat.ps,window_to_display.ps}
)

emake DESTDIR="${D}" SCREEN="${P}" install

local tmpfiles_perms tmpfiles_group

if use multiuser || use prefix ; then
fperms 4755 /usr/bin/${P}
tmpfiles_perms="0755"
tmpfiles_group="root"
else
fowners root:utmp /usr/bin/${P}
fperms 2755 /usr/bin/${P}
tmpfiles_perms="0775"
tmpfiles_group="utmp"
fi

newtmpfiles - screen.conf <<<"d /tmp/screen ${tmpfiles_perms} root ${tmpfiles_group}"

insinto /usr/share/${PN}
doins terminfo/{screencap,screeninfo.src}

insinto /etc
doins "${FILESDIR}"/screenrc

if use pam; then
pamd_mimic_system screen auth
fi

dodoc "${DOCS[@]}"
}

pkg_postinst() {
if [[ -z ${REPLACING_VERSIONS} ]]; then
elog "Some dangerous key bindings have been removed or changed to more safe values."
elog "We enable some xterm hacks in our default screenrc, which might break some"
elog "applications. Please check /etc/screenrc for information on these changes."
fi

tmpfiles_process screen.conf

ewarn "This revision changes the screen socket location to ${EROOT}/tmp/${PN}"
}
Loading