# Description: Text-based email client that sucks less
# URL: http://www.mutt.org
# Maintainer: Juergen Daubert, jue at crux dot nu
# Depends on: gdbm openssl zlib
# Optional: cyrus-sasl gpgme libidn2

name=mutt
version=2.2.13
release=1
source=(https://bitbucket.org/mutt/mutt/downloads/$name-$version.tar.gz)

build() {
	cd $name-$version

	prt-get isinst gpgme && PKGMK_MUTT+=' --enable-gpgme'
	prt-get isinst cyrus-sasl && PKGMK_MUTT+=' --enable-smtp --with-sasl'
	prt-get isinst libidn2 && PKGMK_MUTT+=' --with-idn2'

	./configure $PKGMK_MUTT \
		--prefix=/usr \
		--with-mailpath=/var/spool/mail \
		--enable-pop \
		--enable-imap \
		--enable-hcache \
		--enable-sidebar \
		--disable-nls \
		--with-ssl

	make
	make DESTDIR=$PKG install

	rm $PKG/usr/etc/{Muttrc,mime.types}.dist 
	rm -r $PKG/usr/share/{doc,info}
	rm $PKG/usr/share/man/man5/{mmdf.5,mbox.5}
}
