aboutsummaryrefslogtreecommitdiffstats
path: root/security/rkhunter/Makefile
blob: ff4c373c9c3799df92750ffc0356024ba5c5bf01 (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
# Created by: Radim Kolar
# $FreeBSD$

PORTNAME=   rkhunter
PORTVERSION=    1.4.2
PORTREVISION=   1
CATEGORIES= security
MASTER_SITES=   SF

MAINTAINER= lukasz@wasikowski.net
COMMENT=    Rootkit detection tool

LICENSE=    GPLv2

OPTIONS_DEFINE= LSOF NMAP DOCS
OPTIONS_DEFAULT=LSOF

RUN_DEPENDS+=   p5-Digest-SHA1>=0:${PORTSDIR}/security/p5-Digest-SHA1 \
        ${LOCALBASE}/bin/wget:${PORTSDIR}/ftp/wget

USES=       perl5
NO_BUILD=   yes
SUB_FILES=  415.${PORTNAME}

PORTDOCS=   ACKNOWLEDGMENTS CHANGELOG FAQ LICENSE README

LSOF_RUN_DEPENDS=   lsof:${PORTSDIR}/sysutils/lsof
NMAP_RUN_DEPENDS=   nmap:${PORTSDIR}/security/nmap

post-patch:
    @${REINPLACE_CMD} -i '' -e 's|{SHAREDIR}/man/man8|{PREFIX}/man/man8|g' \
        ${WRKSRC}/installer.sh
    @${REINPLACE_CMD} -i '' -e 's|RKHPREFIX|${PREFIX}|g' \
        ${WRKSRC}/files/${PORTNAME}.conf

do-install:
    cd ${WRKSRC} && ./installer.sh --layout custom ${STAGEDIR}${PREFIX} --install
    ${INSTALL_MAN} ${WRKSRC}/files/${PORTNAME}.8 \
        ${STAGEDIR}${MAN8PREFIX}/man/man8
    @${MKDIR} ${STAGEDIR}${PREFIX}/etc/periodic/security
    ${INSTALL_SCRIPT} ${WRKDIR}/415.${PORTNAME} ${STAGEDIR}${PREFIX}/etc/periodic/security
    @${MKDIR} ${STAGEDIR}${DOCSDIR}
    ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/files/|} ${STAGEDIR}${DOCSDIR}

post-install:
    @${REINPLACE_CMD} -i '' -e 's|${STAGEDIR}||g' \
        ${STAGEDIR}${PREFIX}/bin/${PORTNAME} ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf
    ${INSTALL_DATA} ${WRKSRC}/files/${PORTNAME}.conf ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf.sample
    ${INSTALL_DATA} -m 640 ${WRKSRC}/files/programs_bad.dat ${STAGEDIR}${PREFIX}/var/lib/${PORTNAME}/db/programs_bad.dat.sample
    ${INSTALL_DATA} -m 640 ${WRKSRC}/files/mirrors.dat ${STAGEDIR}${PREFIX}/var/lib/${PORTNAME}/db/mirrors.dat.sample

.include <bsd.port.mk>