# $Id: PKGBUILD 56503 2009-10-22 05:26:42Z eric $
# Maintainer: Eric Belanger <eric@archlinux.org>
# Contributor: Dale Blount <dale@archlinux.org>

pkgname=net-snmp
pkgver=5.4.2.1
pkgrel=2
pkgdesc="A suite of applications used to implement SNMP v1, SNMP v2c and SNMP v3 using both IPv4 and IPv6"
arch=('i686' 'x86_64')
url="http://www.net-snmp.org/"
license=('custom')
depends=('openssl' 'tcp_wrappers')
makedepends=('setuptools')
optdepends=('perl-term-readkey: for snmpcheck application' 'perl-tk: for snmpcheck application')
provides=('ucd-snmp')
options=('!libtool' '!makeflags' '!emptydirs')
source=(http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tar.gz \
	snmpd.rc)
md5sums=('984932520143f0c8bf7b7ce1fc9e1da1' '9f0d13676ba1fae1eb7eb178edd85b43')
sha1sums=('4f2df9ea62344fe840f493d0e08abe5de3697862' '2c679b564a2c319d9ce2714a9776aa0e6d89c60a')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  sed -i -e "s:\(install --basedir=\$\$dir\):\1 --root='${pkgdir}':" Makefile.in
   ./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man \
    --enable-ucd-snmp-compatibility --with-libwrap --with-python-modules \
    --with-default-snmp-version="3" --with-sys-contact="root@localhost" \
    --with-sys-location="Unknown" --with-logfile="/var/log/snmpd.log" \
    --with-mib-modules="host misc/ipfwacc ucd-snmp/diskio tunnel ucd-snmp/dlmod" \
    --with-persistent-directory="/var/net-snmp"
  make NETSNMP_DONT_CHECK_VERSION=1
  make DESTDIR="${pkgdir}" INSTALL_PREFIX="${pkgdir}" INSTALLDIRS=vendor install
  install -D -m755 "${srcdir}/snmpd.rc" "${pkgdir}/etc/rc.d/snmpd"
  install -D -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
}
