# $Id: Portfile 103926 2013-03-10 07:18:50Z ryandesign@macports.org $

PortSystem      1.0
PortGroup           github 1.0
PortGroup       xcode 1.0

github.setup        karelia CurlHandle 3.1.1 v
name            curlhandle
set my_name     CURLHandle
categories      devel framework
maintainers     nomaintainer
license             public-domain

description         CURLHandle is a framework wrapper around cURL

long_description \
    ${description}

checksums           rmd160  b51edd914a5d8ca06d3244315e44196b1c149a61 \
                    sha256  a6830387b2b869de112b7da260b83ad8ed46cb92351183bbdb406c9b2385828c

depends_lib         port:curl

build.dir           ${worksrcpath}/${my_name}Source

post-extract {
    # Replace the bundled curl library with ours.
    eval delete [glob ${build.dir}/*dylib*]
    ln -s ${prefix}/lib/libcurl.dylib ${build.dir}
}

xcode.target        ${my_name}

xcode.destroot.type framework

post-destroot {
    set framework ${frameworks_dir}/${my_name}.framework
    delete ${destroot}${framework}/Versions/Current/Frameworks/libcurl.dylib
    set docdir ${framework}/Versions/Current/Resources/Documentation
    xinstall -d ${destroot}${docdir}
    eval xinstall -m 0644 [glob ${worksrcpath}/Documentation/*.html] ${destroot}${docdir}
}
