# $Id: Portfile 102584 2013-02-05 04:25:13Z larryv@macports.org $

PortSystem 1.0
PortGroup python 1.0

name			py-rt
version			2.5
categories-append	net
license			GPL-2+
platforms		darwin
supported_archs	noarch
maintainers		nomaintainer
description		Python Routeing Toolkit
long_description	The Python Routeing Toolkit enables routeing information \
				in a network to be collected.

homepage		https://ipmon.sprintlabs.com/pyrt/
master_sites	${homepage}results/
fetch.ignore_sslcert yes
distname		pyrt-${version}
checksums		md5 ea7322d0e942f819fb55939f64f92b1c

python.versions	24

if {$subport != $name} {
    pre-extract {
        file mkdir ${worksrcpath}/rt
        file copy ${filespath}/setup.py ${worksrcpath}
        system "touch ${worksrcpath}/rt/__init__.py"
    }
    extract.dir		${worksrcpath}/rt

    patch {
        reinplace "s|__VERSION__|${version}|g" ${worksrcpath}/setup.py
        reinplace "s| /usr/bin/env python2|${python.bin}|g" ${worksrcpath}/rt/bgp.py ${worksrcpath}/rt/isis.py
    }

    post-destroot {
        xinstall -m 644 -W ${worksrcpath}/rt COPYING ChangeLog README README.mrtd \
            README.rv VERSION ${destroot}${prefix}/share/doc/${subport}
    }
}
