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

name                ManOpen
version             2.6
revision            2
checksums           rmd160  2c789a7f9d618fc5ad92909d23dbe522d4a53965 \
                    sha256  80e02a66840bd410a55f04e3c53eeae45027afce6e57a2d0d014671a0fb0550b \
                    size    153642

categories          aqua textproc
license             BSD
maintainers         nomaintainer

description         GUI application for viewing Unix manual pages,

long_description    \
    It can open files directly or be given titles, in which case     \
    it will display the output from the `man' command-line program. \
    An apropos interface is also provided, which is basically a     \
    quick-and-dirty search of the man page databases. Services are     \
    provided to other applications to open selected files/titles     \
    or do apropos searches using the selected text.

homepage            https://www.clindberg.org/projects/ManOpen.html
master_sites        https://www.clindberg.org/projects/
extract.suffix      .s${extract.suffix}

patchfiles          cat2html.l.patch

# see https://trac.macports.org/ticket/57137
if {${os.platform} eq "darwin" && ([vercmp $xcodeversion 10.0] > 0)} {
    build.pre_args-append    -UseModernBuildSystem=NO
    destroot.pre_args-append -UseModernBuildSystem=NO
}

post-destroot     {
    move ${destroot}${applications_dir}/openman ${destroot}${prefix}/bin
    move ${destroot}${applications_dir}/openman.1            \
        ${destroot}${prefix}/share/man/man1

    # These are internal programs used by ManOpen.app. Additional copies
    # have already been installed within the application bundle.
    delete          ${destroot}${applications_dir}/cat2html \
                    ${destroot}${applications_dir}/cat2rtf
}

livecheck.type      regex
livecheck.url       ${homepage}
livecheck.regex     ${name}-(\[0-9.\]+)[quotemeta ${extract.suffix}]
