summaryrefslogtreecommitdiff
path: root/security/prelude-correlator/Makefile
blob: e29204159439963dd124e8a2ecad3fdca81ec9af (plain)
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
# $NetBSD: Makefile,v 1.20 2019/04/26 13:14:12 maya Exp $

DISTNAME=	prelude-correlator-0.9.0-beta8
PKGNAME=	prelude-correlator-${DISTNAME:S/-beta/beta/:C/.*-//}
PKGREVISION=	6
CATEGORIES=	security
MASTER_SITES=	http://www.prelude-ids.com/download/releases/prelude-correlator/

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://www.prelude-ids.com/download/releases/prelude-correlator/
COMMENT=	Intrusion event correlation engine

BUILD_DEFS+=		VARBASE

RCD_SCRIPTS=		preludecorrelator
PRELUDE_CORRELATOR_PID_DIR=	${VARBASE}/run/prelude-correlator
PRELUDE_USER?=		_prelude
PRELUDE_GROUP?=		_prelude
PRELUDE_HOME?=		${VARBASE}/db/prelude-correlator
INSTALLATION_DIRS=	sbin
OWN_DIRS=		${PKG_SYSCONFDIR}/prelude-correlator
EGDIR=			${PREFIX}/share/examples

PKG_GROUPS_VARS+=	PRELUDE_GROUP
PKG_USERS_VARS+=	PRELUDE_USER

PKG_GROUPS=		${PRELUDE_GROUP}
PKG_USERS=		${PRELUDE_USER}:${PRELUDE_GROUP}

PKG_GECOS.${PRELUDE_USER}=	Prelude IDS correlator
PKG_HOME.${PRELUDE_USER}=	${PRELUDE_HOME}

FILES_SUBST+=		PRELUDE_CORRELATOR_PID_DIR=${PRELUDE_CORRELATOR_PID_DIR:Q}
FILES_SUBST+=		PRELUDE_USER=${PRELUDE_USER:Q}
FILES_SUBST+=		PRELUDE_GROUP=${PRELUDE_USER:Q}

SUBST_CLASSES+=		code
SUBST_STAGE.code=	pre-configure
SUBST_FILES.code=	run-prelude-correlator.c
SUBST_FILES.code+=	${WRKSRC}/*.py
SUBST_SED.code=		-e 's,@PREFIX@,${PREFIX},g'
SUBST_SED.code+=	-e 's,@PRELUDE_USER@,${PRELUDE_USER},g'
SUBST_SED.code+=	-e 's,@PRELUDE_HOME@,${PRELUDE_HOME},g'

CONF_FILES+=		${EGDIR}/prelude-correlator.conf ${PKG_SYSCONFDIR}/prelude-correlator/prelude-correlator.conf
CONF_FILES+=		${EGDIR}/dshield.dat ${PRELUDE_HOME}/dshield.dat
CONF_FILES+=		${EGDIR}/spamhaus_drop.dat ${PRELUDE_HOME}/spamhaus_drop.dat

REQD_DIRS+=		${PRELUDE_HOME}
REQD_DIRS_PERMS+=	${PRELUDE_HOME} ${PRELUDE_USER} ${PRELUDE_GROUP} 0700

REPLACE_PYTHON=		PreludeCorrelator/main.py
PYTHON_VERSIONS_INCOMPATIBLE=	 36 37 # not yet ported as of 0.9.0beta8
EGG_NAME=		prelude_correlator-0.9.0b8

pre-patch:
	${CP} ${FILESDIR}/run-prelude-correlator.c ${WRKSRC}

post-build:
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${CC} ${CFLAGS} -o run-prelude-correlator run-prelude-correlator.c

post-install:
	${INSTALL_PROGRAM} ${WRKSRC}/run-prelude-correlator ${DESTDIR}${PREFIX}/sbin/run-prelude-correlator
	${INSTALL_DATA} ${WRKSRC}/prelude-correlator.conf ${DESTDIR}${EGDIR}
	${INSTALL_DATA} ${WRKSRC}/PreludeCorrelator/plugins/dshield.dat \
	    ${WRKSRC}/PreludeCorrelator/plugins/spamhaus_drop.dat \
	    ${DESTDIR}${EGDIR}

.include "../../security/libprelude-python/buildlink3.mk"
.include "../../lang/python/application.mk"
.include "../../lang/python/egg.mk"
.include "../../mk/bsd.pkg.mk"