# $Id: Portfile 56064 2009-08-24 00:47:13Z ryandesign@macports.org $

PortSystem  1.0

name        moreutils
version     0.31
revision	1
categories  sysutils
maintainers milosh openmaintainer
platforms   darwin
description a collection of the unix tools that nobody thought to write thirty years ago.
long_description    \
    moreutils includes the following utilities: \
 - isutf8: check if a file or standard input is utf-8, \
 - sponge: soak up standard input and write to a file, \
 - ts: timestamp standard input, \
 - vidir: edit a directory in your text editor, \
 - vipe: insert a text editor into a pipe, \
 - combine: combine the lines in two files using boolean operations, \
 - pee: tee standard input to pipes, \
 - zrun: automatically uncompress arguments to command, \
 - mispipe: pipe two commands, returning the exit status of the first, \
 - lckdo: run a program with a lock held.

homepage    http://packages.debian.org/unstable/utils/moreutils
master_sites    http://ftp.debian.org/debian/pool/main/m/moreutils/
distname        ${name}_${version}
worksrcdir      ${name}
checksums       md5     4421992c2db6d6947ec591c7ad1804c0 \
                sha1    4d3ea6b395c36bed1b58fb1105372c7079b8c109 \
                rmd160  048518d575c70e3504627b777a1cdc2e83e83ba9
use_configure   no
depends_run     path:bin/perl:perl5
patchfiles      patch-Makefile.diff
use_configure   no
pre-build   {
        reinplace "s|/usr/bin/perl|${prefix}/bin/perl|" \
        ${worksrcpath}/vidir ${worksrcpath}/vipe \
        ${worksrcpath}/ts ${worksrcpath}/combine \
        ${worksrcpath}/zrun
        reinplace "s|docbook2x-man|docbook2man|" ${worksrcpath}/Makefile
}

destroot.env-append	PREFIX=${prefix}

variant doc description {Install man pages} {
        depends_build-append    port:docbook-xml-4.4 port:docbook2X
        destroot.target         install install-doc
        build.target            all doc
        post-configure  {
            reinplace "s|/usr/share/xml/docbook/schema/dtd/4.4|${prefix}/share/xml/docbook/4.4|" \
            ${worksrcpath}/ifdata.docbook ${worksrcpath}/isutf8.docbook \
            ${worksrcpath}/mispipe.docbook ${worksrcpath}/pee.docbook \
            ${worksrcpath}/sponge.docbook ${worksrcpath}/lckdo.docbook
        }
}

livecheck.check regex
livecheck.url   http://packages.debian.org/unstable/utils/${name}
livecheck.regex ${name} .(\[0-9.\]+)

