# Template file for 'bash'
pkgname=bash
version=5.2.32
revision=1
build_style=gnu-configure
configure_args="--without-bash-malloc --with-curses --without-installed-readline"
make_build_args="TERMCAP_LIB=${XBPS_CROSS_BASE}/usr/lib/libncursesw.a"
make_check_target=tests
hostmakedepends="bison"
makedepends="ncurses-devel"
checkdepends="perl"
short_desc="GNU Bourne Again Shell"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-3.0-or-later"
homepage="https://www.gnu.org/software/bash/bash.html"
distfiles="${GNU_SITE}/bash/bash-${version}.tar.gz"
checksum=d3ef80d2b67d8cbbe4d3265c63a72c46f9b278ead6e0e06d61801b58f23f50b5

make_dirs="/etc/bash/bashrc.d 755 root root"
conflicts="chroot-bash>=0"
register_shell="/usr/bin/bash /bin/bash"

alternatives="
 sh:sh:/usr/bin/bash
 sh:sh.1:/usr/share/man/man1/bash.1"

CFLAGS="-DSSH_SOURCE_BASHRC -DNON_INTERACTIVE_LOGIN_SHELLS -DSYS_BASHRC='\"/etc/bash/bashrc\"'"

post_install() {
	rm -r ${DESTDIR}/usr/share/doc
	ln -s bash ${DESTDIR}/usr/bin/rbash
	vinstall ${FILESDIR}/bashrc 644 etc/bash
	vinstall ${FILESDIR}/bash.sh 644 etc/profile.d
}

bash-devel_package() {
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/bash
		vmove usr/lib/pkgconfig
	}
}
