# Maintainer: Markus M. May <triplem@tu.archserver.org>
# Contributor: Aaron Griffin <aaron@archlinux.org>
# Contributor: dorphell <dorphell@archlinux.org>

pkgname=fetchmail
pkgver=6.3.17
pkgrel=2
pkgdesc="A remote-mail retrieval utility"
url="http://fetchmail.berlios.de/"
arch=('i686' 'x86_64')
depends=('glibc' 'openssl' 'python2')
optdepends=('tk: fetchmailconf')
options=('!makeflags')
license=('GPL')
install=fetchmail.install
source=(http://download2.berlios.de/fetchmail/$pkgname-$pkgver.tar.bz2
        fetchmail.rc 
        fetchmail.conf)
md5sums=('7b1d449ecddb6164e22c32854adc4a75'
         'b5f4d1da0c61d3d8a93fdf4e238f4949'
         '8fcd6a22dfbc247755fdd050c5c5c4d3')

build() {
  cd $srcdir/$pkgname-$pkgver

  ./configure --prefix=/usr --with-ssl=/usr
  make || return 1
}

package() {
  cd $srcdir/$pkgname-$pkgver
  make DESTDIR=$pkgdir install

  install -Dm755 $srcdir/fetchmail.rc $pkgdir/etc/rc.d/fetchmail
  install -Dm644 $srcdir/fetchmail.conf $pkgdir/etc/conf.d/fetchmail

  # "home" directory for pid file.
  install -d -o 90 -g nobody -m700 $pkgdir/var/run/fetchmail
}
