aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/mk-livestatus/Makefile
blob: dcb1a6aa7330519413c5414e04d06e83491b585a (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
PORTNAME=	mk-livestatus
PORTVERSION=	1.2.8p25
PORTREVISION=	3
CATEGORIES=	net-mgmt
MASTER_SITES=	https://mirrors.xtom.com/freebsd-ports/distfiles/check_mk/ \
		https://mirrors.xtom.nl/freebsd-ports/distfiles/check_mk/ \
		http://mathias-kettner.de/download/
DIST_SUBDIR=	check_mk

MAINTAINER=	egypcio@FreeBSD.org
COMMENT=	Nagios event broker module
WWW=		https://mathias-kettner.de/checkmk_livestatus.html

LICENSE=	GPLv2

USES=		compiler:c++11-lang

GNU_CONFIGURE=	yes

PLIST_FILES=	lib/mk-livestatus/unixcat \
		lib/mk-livestatus/livestatus.o
SUB_FILES=	pkg-message

PORTEXAMPLES=	*.py README
EXAMPLE_FILES=	example_multisite.py example.py \
		livestatus.py make_nagvis_map.py \
		README

# parameter "command_file" from nagios.cfg
COMMAND_FILE?=	/var/spool/nagios/rw/live

OPTIONS_DEFINE=	EXAMPLES PERL
OPTIONS_SINGLE=	NAGIOS
OPTIONS_SINGLE_NAGIOS=	NAGIOS3 NAGIOS4
OPTIONS_DEFAULT=	NAGIOS4

NAGIOS3_DESC=	Build support for Nagios 3.x
NAGIOS4_DESC=	Build support for Nagios 4.x
PERL_DESC=	Install Monitoring-Livestatus Perl API

EXAMPLES_USES=	python
NAGIOS3_RUN_DEPENDS=	nagios>=3.5.1:net-mgmt/nagios
# --without-nagios4 is broken and is equivalent to --with-nagios4,
# so do not use NAGIOS4_CONFIGURE_WITH here or it breaks the NAGIOS3
# option, cf. PR 232716.
NAGIOS4_CONFIGURE_ON=	--with-nagios4
NAGIOS4_RUN_DEPENDS=	nagios4>=4.4:net-mgmt/nagios4
PERL_RUN_DEPENDS=	p5-Monitoring-Livestatus>=0:net-mgmt/p5-Monitoring-Livestatus

post-patch:
	${REINPLACE_CMD} -e 's|/usr/local/nagios/var/rw/live|${COMMAND_FILE}|' \
		${WRKSRC}/src/livestatus.h

post-install-EXAMPLES-on:
	${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
	${REINPLACE_CMD} -e 's|/usr/bin/python|${PYTHON_CMD}|g' \
		-e 's|/var/lib/nagios/rw/live|${COMMAND_FILE}|g' \
		-e 's|/var/run/nagios/rw/live|${COMMAND_FILE}|g' \
		${PORTEXAMPLES:S|^|${WRKSRC}/api/python/|}
	${INSTALL_DATA} ${PORTEXAMPLES:S|^|${WRKSRC}/api/python/|} ${STAGEDIR}${EXAMPLESDIR}

.include <bsd.port.pre.mk>

# Fix building with clang 11 ("ld: error: duplicate symbol: g_mainthread_id")
.if ${OSVERSION} >= 1204000
CFLAGS+=	-fcommon
.endif

.include <bsd.port.post.mk>