# -*- 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 119858 2014-05-08 12:50:09Z ryandesign@macports.org $

PortSystem          1.0
PortGroup           perl5 1.0

name                log2timeline
version             0.65
categories          security
platforms           darwin
maintainers         yahoo.fr:jul_bsd openmaintainer
license             GPL-3+

description         framework for automatic creation of a super timeline

long_description    ${name} provides a single tool to parse \
                    various log files and artifacts found on suspect systems \
                    (and supporting systems, such as network equipment) and \
                    produces a timeline that can be analysed by forensic \
                    investigators/analysts.

homepage            https://code.google.com/p/log2timeline/
master_sites        googlecode
extract.suffix      .tgz
distname            ${name}_${version}

checksums           sha1    99bb6f68a417aaa840a7957be9918586d1918a33 \
                    rmd160  c9dad4035bad1dbbf87e82f123aa014f03aa647f

supported_archs     noarch

configure.pre_args

post-destroot {
    eval delete [glob ${destroot}${prefix}/lib/perl5/*/*/perllocal.pod]
}

livecheck.type      regex
livecheck.url       ${homepage}downloads/list
## FIXME! port version empty ?!
livecheck.regex     ${name}_(\\d+(\\.\[0-9a-z\]+)+)${extract.suffix}

variant perl5_12 conflicts perl5_18 perl5_16 description { Perl bindings with perl 5.12} {
    depends_lib         port:perl5.12 \
                        port:p5.12-archive-zip \
                        port:p5.12-carp-assert \
                        port:p5.12-datetime-format-strptime \
                        port:p5.12-datetime-timezone \
                        port:p5.12-dbd-sqlite \
                        port:p5.12-dbi \
                        port:p5.12-digest-crc \
                        port:p5.12-gtk2 \
                        port:p5.12-html-parser \
                        port:p5.12-html-scrubber \
                        port:p5.12-image-exiftool \
                        port:p5.12-libwww-perl \
                        port:p5.12-net-pcap \
                        port:p5.12-netpacket \
                        port:p5.12-xml-libxml \
                        port:p5.12-datemanip \
                        port:p5.12-parse-win32registry \
                        port:p5.12-file-mork \
                        port:p5.12-data-hexify \
                        port:p5.12-version \
                        port:p5.12-params-validate \
                        port:p5.12-xml-entities \
                        port:p5.12-mac-propertylist
    configure.cmd       ${prefix}/bin/perl5.12 Makefile.PL

    notes "
tool is ${prefix}/libexec/perl5.12/sitebin/log2timeline
"
}

variant perl5_16 conflicts perl5_18 perl5_12 description { Perl bindings with perl 5.16} {
    depends_lib         port:perl5.16 \
                        port:p5.16-archive-zip \
                        port:p5.16-carp-assert \
                        port:p5.16-datetime-format-strptime \
                        port:p5.16-datetime-timezone \
                        port:p5.16-dbd-sqlite \
                        port:p5.16-dbi \
                        port:p5.16-digest-crc \
                        port:p5.16-gtk2 \
                        port:p5.16-html-parser \
                        port:p5.16-html-scrubber \
                        port:p5.16-image-exiftool \
                        port:p5.16-libwww-perl \
                        port:p5.16-net-pcap \
                        port:p5.16-netpacket \
                        port:p5.16-xml-libxml \
                        port:p5.16-datemanip \
                        port:p5.16-parse-win32registry \
                        port:p5.16-file-mork \
                        port:p5.16-data-hexify \
                        port:p5.16-version \
                        port:p5.16-params-validate \
                        port:p5.16-xml-entities \
                        port:p5.16-mac-propertylist
    configure.cmd       ${prefix}/bin/perl5.16 Makefile.PL

    notes "
tool is ${prefix}/libexec/perl5.16/sitebin/log2timeline
"
}

variant perl5_18 conflicts perl5_16 perl5_12 description { Perl bindings with perl 5.18} {
    depends_lib         port:perl5.18 \
                        port:p5.18-archive-zip \
                        port:p5.18-carp-assert \
                        port:p5.18-datetime-format-strptime \
                        port:p5.18-datetime-timezone \
                        port:p5.18-dbd-sqlite \
                        port:p5.18-dbi \
                        port:p5.18-digest-crc \
                        port:p5.18-gtk2 \
                        port:p5.18-html-parser \
                        port:p5.18-html-scrubber \
                        port:p5.18-image-exiftool \
                        port:p5.18-libwww-perl \
                        port:p5.18-net-pcap \
                        port:p5.18-netpacket \
                        port:p5.18-xml-libxml \
                        port:p5.18-datemanip \
                        port:p5.18-parse-win32registry \
                        port:p5.18-file-mork \
                        port:p5.18-data-hexify \
                        port:p5.18-version \
                        port:p5.18-params-validate \
                        port:p5.18-xml-entities \
                        port:p5.18-mac-propertylist
    configure.cmd       ${prefix}/bin/perl5.18 Makefile.PL

    notes "
tool is ${prefix}/libexec/perl5.18/sitebin/log2timeline
"
}

if {![variant_isset perl5_12] && ![variant_isset perl5_16] && ![variant_isset perl5_18]} {
    default_variants    +perl5_16
}
