# -*- 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$

PortSystem 1.0

name            autopsy
license         GPL-2
version         2.21
categories      sysutils
maintainers     nomaintainer
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.

homepage        http://www.sleuthkit.org/autopsy/
master_sites    sourceforge:project/autopsy/autopsy/${version}

checksums       sha1 083f6e1794e19ad07989d088a35da16e9418c83b \
                rmd160 d9b0c5c16c2462997cfe217211f46e1e75464204 \
                md5 48d970749861cde7b850283636c6c4dd

patchfiles      patch-configure.diff

use_configure   no

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

post-patch {
    reinplace "s|^dirs='.*'$|dirs='${prefix}/bin/ /usr/bin/ /sbin/'|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/

}