# -*- 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.50.1
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  1fc269834eeefb70792c9346633b47579feff311 \
                    sha256  cab1ad16a975263d809e484b02bbf76c87e2212e7b5902f42d9e0c6ccf01451c \
                    size    5193576

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
