# -*- 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
# $Id: Portfile 112865 2013-11-03 02:28:23Z ryandesign@macports.org $

PortSystem          1.0
PortGroup           xcode 1.0

name                namebench
version             1.3.1
revision            1
categories          aqua sysutils
maintainers         nomaintainer
license             Apache-2
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            http://code.google.com/p/namebench/
platforms           darwin
master_sites        googlecode:${name}
distname            ${name}-${version}-source
extract.suffix      .tgz
worksrcdir          ${name}-${version}/cocoa
checksums           rmd160  93d1186caf2a214ecf1966ee798f01d329ecfd64 \
                    sha256  30ccf9e870c1174c6bf02fca488f62bba280203a0b1e8e4d26f3756e1a5b9425

patchfiles          project.diff patch-main.m.diff

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

set py ""
variant python25 conflicts python26 python27 {
    set py              2.5
    depends_lib-append  port:py25-libnamebench port:py25-pyobjc port:py25-pyobjc-cocoa
}
variant python26 conflicts python25 python27 {
    set py              2.6
    depends_lib-append  port:py26-libnamebench port:py26-pyobjc port:py26-pyobjc-cocoa
}
variant python27 conflicts python25 python26 {
    set py              2.7
    depends_lib-append  port:py27-libnamebench port:py27-pyobjc port:py27-pyobjc-cocoa
}
if {![variant_isset python25] && ![variant_isset python26] && ![variant_isset python27]} {
    default_variants    +python27
}
