# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer:
pkgname=neomutt
pkgver=20171208
pkgrel=0
pkgdesc="Mutt with miscellaneous fixes and feature patches"
url="https://www.neomutt.org/"
arch="all"
license="GPL-2.0"
depends=""
depends_dev=""
makedepends="automake autoconf cyrus-sasl-dev gdbm-dev gettext-dev
	gpgme-dev libidn-dev ncurses-dev libressl-dev notmuch-dev
	bsd-compat-headers"
install=""
subpackages="$pkgname-doc $pkgname-lang"
options="!check"
source="$pkgname-$pkgver.tar.gz::https://github.com/$pkgname/$pkgname/archive/$pkgname-$pkgver.tar.gz
	Makefile-am.patch"
builddir="$srcdir/$pkgname-$pkgname-$pkgver"

prepare() {
	default_prepare

	cd "$builddir"
	autoreconf -vfi
}

build() {
	cd "$builddir"
	./configure -enable-notmuch -enable-gpgme \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-docdir=/usr/share/doc/$pkgname \
		--with-mailpath=/var/spool/mail \
		--with-gdbm \
		--with-ssl \
		--with-sasl
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	install -Dm644 contrib/gpg.rc \
		"$pkgdir"/usr/share/doc/$pkgname/examples/Muttrc.gpg
}

sha512sums="e4f8a5f01d96d6f82959fe583634585deee28cf146c768e5049281b273c5b76b91ee01c9d9382a26f72a092c14341905129e73bf5c6ba19baae7823bc6680671  neomutt-20171208.tar.gz
74f38efb63d63e222d351c20624830b4beea122a4d530f8100bddf38821d56d1a6f0017330b167451f1eae5a612e23b08676371352230da28d512e99e77ffe56  Makefile-am.patch"
