# -*- 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           github 1.0
PortGroup           openssl 1.0

github.setup        xroche httrack 3.49.19
github.tarball_from releases
revision            0
categories          net
maintainers         nomaintainer
license             GPL-2+

description         Website Copier/Offline Browser

long_description    HTTrack is an offline browser utility that allows you to \
                    download a website from the Internet to a local directory.

homepage            https://www.httrack.com/

checksums           rmd160  036be4a4fb7087cad43772715f20e5903ad47a0c \
                    sha256  ada3c241f2b39bf55c4f01657bcd6cd96e5c0452838223a9bf67445a3a844cf4 \
                    size    4275270

depends_build-append \
                    path:bin/pkg-config:pkgconfig

depends_lib-append  port:libiconv \
                    port:zlib

patchfiles          patch-src-htsweb.c.diff \
                    patch-src-webhttrack.diff \
                    patch-u_int.diff

# See https://trac.macports.org/ticket/42384
patchfiles-append   patch-libiconv.diff

post-patch {
    reinplace "s|@PREFIX@|${prefix}|" ${worksrcpath}/src/htsweb.c
}

configure.args-append \
                    --with-sysroot=${prefix} \
                    --with-zlib=${prefix} \
                    --disable-origin-rpath

post-destroot {
    # Remove metadata files not used by darwin or OS X
    file delete -force ${destroot}${prefix}/share/pixmaps/
    file delete -force ${destroot}${prefix}/share/applications/
}

test.run            yes
test.target         check
