# -*- 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

name            libwww
version         5.4.2
revision        2
categories      www
license         W3C
platforms       darwin
maintainers     nomaintainer
description     The W3C WWW Reference Library
homepage        https://www.w3.org/Library/

long_description \
    Libwww is a general-purpose Web API written in C for Unix and Windows (Win32). \
    With a highly extensible and layered API, it can accommodate many different types \
    of applications including clients, robots, etc.

master_sites    https://www.w3.org/Library/Distribution/
distname        w3c-${distname}
extract.suffix  .tgz

depends_build   port:ncurses \
                port:pkgconfig

depends_lib     port:expat \
                path:lib/libssl.dylib:openssl \
                port:zlib

checksums       rmd160  7b6ecfbd84ca8b2ce3b19d3b60e9f6a75ea914f5 \
                sha256  32b855101f65466c67ae3a3cc0fd18fa982e4b59fc98c9d4691e2da663d05f04 \
                size    2630357

patchfiles      patch-configure.diff \
                patch-Library_src_SSL_HTSSL.c.diff

configure.args  --enable-shared \
                --enable-static \
                --with-expat \
                --with-ssl \
                --with-zlib \
                --without-mysql \
                --without-x

configure.ccache no

pre-build {
    reinplace "s|dynamiclib|dynamiclib [get_canonical_archflags ld]|" ${worksrcpath}/libtool
}

livecheck.type  regex
livecheck.url   ${homepage}Distribution/
livecheck.regex "w3c-${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
