PKGNAME=net-snmp
PKGSEC=net
PKGDEP="python-3 openssl libnl pciutils perl-term-readkey libnsl2"
PKGDEP__RETRO="openssl libnl libnsl2"
PKGDEP__ARMV4="${PKGDEP__RETRO}"
PKGDEP__ARMV6HF="${PKGDEP__RETRO}"
PKGDEP__ARMV7HF="${PKGDEP__RETRO}"
PKGDEP__I486="${PKGDEP__RETRO}"
PKGDEP__LOONGSON2F="${PKGDEP__RETRO}"
PKGDEP__M68K="${PKGDEP__RETRO}"
PKGDEP__POWERPC="${PKGDEP__RETRO}"
PKGDEP__PPC64="${PKGDEP__RETRO}"
PKGDES="Suite of applications to implement SNMP v1, SNMPv2c and SNMPv3 using both IPv4 and IPv6"

# FIXME: Fails to build with shadow build enabled.
#
# /bin/sh: line 1: cd: python: No such file or directory
# /usr/bin/python3: can't open file '[...]/net-snmp-5.9.4/abbuild/setup.py': [Errno 2] No such file or directory
ABSHADOW=0

# FIXME: Fails during installation.
#
# /usr/bin/ld: /tmp/[...].ltrans14.ltrans.o:[...]/net-snmp-5.9.4/agent/../agent/mibgroup/mib_module_shutdown.h:3:(.text+0x6d8c): undefined reference to `should_init'
# /usr/bin/ld: /tmp/[...].ltrans14.ltrans.o:[...]/net-snmp-5.9.4/agent/../agent/mibgroup/mib_module_shutdown.h:4:(.text+0x6da0): undefined reference to `should_init'
# /usr/bin/ld: /tmp/[...].ltrans14.ltrans.o:[...]/net-snmp-5.9.4/agent/../agent/mibgroup/mib_module_shutdown.h:5:(.text+0x6db4): undefined reference to `should_init'
# /usr/bin/ld: /tmp/[...].ltrans14.ltrans.o:[...]/net-snmp-5.9.4/agent/../agent/mibgroup/mib_module_shutdown.h:6:(.text+0x6dc8): undefined reference to `should_init'
# /usr/bin/ld: /tmp/[...].ltrans14.ltrans.o:[...]/net-snmp-5.9.4/agent/../agent/mibgroup/mib_module_shutdown.h:7: more undefined references to `should_init' follow
NOPARALLEL=1

ABTYPE=autotools
AUTOTOOLS_AFTER=(
    '--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-persistent-directory=/var/net-snmp'
    '--with-pic'
    '--enable-as-needed'
    '--sbindir=/usr/bin'
)
AUTOTOOLS_AFTER__RETRO=(
    "${AUTOTOOLS_AFTER[@]}"
    '--without-python-modules'
)

ABMK=(
    'NETSNMP_DONT_CHECK_VERSION=1'
)
MAKE_AFTER=(
    "INSTALL_PREFIX=$PKGDIR"
    'INSTALLDIRS=vendor'
)

PKGBREAK="hplip<=2:3.25.8-2 lldpd<=1.0.17 nut<=2.7.4-4 openipmi<=2.0.37-2 php<=1:8.5.1 \
        quagga<=1.2.4-5 sane-backends<=1.4.0-1 tdeutils<=14.1.5"

# Needed by Afterglow, whereas FAIL_ARCH defaults to mainline-only.
FAIL_ARCH="!(mainline|retro)"
