aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/zabbix2-agent/Makefile
blob: 144df088f31512cf255cd57d4aaa26656e66ba9e (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
# Ports collection makefile for:    zabbix-agent
# Date created:     Jun 18 2003
# Whom:         Sergey Akifyev <asa@gascom.ru>
#
# $FreeBSD$
#

PORTNAME=   zabbix
PORTVERSION=    1.4.2
PORTEPOCH=  1
CATEGORIES= net-mgmt
MASTER_SITES=   SF
PKGNAMESUFFIX=  -agent

MAINTAINER= ports@FreeBSD.org
COMMENT=    Application and network monitoring solution

USE_GMAKE=  yes
USE_RC_SUBR=    zabbix_agentd
GNU_CONFIGURE=  yes
CONFIGURE_ARGS= --enable-agent --disable-server
MAKE_ARGS=  ARCH=freebsd

ZABBIX_BIN= agent agentd get sender
ZABBIX_CFG= agent agentd
ZABBIX_BINFILES=${ZABBIX_BIN:S|^|zabbix_|:C|.+|&/&|:S|agentd/|agent/|}
ZABBIX_CFGFILES=${ZABBIX_CFG:S|^|zabbix_|:S|$|.conf|}
PLIST_FILES=    ${ZABBIX_BIN:S|^|bin/zabbix_|} \
        ${ZABBIX_CFG:S|^|%%ETCDIR%%/zabbix_|:S|$|.conf.sample|}

post-patch:
    @${FIND} ${WRKSRC}/src/ -type f|${XARGS} \
        ${REINPLACE_CMD} -e 's|/etc/zabbix|${ETCDIR}|;s|/usr/sbin|${LOCALBASE}/sbin|'

do-install:
    @${ECHO_CMD} '@unexec rmdir %D/${ETCDIR_REL} 2>/dev/null || true' >> ${TMPPLIST}
    @${INSTALL_PROGRAM} ${ZABBIX_BINFILES:S,^,${WRKSRC}/src/,} ${PREFIX}/bin/
    @${INSTALL} -d ${ETCDIR}/
    @for i in ${ZABBIX_CFGFILES};do\
        ${INSTALL_DATA} ${WRKSRC}/misc/conf/$$i ${ETCDIR}/$$i.sample;done
    @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL

.include <bsd.port.mk>