NAME="mutt"
DESC="Mail User Agent"
VERSION="2.2.11"
FILES=("https://bitbucket.org/mutt/mutt/downloads/mutt-$VERSION.tar.gz")
HASHES=("0c3691cff3fd0471bfcad2bd8ad84949")
DEPENDS=(
  "aspell" "gnupg" "gnutls" "gpgme" 
  "libidn2" "slang" "sqlite" 
)

PACKAGE() {
  tar xf $NAME-$VERSION.tar.gz
  cd $NAME-$VERSION

  sed  -e 's/ -with_backspaces//'          \
     -e 's/elinks/links/'                  \
     -e 's/-no-numbering -no-references//' \
     -i doc/Makefile.in

  ./configure --prefix=/usr                            \
            --sysconfdir=/etc                          \
            --with-docdir=/usr/share/doc/mutt-$VERSION \
            --with-ssl                                 \
            --enable-external-dotlock                  \
            --enable-pop                               \
            --enable-imap                              \
            --enable-hcache                            \
            --enable-sidebar
  make && make DESTDIR="$ROOTDIR" install

  cd .. && rm -r $NAME-$VERSION
}

INSTALL(){
  groupadd -g 34 mail
  chgrp -v mail /var/mail
  chown root:mail /usr/bin/mutt_dotlock
  chmod -v 2755 /usr/bin/mutt_dotlock
  exit 0
}
