# $Id: Portfile 43304 2008-12-08 19:25:58Z mcalhoun@macports.org $

PortSystem 1.0

name            autopsy
version         2.08
categories      sysutils
maintainers     ecronin
platforms       darwin
description     Autopsy Forensic Browser
long_description \
    The Autopsy Forensic Browser is a graphical interface to the \
    command line digital investigation analysis tools in  The Sleuth \
    Kit. Together, they can analyze Windows and UNIX disks and file \
    systems (NTFS, FAT, UFS1/2, Ext2/3). \
    The Sleuth Kit and Autopsy are both Open Source and run on UNIX \
    platforms. As Autopsy is HTML-based, you can connect to the \
    Autopsy server from any platform using an HTML browser. Autopsy \
    provides a \"File Manager\"-like interface and shows details about \
    deleted data and file system structures.
master_sites    sourceforge
homepage        http://www.sleuthkit.org/autopsy/
checksums       sha1 a9a1234393afd50b3609575a906fa0b387efe4b9 \
                md5 0ac9db9acf66742f8f01f3d8b0cf2f90
livecheck.version   ${name}-${version}
patchfiles      patch-configure.diff
use_configure   no

depends_build   port:file path:bin/perl:perl5 port:sleuthkit

post-patch {
    reinplace "s|/usr/local/bin/ /usr/bin/ /usr/ccs/bin/ /bin/ /usr/ucb/bin/ /sbin/ /usr/sbin/ /usr/local/sbin/|${prefix}/bin/ /usr/bin/|g"  \
        ${worksrcpath}/configure
    reinplace "s|\\\$PWD/|${prefix}/share/${name}/|g" ${worksrcpath}/configure
    reinplace "s|MP_AUTOPSY_LOCKER|${prefix}/var/${name}/|g" ${worksrcpath}/configure
}

destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}

    xinstall -m 755 -d ${destroot}${prefix}/share/${name}
    xinstall -m 755 -d ${destroot}${prefix}/share/${name}/help
    xinstall -m 755 -d ${destroot}${prefix}/share/${name}/lib
    xinstall -m 755 -d ${destroot}${prefix}/share/${name}/pict

    xinstall -m 755 -d ${destroot}${prefix}/man/man1

    eval xinstall -m 644 [glob ${worksrcpath}/docs/*] \
        ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} CHANGES.txt INSTALL.txt README.txt \
        ${destroot}${prefix}/share/doc/${name}

    xinstall -m 755 -W ${worksrcpath} autopsy \
        ${destroot}${prefix}/bin

    xinstall -m 644 -W ${worksrcpath} conf.pl global.css \
        ${destroot}${prefix}/share/${name}
    eval xinstall -m 644 [glob ${worksrcpath}/help/*] \
        ${destroot}${prefix}/share/${name}/help
    eval xinstall -m 644 [glob ${worksrcpath}/lib/*] \
        ${destroot}${prefix}/share/${name}/lib
    eval xinstall -m 644 [glob ${worksrcpath}/pict/*] \
        ${destroot}${prefix}/share/${name}/pict

    eval xinstall -m 644 [glob ${worksrcpath}/man/man1/*] \
        ${destroot}${prefix}/share/man/man1/
}
