# $Id: Portfile 53548 2009-07-08 01:53:57Z ryandesign@macports.org $

PortSystem 1.0

name            lha
epoch           20070826
version         1.14i-ac20050924p1
revision        3
categories      archivers sysutils
maintainers     nomaintainer
description     Utility for creating and opening lzh archives
long_description \
                ${description}
platforms       darwin
homepage        http://lha.sourceforge.jp/
master_sites   sourceforge_jp:${name}/22231
master_sites-append macports::lha_man
distfiles-append    lha.1.r889:lha_man
patchfiles      patch-src_header.c.diff
checksums       ${distname}${extract.suffix} md5 9f52430410928ba4390a73a41a36d56f \
                                             sha1 2491c8b584c21759f1d3819f57fa0e1cbc235092 \
                                             rmd160 7603dc93d8afdeed6cfbaa193f68ae4283bea39b \
                lha.1.r889 md5 ee2d1efb86c145ba16c3dcbb1e6a3150 \
                           sha1 9aba56d37abf9ff05df41b84164b02eb83cd5aae \
                           rmd160 6d6e98dab3533e6c66981c41961adeec4305ad48

extract.only    ${distname}${extract.suffix}

configure.args  --mandir=${prefix}/share/man

use_parallel_build  yes

test.run        yes
test.target     check

destroot.target install-strip

post-destroot {
    set docdir ${prefix}/share/doc/${name}-${version}
    xinstall -m 755 -d ${destroot}${docdir}/olddoc
    xinstall -m 0644 -W ${worksrcpath} ChangeLog Hacking_of_LHa header.doc.euc \
        ${destroot}${docdir}
    eval xinstall -m 0644 [glob ${worksrcpath}/olddoc/*.{txt,euc,eng}] \
        ${destroot}${docdir}/olddoc

    xinstall -m 755 -d ${destroot}${prefix}/share/man/man1
    copy ${distpath}/lha.1.r889 ${destroot}${prefix}/share/man/man1/lha.1
    delete ${destroot}${prefix}/share/man/mann
}
