# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           xcode 1.0

name                namebench
version             1.3.1
revision            3
categories          aqua sysutils
platforms           darwin
license             Apache-2
maintainers         nomaintainer

description         DNS speed benchmark tool (GUI)
long_description    namebench hunts down the fastest DNS servers \
                    available for your computer. namebench runs a fair \
                    and thorough benchmark using your web browser \
                    history, tcpdump output, or standardized datasets \
                    in order to provide an individualized recommendation. \
                    This port installs the Cocoa GUI interface. To \
                    install just the command line interface, which the \
                    Cocoa GUI interface depends on, install the \
                    "py27-libnamebench" port.
homepage            https://code.google.com/p/namebench/

set python.version  27
set python.branch   2.7
depends_lib-append      port:py${python.version}-libnamebench \
                        port:py${python.version}-pyobjc \
                        port:py${python.version}-pyobjc-cocoa

master_sites        googlecode:${name}
distname            ${name}-${version}-source
extract.suffix      .tgz
checksums           rmd160  93d1186caf2a214ecf1966ee798f01d329ecfd64 \
                    sha256  30ccf9e870c1174c6bf02fca488f62bba280203a0b1e8e4d26f3756e1a5b9425

worksrcdir          ${name}-${version}/cocoa

patchfiles          project.diff patch-main.m.diff
post-patch {
    reinplace "s|/usr/bin/python|${prefix}/bin/python${python.branch}|g" \
            ${worksrcpath}/main.m
    reinplace "s|@FRAMEWORKS_DIR@|${frameworks_dir}|g" \
            ${worksrcpath}/namebench.xcodeproj/project.pbxproj
    reinplace "s|@PYTHON_VERSION@|${python.branch}|g" \
            ${worksrcpath}/namebench.xcodeproj/project.pbxproj
}
