summaryrefslogtreecommitdiff
path: root/net-mgmt/check_mk_agent/Makefile
blob: f1ad4cc8ca9050e943919a1210b8d6a2b8a8cb31 (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

PORTNAME=	check_mk_agent
DISTVERSIONPREFIX=	v
DISTVERSION=	1.6.0p19
CATEGORIES=	net-mgmt
MASTER_SITES=	https://raw.githubusercontent.com/tribe29/checkmk/${DISTVERSIONFULL}/agents/:agent \
		https://raw.githubusercontent.com/tribe29/checkmk/${DISTVERSIONFULL}/doc/agents/:doc \
		https://raw.githubusercontent.com/tribe29/checkmk/${DISTVERSIONFULL}/:license
DISTFILES=	${_CHECKMK_AGENT}:agent \
		README.FreeBSD:doc \
		COPYING:license
DIST_SUBDIR=	${PORTNAME}-${PORTVERSION}

MAINTAINER=	0mp@FreeBSD.org
COMMENT=	Nagios-compatible agent for the Checkmk monitoring

LICENSE=	GPLv2
LICENSE_FILE=	${WRKSRC}/COPYING

RUN_DEPENDS=	bash>0:shells/bash

USES=		perl5 shebangfix
USE_PERL5=	run

SHEBANG_FILES=	${_CHECKMK_AGENT}

EXTRACT_CMD=	${CP}
EXTRACT_BEFORE_ARGS=	# none
EXTRACT_AFTER_ARGS=	${WRKSRC}

NO_ARCH=	yes
NO_BUILD=	yes
NO_TEST=	yes

SUB_FILES=	pkg-message
SUB_LIST=	PORTNAME=${PORTNAME}

NO_WRKSUBDIR=	yes

PLIST_FILES=	bin/${PORTNAME}

PORTDOCS=	README.FreeBSD

OPTIONS_DEFINE=	DOCS

_CHECKMK_AGENT=		${PORTNAME}.freebsd
_CHECKMK_CONFDIR=	${LOCALBASE}/etc/check_mk
_CHECKMK_LIBDIR=	${LOCALBASE}/lib/check_mk_agent
_CHECKMK_TMPDIR=	/var/run/check_mk

post-patch:
	@${REINPLACE_CMD} \
		-e 's|%%CHECKMK_LIBDIR%%|${_CHECKMK_LIBDIR}|' \
		-e 's|%%CHECKMK_CONFDIR%%|${_CHECKMK_CONFDIR}|' \
		-e 's|%%CHECKMK_TMPDIR%%|${_CHECKMK_TMPDIR}|' \
		-e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
		-e 's|%%BASH%%|${LOCALBASE}/bin/bash|' \
		${WRKSRC}/${_CHECKMK_AGENT}

do-install:
	${INSTALL_SCRIPT} ${WRKSRC}/${_CHECKMK_AGENT} \
		${STAGEDIR}${PREFIX}/bin/${PORTNAME}

post-install-DOCS-on:
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
	${INSTALL_DATA} ${WRKSRC}/README.FreeBSD \
		${STAGEDIR}${DOCSDIR}

.include <bsd.port.mk>