aboutsummaryrefslogtreecommitdiffstats
path: root/security/logcheck/Makefile
blob: 605ed57c64e9a18a8264e5f076c82a76238cc04a (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
73
# Ports collection makefile for:    logcheck
# Date created:     9 December 1999
# Whom:         Dan Langille <dan@freebsddiary.org>
#
# $FreeBSD$
#

PORTNAME=   logcheck
PORTVERSION=    1.2.54
CATEGORIES= security
MASTER_SITES=   ftp://ftp.debian.org/debian/pool/main/l/logcheck/ \
        http://ftp.de.debian.org/debian/pool/main/l/logcheck/
DISTNAME=   ${PORTNAME}_${PORTVERSION}

MAINTAINER= glarkin@FreeBSD.org
COMMENT=    Auditing tool for system logs on Unix boxes

BUILD_DEPENDS=  docbook-to-man:${PORTSDIR}/textproc/docbook-to-man
RUN_DEPENDS=    lockfile:${PORTSDIR}/mail/procmail \
        bash:${PORTSDIR}/shells/bash \
        perl:${PORTSDIR}/lang/perl5

WRKSRC=     ${WRKDIR}/${PORTNAME}-${PORTVERSION}
BINMODE=    755
SHAREMODE=  640
SUB_FILES=  pkg-install pkg-deinstall pkg-message
CONFIG_DIRS=    cracking.d ignore.d.paranoid ignore.d.server \
        ignore.d.workstation violations.d violations.ignore.d
DOCS=       AUTHORS CHANGES CREDITS LICENSE TODO docs/README*
PORTDOCS=   ${DOCS:T}
MAN8=       logcheck.8 logtail.8

do-build:
    ${REINPLACE_CMD} -e 's!/var/log/syslog!/var/log/messages!' \
    ${WRKSRC}/etc/logcheck.logfiles
    ${REINPLACE_CMD} -e 's!/etc/logcheck!/usr/local/etc/logcheck!' \
    -e 's!/usr/share/doc/logcheck-database/README.logcheck-database.gz!${DOCSDIR}/README.logcheck-database!' \
    ${WRKSRC}/docs/logcheck.sgml
    docbook-to-man ${WRKSRC}/docs/logcheck.sgml > ${WRKSRC}/docs/logcheck.8

do-install:
    ${INSTALL_SCRIPT} ${WRKSRC}/src/logcheck ${PREFIX}/sbin
    ${INSTALL_SCRIPT} ${WRKSRC}/src/logtail ${PREFIX}/sbin
    @PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
    @${INSTALL} -d /var/lib/logcheck
    @${INSTALL} -d /var/run/logcheck
    ${CHOWN} logcheck:logcheck /var/lib/logcheck
    ${CHOWN} logcheck:logcheck /var/run/logcheck
    @${INSTALL} -d ${ETCDIR}
    @${INSTALL_DATA} ${WRKSRC}/etc/logcheck.conf ${ETCDIR}/logcheck.conf.sample
    @${INSTALL_DATA} ${WRKSRC}/etc/logcheck.logfiles ${ETCDIR}/logcheck.logfiles.sample
.for i in ${CONFIG_DIRS}
    @${INSTALL} -d ${ETCDIR}/${i}
    @${INSTALL_DATA} ${WRKSRC}/rulefiles/linux/${i}/* ${ETCDIR}/${i}
.endfor
    @${INSTALL} -d ${DOCSDIR}
.if !defined(NOPORTEXAMPLES)
    @${INSTALL} -d ${EXAMPLESDIR}
    @${INSTALL_DATA} ${WRKSRC}/debian/logcheck.cron.d ${EXAMPLESDIR}/crontab.in
.endif
    ${CHOWN} -R root:logcheck ${ETCDIR}
    @PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
    @${INSTALL_MAN} ${WRKSRC}/docs/*.8 ${MAN8PREFIX}/man/man8

post-install:
.if !defined(NOPORTDOCS)
    @${INSTALL} -d ${DOCSDIR}
    @cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
    ${CHMOD} 644 ${DOCSDIR}/*
.endif
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.mk>