# Contributor: Isaac Dunham <ibid.ag@gmail.com>
# Maintainer: Isaac Dunham <ibid.ag@gmail.com>
pkgname=heirloom-mailx
pkgver=12.4
pkgrel=4
pkgdesc="A free clone of SysV mailx"
url="http://heirloom.sourceforge.net/mailx.html"
arch="all"
license="BSD"
makedepends="libressl-dev krb5-dev"
subpackages="$pkgname-doc"
source="https://sourceforge.net/projects/heirloom/files/heirloom-mailx/$pkgver/mailx-$pkgver.tar.bz2
	12.4-to-12.5pre.patch
	makevars.patch
	0001-outof-Introduce-expandaddr-flag.patch
	0002-unpack-Disable-option-processing-for-email-addresses.patch
	0003-fio_c-Unconditionally-require-wordexp-support.patch
	0004-globname-Invoke-wordexp-with-WRDE_NOCMD-CVE-2004-277.patch
	libressl.patch
	"

builddir="$srcdir"/mailx-$pkgver

build() {
	cd "$builddir"
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	install -Dm 0644 COPYING "$pkgdir"/usr/share/licenses/"$pkgname"/COPYING
	cd "$pkgdir"/usr/share/man/man1/ && mv mailx.1 "$pkgname".1
}

sha512sums="a0e29972f552bd630ce1a14f70e61661815118520bcd4a00b6cad53f3270d3d08c835ff6982ba8800eb380a5b46f54eb6e60fb7533b5f41c916af45d29605af8  mailx-12.4.tar.bz2
c2435c18b3e972a77bbaa1b915cae567cafcd65cba1710cd78e7b934d33662361aa1e72fb99d0f109945c603ec847552345a4a5c3ec64dbc307cbb811a6d74d0  12.4-to-12.5pre.patch
b831544e92b0262b6d5276cb7e78427cb33fd09bc3cb2ffc398cb3f930f05764bcecc8e5b1743554dadc5e0bd791d56b4a72b7a05089db7170437dd5254b9080  makevars.patch
fc5a22bf17e998c5228ff581388a3e2f8ffad9c70b46f7e94edc63d304e5e9576b59c57df07dc7e40cf234fc8b89bf2c52248592ad834fc4b4d29e25a673edc8  0001-outof-Introduce-expandaddr-flag.patch
b10a5ec515ba447e828dbf4562b07b65bc2c812f0d731b244f77cc43152bf14200e40d218ebb080fd820dc18ed4666c4f66de579b562a9231d8a0e95b4c0bb25  0002-unpack-Disable-option-processing-for-email-addresses.patch
c41ad1e90ebc6060ce0a7badfde5fc01b87c4c0c9eacf7e2f55444212cbd93097b37a3e426bcdcb4a565c1b0d16010996d9aca1d61c0d918a1d4acb41754d516  0003-fio_c-Unconditionally-require-wordexp-support.patch
bee2afb9f691a5c7b715eaa9adb14afbde0694235bb22449741f464812276c3f44d1b90e8b07255d1378b941d2b14133161a1575c40605b0911d8e28afaf578a  0004-globname-Invoke-wordexp-with-WRDE_NOCMD-CVE-2004-277.patch
54e71f2590760305f7a4a8cb934b01659d4b844e181271312f11c445d8f854e7c57815b3fee3ad53db0ef0bdc8341863573dd5c4ac3ca0df48137ab20bd2cf4b  libressl.patch"
