# -*- 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
# $Id: Portfile 88421 2012-01-02 01:09:15Z ryandesign@macports.org $

PortSystem          1.0

name                sortu
categories          sysutils
version             2.1.2
platforms           darwin
license             ISC
maintainers         singingwolfboy openmaintainer

description         sort-unique
long_description    \
    The sortu program is a replacement for the sort and uniq programs. It is \
    common for Unix script writers to want to count how many separate patterns \
    are in a file. For example, if you have a list of addresses, you may want to \
    see how many are from each state. So you cut out the state part, sort these, \
    and then pass them through uniq -c. Sortu does all this for you in a fraction \
    of the time. \n\n\
    \
    Sortu uses a hash table and some decent line processing to provide this \
    functionality. For a relatively small number of keys, it can be significantly \
    smaller than using sort, because it does not have to keep temporary files. \
    If you are dealing with a large number of unique keys then sortu will run \
    out of memory and stop. Sortu has some basic field and delimiter handling \
    which should do most basic awk or cut features to separate out the field that \
    you are sorting on.

homepage            http://256.com/sources/sortu/
master_sites        http://256.com/sources/sortu/
extract.suffix      .tgz
use_configure       no

checksums           rmd160  7505634f0e70e4004205437f4b5ddb8e962a22b9 \
                    sha256  eb42c4bc314996db27e0db7d7f04432ddf6ce2f34a316b1d3f2c4ba89c165ead

variant universal {}

build.args          CC="${configure.cc} [get_canonical_archflags]"

destroot {
    xinstall -m 755 ${worksrcpath}/${name} ${destroot}${prefix}/bin/${name}
    set docdir ${destroot}${prefix}/share/doc/${name}
    xinstall -d ${docdir}
    xinstall -m 644 -W ${worksrcpath} \
        README.txt \
        ChangeLog \
        ${docdir}
}
