description="Widely used protocol for monitoring the health and welfare of network equipment."
url="http://www.net-snmp.org/"

contributors="Pierre B, Greg"
packager="tnut <tnut@nutyx.org>"

makedepends=(automake autoconf m4 libtool
             libnl openssl pciutils)

run=(python perl)

name=net-snmp
version=5.9.1
release=5

source=(http://downloads.sourceforge.net/$name/$name-$version.tar.gz)

build() {

unset MAKEFLAGS

cd $name-$version

autoreconf -i

./configure --prefix=/usr \
    --sysconfdir=/etc --sbindir=/usr/bin \
    --mandir=/usr/share/man \
    --enable-ucd-snmp-compatibility \
    --enable-ipv6 \
    --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

sed -i -e "s:install --basedir=\$\$dir:install --basedir=\$\$dir --root=$PKG:" Makefile

make DESTDIR=$PKG INSTALL_PREFIX=$PKG INSTALLDIRS=vendor install
# Remove perllocal.pod and .packlist if present in the package
for i in perllocal.pod .packlist; do
   find $PKG -name "$i" -exec rm -rf {} \;
done

# Obsolets libs
rm $PKG/usr/lib/libnetsnmp.la
rm $PKG/usr/lib/libnetsnmpagent.la
rm $PKG/usr/lib/libnetsnmphelpers.la
rm $PKG/usr/lib/libnetsnmpmibs.la
rm $PKG/usr/lib/libnetsnmptrapd.la
rm $PKG/usr/lib/libsnmp.la

}
