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

# BLFS 7.5 updated to version latest
TARBALL=screen-$PKGVER.tar.gz
MD5SUM=5bb3b0ff2674e29378c31ad3411170ad
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:
"

### 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"	
	./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
}
