# -*- 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 92217 2012-04-22 07:18:48Z ciserlohn@macports.org $

PortSystem          1.0

name                parallel
version             20120422
categories          sysutils
platforms           darwin
license             GPL-3+
maintainers         ciserlohn
supported_archs     noarch

description         GNU parallel: Shell command parallelization utility

long_description    Build and execute shell command lines from standard input in parallel

homepage            http://savannah.gnu.org/projects/parallel
master_sites        gnu
use_bzip2           yes

conflicts           moreutils

depends_lib         port:perl5

checksums           rmd160  81101d138752be6c9d24d422cf249b3f0cea3dc6 \
                    sha256  29210b77f0729486b7dda51ba54ac9b5e6aa2e57305f3d661259c99e8cc1937c

post-patch {
    set perl_bin ${prefix}/bin/perl
    set src_dir ${worksrcpath}/src/
    foreach f [list ${src_dir}niceload ${src_dir}sql ${src_dir}sem \
                   ${src_dir}parallel.pod ${src_dir}niceload.pod \
                   ${src_dir}parallel ${src_dir}sem.pod ] {
        reinplace "s|/usr/bin/perl|${perl_bin}|" ${f}
    }
    foreach f [list ${src_dir}parallel ${src_dir}parallel.1 \
                   ${src_dir}parallel.pod ${src_dir}parallel.html \
                   ${src_dir}sql ${src_dir}sem ${worksrcpath}/NEWS] {
        reinplace "s|/usr/bin/parallel|${prefix}/bin/parallel|" ${f}
    }
}

build.env-append    HOME=${workpath} SHELL=sh
