### this file is sourced not run
PKGVER=4.9.0
PKGBUILD=1
PKGARCH=x86_64

# BLFS 11.3
TARBALL=screen-$PKGVER.tar.gz
MD5SUM=b1ef8ed89134d335e614016634982b6d
SRC_URL=http://ftp.gnu.org/gnu/screen/$TARBALL
BUNDLE=

SLACKREQ=libncurses
SLACKDESC="screen: screen $PKGVER (Terminal multiplexor)  
screen:  
screen: Screen is a terminal multiplexor that runs several separate processes, 
screen: typically interactive shells, on a single physical character-based 
screen: terminal. Each virtual terminal emulates a DEC VT100 plus several ANSI 
screen: X3.64 and ISO 2022 functions and also provides configurable input and 
screen: output translation, serial port support, configurable logging, 
screen: multi-user support, and many character encodings, including UTF-8. 
screen: Screen sessions can be detached and resumed later on a different 
screen: terminal.  
screen: https://www.gnu.org/software/screen/
"

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	cd /tmp/screen*
	
	CONFFLAGS="$CONFFLAGS
		--infodir=/usr/share/info         \
		--mandir=/usr/share/man           \
		--with-socket-dir=/var/run/screen \
		--with-pty-group=3                \
		--with-sys-screenrc=/etc/screenrc"

	./autogen.sh &&		
	./configure $CONFFLAGS &&
	
	# LFS 7.5 patch
	sed -i -e "s%/usr/local/etc/screenrc%/etc/screenrc%" {etc,doc}/* &&
	
	make $MAKEFLAGS && make $MAKEINSTALLFLAGS install &&
	install -m 644 etc/etcscreenrc /etc/screenrc &&
	pkg_build_slackdesc &&
	
	# add status to xterm window title
	echo 'hardstatus string "[screen %n%?: %t%?] %h"' >> /etc/screenrc &&
	echo 'startup_message off' >> /etc/screenrc
}
