# -*- 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 120066 2014-05-14 22:18:49Z mf2k@macports.org $

PortSystem          1.0
PortGroup           perl5 1.0

name                po4a
version             0.45
set download_id     3942
set perlversion     5.16

categories          textproc
platforms           darwin
license             GPL-2
maintainers         nomaintainer

description         framework to translate documentation and other materials
long_description    The po4a (PO for anything) project goal is to ease \
                    translations (and more interestingly, the \
                    maintenance of translations) using gettext tools \
                    on areas where they were not expected like documentation.

homepage            http://po4a.alioth.debian.org/
master_sites        https://alioth.debian.org/frs/download.php/file/${download_id}/

checksums           rmd160 b2cf67d430363181d1cce93c50e9f25edc7db98b \
                    sha256 f5f47db85b48893d87d921152c96082233975bd0e0a9ee14f58c07d7dff81678

depends_lib-append  port:perl${perlversion} \
                    port:p${perlversion}-text-wrapi18n \
                    port:p${perlversion}-term-readkey \
                    port:p${perlversion}-sgmlspm \
                    port:p${perlversion}-unicode-linebreak \
                    port:p${perlversion}-locale-gettext

configure.args      "installdirs=core --config cc=\"${configure.cc}\" --config ld=\"${configure.cc}\""
perl5.use_module_build
configure.cmd       perl${perlversion}
build.cmd           perl${perlversion}
destroot.cmd        perl${perlversion}

post-destroot {
    # Make sure all binaries use the correct MacPorts-provided perl version
    reinplace -W ${destroot}${prefix}/bin "s|#! /usr/bin/env perl|#! ${prefix}/bin/perl${perlversion}|" \
        msguntypot \
        po4a \
        po4a-gettextize \
        po4a-normalize \
        po4a-translate \
        po4a-updatepo \
}
