# -*- 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                man
version             1.6g
revision            2
checksums           rmd160  f1a845bcf454424f49a3281a86217af0328d88e2 \
                    sha256  ccdcb8c3f4e0080923d7e818f0e4a202db26c46415eaef361387c20995b8959f \
                    size    256906

categories          sysutils
platforms           darwin
maintainers         nomaintainer
conflicts           mandoc
license             GPL-2
description         The man page suite containing man, apropos, whatis, man2html
long_description    The man page suite (man, apropos, and whatis) contains \
                    programs used to read most of the documentation on a Unix \
                    system. The whatis and apropos programs are used to find \
                    documentation related to a particular subject. 

homepage            http://primates.ximian.com/~flucifredi/man/
master_sites        ${homepage}
patchfiles          configure-DEF_NLSPATH.patch \
                    configure-PREPATH.patch \
                    patch-man2html_Makefile.in \
                    configure-ascii.patch \
                    CFLAGS-CPPFLAGS-LDFLAGS.patch \
                    configure-config.log.patch \
                    implicit.patch \
                    PR3845474.diff \
                    PR3857969.diff \
                    PR3939085.diff \
                    PR4006198.diff \
                    PR4062483.diff \
                    PR4076593.diff \
                    PR4302566.diff \
                    PR4670363.diff \
                    src__man-getopt.c.diff \
                    src__man.c.diff \
                    src__manpath.c.diff \
                    src__util.c.diff \
                    patch-int-main.diff

configure.universal_args-delete --disable-dependency-tracking

configure.args      --mandir=${prefix}/share/man \
                    -compatibility_mode_for_colored_groff \
                    -confdir=${prefix}/etc \
                    +fhs

# sed: RE error: illegal byte sequence, #37189
build.env-append    LC_ALL=C LANG=C

depends_lib         port:bzip2 \
                    port:groff \
                    port:gzip \
                    port:less \
                    port:lynx \
                    port:xz

post-destroot {
    file delete ${destroot}${prefix}/share/locale
}

variant man_all_lang {
    configure.args-append +lang all
}

# if libxcselect is available, also add Xcode man pages to search path
if {${os.platform} eq "darwin" && ${os.major} >= 13} {
    variant xcode conflicts universal description {Look up additional man pages installed by Xcode} {
        patchfiles-append   PR11291804-xcode.diff
        build.env-append    LIBS=-lxcselect
    }
    if {![variant_isset universal]} {
        default_variants +xcode
    }
}

platform darwin 9 {
    patchfiles-append src__man.conf.in.diff
}
