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

PortSystem          1.0

name                skipfish
version             2.10b
revision            6
license             Apache-2
categories          security
maintainers         nomaintainer
description         web application security scanner
long_description    A fully automated, active web application security \
                    reconnaissance tool.

homepage            https://code.google.com/p/skipfish/
depends_lib         port:openssl10 port:libidn port:zlib port:pcre

master_sites        googlecode
extract.suffix      .tgz

checksums           rmd160  00667071308b41977710842994ba4c34ce26cff5 \
                    sha256  1a4fbc9d013f1f9b970946ea7228d943266127b7f4100c994ad26c82c5352a9e

patchfiles          patch-src-config.h.diff
post-patch {
    reinplace s|@@SHARE@@|${prefix}/share/${name}/| ${worksrcpath}/src/config.h
    reinplace "s|-L/usr/local/lib/||" ${worksrcpath}/Makefile
    reinplace "s|-L/opt/local/lib|-L${prefix}/libexec/openssl10/lib -L${prefix}/lib|" ${worksrcpath}/Makefile
    reinplace "s|-I/usr/local/include/||" ${worksrcpath}/Makefile
    reinplace "s|-I/opt/local/include/|-I${prefix}/libexec/openssl10/include -I${prefix}/include|" ${worksrcpath}/Makefile
    reinplace s|signatures/signatures.conf|${prefix}/share/${name}/signatures/signatures.conf| ${worksrcpath}/src/config.h
    reinplace s|include\ signatures|include\ ${prefix}/share/${name}/signatures| ${worksrcpath}/signatures/signatures.conf
}

use_configure       no

build.env           CC=${configure.cc} \
                    CFLAGS=${configure.cc_archflags}
destroot {
    file mkdir ${destroot}${prefix}/share/${name}
    file copy ${worksrcpath}/skipfish ${destroot}${prefix}/bin/skipfish
    file copy ${worksrcpath}/assets/ ${destroot}${prefix}/share/${name}
    file copy ${worksrcpath}/README ${destroot}${prefix}/share/${name}
    file copy ${worksrcpath}/doc/ ${destroot}${prefix}/share/${name}
    file copy ${worksrcpath}/signatures/ ${destroot}${prefix}/share/${name}
    fs-traverse dir ${destroot}${prefix}/share/${name} {
        if { [ file isdirectory ${dir} ] } {
            file attributes ${dir} -permissions 0755
        } else {
            file attributes ${dir} -permissions 0644
        }
    }
}

notes \
"See ${prefix}/share/${name}/doc/dictionaries.txt to pick a dictionary for the tool.

Having problems with your scans? Be sure to visit:\
https://code.google.com/p/skipfish/wiki/KnownIssues"