# $Id: Portfile 94313 2012-06-14 20:21:35Z mww@macports.org $

PortSystem          1.0
PortGroup           muniversal 1.0

name                libsockets
version             2.3.9.7
categories          devel net
platforms           darwin
license             GPL-2
maintainers         mww openmaintainer
description         C++ Sockets is a C++ wrapper for BSD-style sockets.
long_description    ${description}

homepage            http://www.alhem.net/Sockets/
master_sites        ${homepage}

checksums           sha1    c298ca40c502e63cbc105f8dd555be0a1870db2c \
                    rmd160  b56ec4a2ee94577d43f44ac21a100a1156f6948e

patchfiles          patch-HttpRequest.cpp.diff \
                    patch-Makefile.diff \
                    patch-Makefile.Defines.macosx.diff

depends_lib         port:openssl

distname            Sockets-${version}

post-extract {
    xinstall -m 755 ${filespath}/configure ${worksrcpath}
    xinstall -m 755 ${filespath}/create-dylib.sh ${worksrcpath}
}

configure.env-append PLATFORM="macosx" PREFIX="${prefix}"
build.target-append libSockets.dylib

pre-destroot {
    set paths {}
    if {[variant_isset universal]} {
        foreach arch ${universal_archs_to_use} {
            lappend paths ${worksrcpath}-${arch} ${destroot}-${arch}
        }
    } else {
        lappend paths ${worksrcpath} ${destroot}
    }
    foreach {wpath dpath} ${paths} {
        xinstall -d ${dpath}${prefix}/lib
        xinstall -m 755 -W ${wpath} \
            libSockets.1.0.0.dylib libSockets.dylib ${dpath}${prefix}/lib
    }
}

livecheck.type      regex
livecheck.url       http://www.alhem.net/Sockets/download.html
livecheck.regex     Sockets-(\[0-9.\]+)${extract.suffix}

