aboutsummaryrefslogtreecommitdiffstats
path: root/security/nikto/Makefile
blob: 8a9f0d7fb2681f20689d69f5d65eb20560e0ad5d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# New ports collection makefile for:    nikto
# Date created:             23 September 2002
# Whom:                 pandzilla
#
# $FreeBSD$
#
# $Tecnik: ports/security/nikto/Makefile,v 1.7 2005/12/13 16:26:20 itetcu Exp $
#

PORTNAME=   nikto
PORTVERSION=    1.35
PORTREVISION=   2
CATEGORIES= security www
MASTER_SITES=   http://www.cirt.net/${PORTNAME}/ \
        http://www.mirrors.wiretapped.net/security/vulnerability-assessment/${PORTNAME}/ \
        http://people.tecnik93.com/~itetcu/FreeBSD/ports/${PORTNAME}/sources/

MAINTAINER= itetcu@FreeBSD.org
COMMENT=    Web and CGI vulnerability scanner with SSL support

USE_BZIP2=  yes
USE_PERL5_RUN=  yes
NO_BUILD=   yes

PORTDOCS=   CHANGES.txt README_plugins.txt nikto_usage.html nikto_usage.txt
MAN1=       ${PORTNAME}.1

OPTIONS+=   SSLEAY "Use NET::SSLeay for ssl scanning" on
OPTIONS+=   NMAP "Use security/nmap for port scanning" on

.include <bsd.port.pre.mk>

.ifdef(WITH_SSLEAY)
RUN_DEPENEDS+=  p5-Net-SSLeay>0:${PORTSDIR}/security/p5-Net-SSLeay
.endif

.ifdef(WITH_NMAP)
RUN_DEPENEDS+=  nmap:${PORTSDIR}/security/nmap
.endif

post-patch:
    @${REINPLACE_CMD} -e "s|/usr/local/bin/perl|${PERL}|" ${WRKSRC}/nikto.pl
    @${REINPLACE_CMD} -Ee "s,(config.txt),${TARGETDIR}/etc/nikto.conf," ${WRKSRC}/nikto.pl
    @${REINPLACE_CMD} -Ee "s|/usr/bin/nmap|${LOCALBASE}/bin/nmap|g" \
        -e "s|# (PLUGINDIR=)/usr/local/nikto/plugins|\1${DATADIR}|g" \
        ${WRKSRC}/config.txt
    @${REINPLACE_CMD} "s/config.txt/nikto.conf/g" ${WRKSRC}/plugins/* ${WRKSRC}/docs/*
    @${REINPLACE_CMD} -e 's:\$NIKTO{plugindir}/../docs/CHANGES.txt:\$NIKTO{plugindir}/../docs/nikto/CHANGES.txt:' \
        -e 's:\$NIKTO{plugindir}/../CHANGES.txt:\$NIKTO{plugindir}/../docs/nikto/CHANGES.txt:' \
        ${WRKSRC}/plugins/nikto_core.plugin
    @${MV} ${WRKSRC}/docs/nikto-1.34.man ${WRKSRC}/docs/nikto.1

do-install:
    ${INSTALL_SCRIPT} ${WRKSRC}/nikto.pl ${TARGETDIR}/bin/nikto
    ${INSTALL_DATA} ${WRKSRC}/config.txt ${TARGETDIR}/etc/nikto.conf.sample
    [ -f ${PREFIX}/etc/nikto.conf ] || \
        ${INSTALL_DATA} ${WRKSRC}/config.txt ${TARGETDIR}/etc/nikto.conf
    @${MKDIR} ${DATADIR}
    ${INSTALL_DATA} ${WRKSRC}/plugins/LW.pm ${DATADIR}
    ${INSTALL_DATA} ${WRKSRC}/plugins/*.db ${DATADIR}
    ${INSTALL_DATA} ${WRKSRC}/plugins/nikto_plugin_order.txt ${DATADIR}
    ${INSTALL_DATA} ${WRKSRC}/plugins/*.plugin ${DATADIR}

.if !defined(NOPORTDOCS)
    @${MKDIR} ${DOCSDIR}
.   for i in ${PORTDOCS}
        ${INSTALL_DATA} ${WRKSRC}/docs/${i} ${DOCSDIR}
.   endfor
.endif
    ${INSTALL_MAN} ${WRKSRC}/docs/${MAN1} ${MAN1PREFIX}/man/man1

.include <bsd.port.post.mk>