# -*- 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                libdsk
livecheck.version   1.5
version             ${livecheck.version}.22
revision            0

categories          devel
maintainers         {@aeiouaeiouaeiouaeiouaeiouaeiou outlook.com:aeioudev} openmaintainer
license             GPL-2

description         LIBDSK is a library for accessing discs and disc image \
                    files.

long_description    {*}${description}

homepage            https://www.seasip.info/Unix/LibDsk/
master_sites        ${homepage}

checksums           rmd160  3530d1aa75ef54b0a4972ee2835bd2c502c92ff3 \
                    sha256  810f800bcc7665f4c1b35e19aaecb35f3729b712ad1d807105059b4bdb1cf049 \
                    size    1338603

depends_build       port:libtool
depends_lib         port:zlib \
                    path:lib/libbz2.dylib:bzip2

# docs target depends on lyx
post-patch {
    reinplace "s|SUBDIRS = . include lib tools man doc|SUBDIRS = . include lib tools man|g" \
    ${worksrcpath}/Makefile.in
}

post-destroot {
    set doc_dir         ${destroot}${prefix}/share/doc/${name}

    xinstall -d -m 0755 ${doc_dir}
    xinstall -m 0644 -W ${worksrcpath}/doc apridisk.html \
    cfi.html libdsk.pdf libdsk.txt libdskrc.sample protocol.txt \
    README TODO ${doc_dir}
}

livecheck.regex     ${name}-(\\d+(?:\\.\\d+)*)
