freebsd-ports/security/logcheck/Makefile
Bartek Rutkowski 3cee01fa6e security/logcheck: update 1.3.16 -> 1.3.17
PR:		194373
Submitted by:	Yasuhiro Kimura <yasu@utahime.org>
Approved by:	mentors (implicit)
2014-11-06 10:50:34 +00:00

105 lines
3.2 KiB
Makefile

# Created by: Dan Langille <dan@freebsddiary.org>
# $FreeBSD$
PORTNAME= logcheck
PORTVERSION= 1.3.17
CATEGORIES= security
MASTER_SITES= ${MASTER_SITE_DEBIAN_POOL}
DISTNAME= ${PORTNAME}_${PORTVERSION}
MAINTAINER= yasu@utahime.org
COMMENT= Auditing tool for system logs on Unix boxes
LICENSE= GPLv2
RUN_DEPENDS= mime-construct:${PORTSDIR}/mail/mime-construct \
lockfile:${PORTSDIR}/mail/procmail \
bash:${PORTSDIR}/shells/bash
LOGCHECK_USER= logcheck
LOGCHECK_GROUP= ${LOGCHECK_USER}
USERS= ${LOGCHECK_USER}
GROUPS= ${LOGCHECK_GROUP}
BASEDIR?= # None. portlint compliance
DBDIR= ${BASEDIR}/var/db/${PORTNAME}
RUNDIR= ${BASEDIR}/var/run/${PORTNAME}
OPTIONS_DEFINE= CRON
CRON_DESC= Install cron script automatically
.if !defined(BATCH)
OPTIONS_DEFAULT=CRON
.endif
# Enable Perl dependency for logtail script
USES= perl5 shebangfix tar:xz
WRKSRC= ${WRKDIR}/${DISTNAME:S!_!-!}
BINMODE= 755
SUB_LIST+= LOGCHECK_USER=${LOGCHECK_USER} \
LOGCHECK_GROUP=${LOGCHECK_GROUP} \
CRON=${PORT_OPTIONS:MCRON}
SUB_FILES= pkg-install pkg-deinstall pkg-message
PLIST_SUB+= LOGCHECK_USER=${LOGCHECK_USER} \
LOGCHECK_GROUP=${LOGCHECK_GROUP} \
DBDIR=${DBDIR} RUNDIR=${RUNDIR}
SHEBANG_FILES= src/logcheck src/logtail src/logtail2
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}
MAN_FILES= logcheck.8 logtail.8 logtail2.8
PATCH_LIST= extra-patch-debian__logcheck.cron.d \
extra-patch-docs__logcheck.8 \
extra-patch-etc__logcheck.conf \
extra-patch-src__logcheck \
extra-patch-src__logtail2
EXTRA_PATCHES= ${PATCH_LIST:C|^|${WRKDIR}/|g}
.include <bsd.port.pre.mk>
pre-patch:
.for patch in ${PATCH_LIST}
@${SED} ${_SUB_LIST_TEMP} ${FILESDIR}/${patch}.in > ${WRKDIR}/${patch}
.endfor
post-patch:
@${FIND} ${WRKSRC}/rulefiles -type f -name \*.orig -delete
do-build:
@${REINPLACE_CMD} -e 's!/var/log/syslog!/var/log/messages!' \
${WRKSRC}/etc/logcheck.logfiles
do-install:
@${MKDIR} ${STAGEDIR}${DATADIR}/detectrotate \
${STAGEDIR}${DBDIR} \
${STAGEDIR}${DOCSDIR} \
${STAGEDIR}${ETCDIR} \
${STAGEDIR}${EXAMPLESDIR} \
${STAGEDIR}${RUNDIR}
${INSTALL_SCRIPT} ${WRKSRC}/src/logcheck ${STAGEDIR}${PREFIX}/sbin
${INSTALL_SCRIPT} ${WRKSRC}/src/logtail ${STAGEDIR}${PREFIX}/sbin
${INSTALL_SCRIPT} ${WRKSRC}/src/logtail2 ${STAGEDIR}${PREFIX}/sbin
${INSTALL_DATA} ${WRKSRC}/etc/logcheck.conf \
${STAGEDIR}${ETCDIR}/logcheck.conf.sample
${INSTALL_DATA} ${WRKSRC}/etc/logcheck.logfiles \
${STAGEDIR}${ETCDIR}/logcheck.logfiles.sample
.for i in ${CONFIG_DIRS}
@${MKDIR} ${STAGEDIR}${ETCDIR}/${i}
${INSTALL_DATA} ${WRKSRC}/rulefiles/linux/${i}/* \
${STAGEDIR}${ETCDIR}/${i}
.endfor
${INSTALL_DATA} ${WRKSRC}/src/detectrotate/*.dtr \
${STAGEDIR}${DATADIR}/detectrotate
${INSTALL_DATA} ${WRKSRC}/debian/logcheck.cron.d \
${STAGEDIR}${EXAMPLESDIR}/crontab.in
@${ECHO_CMD} '@exec ${CHGRP} -R ${LOGCHECK_GROUP} \
${ETCDIR:S|^${PREFIX}/|%D/|} \
${DATADIR:S|^${PREFIX}/|%D/|}' >> ${TMPPLIST}
.for i in ${MAN_FILES}
${INSTALL_MAN} ${WRKSRC}/docs/$i ${STAGEDIR}${MAN8PREFIX}/man/man8
.endfor
cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${STAGEDIR}${DOCSDIR}
.include <bsd.port.post.mk>