# Template file for 'alpine'
pkgname=alpine
version=2.29.99
revision=1
_githash=34b9e53aa92b04cf96920001b4eb4a180f8fe263
_gitshort="${_githash:0:7}"
build_style=gnu-configure
configure_args="--with-passfile=.pine-passfile --without-tcl --disable-shared
 --with-ssl-dir=${XBPS_CROSS_BASE}/usr
 --with-system-pinerc=/etc/${pkgname}.d/pine.conf
 --with-system-fixed-pinerc=/etc/${pkgname}.d/pine.conf.fixed"
hostmakedepends="hunspell wget"
makedepends="gettext-devel libldap-devel mit-krb5-devel ncurses-devel"
short_desc="Apache-licensed PINE mail user agent (with Chappa patches)"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="Apache-2.0, BSD-4-Clause"
homepage="https://repo.or.cz/alpine.git"
distfiles="https://repo.or.cz/alpine.git/snapshot/${_githash}.tar.gz"
checksum=5a6b7f33e02ae8c6120ba17d2a65b8b7f84058c89b9bf6bdafc6e0369c252f4c
# weird fail with openssl3 otherwise
disable_parallel_build=yes

# repo.or.cz sends xbps-fetch into Anubis
fetch_cmd="wget"

if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then
	makedepends+=" libxcrypt-devel"
fi

post_extract() {
	sed -i -e '/run test program/s/^/: /' \
		-e 's/linux-gnu/linux-/g' ${wrksrc}/configure
	touch /etc/shadow   # bleh
}

do_build() {
	make -C pith help_c_gen help_h_gen \
		CC="$BUILD_CC" CFLAGS="$BUILD_CFLAGS" CPPFLAGS= LDFLAGS="$BUILD_LDFLAGS"
	make ${makejobs} all CC="$CC"
}

post_install() {
	vlicense NOTICE
}
