# $Id: Portfile 92026 2012-04-16 13:12:12Z jmr@macports.org $

PortSystem 1.0
PortGroup python 1.0

name			py-snmp
version			4.2.1
categories		python net
license			BSD
maintainers		gmail.com:valyukov openmaintainer
platforms		darwin freebsd
supported_archs	noarch
description		SNMP v.1 engine for python
long_description	PySNMP is fully functional SNMP v.1 engine (BER \
				encoders/decoders for a subset of ASN.1 data types, sockets \
				based networking etc.) written entirely in python.

homepage		http://pysnmp.sourceforge.net/
master_sites	sourceforge:project/pysnmp/pysnmp/${version}
                
distname		pysnmp-${version}
checksums		md5 236ec11a4df82d63945132306c31ea0f \
                sha1 2f87cab6a2e87c8c258072913a2dbeea1db3227b \
                rmd160 b451841eef1c5b5a9274b923c3b1f8c1a131ab29

python.versions 24 25 26 27 31 32

if {$subport != $name} {
    depends_lib-append  port:py${python.version}-asn1 \
                        port:py${python.version}-crypto
    post-destroot	{
        file delete -force ${destroot}${prefix}/share/doc/${subport}
        file copy ${worksrcpath}/docs ${destroot}${prefix}/share/doc/${subport}
        file copy ${worksrcpath}/examples ${destroot}${prefix}/share/doc/${subport}
        if {${python.version} <= 25} {
            move ${destroot}${prefix}/bin/build-pysnmp-mib ${destroot}${prefix}/bin/build-pysnmp-mib-${python.branch}
            move ${destroot}${prefix}/bin/libsmi2pysnmp ${destroot}${prefix}/bin/libsmi2pysnmp-${python.branch}
        }
    }
}
