aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/nsca27/Makefile
blob: 695deed8b63e9b8fe1d6d2a6c6edd8ad0d3d2aa2 (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
70
71
# Created by: Paul Dlug <paul@nerdlabs.com>
# $FreeBSD$

PORTNAME=   nsca
PORTVERSION=    2.7.2
PORTREVISION=   8
CATEGORIES= net-mgmt
MASTER_SITES=   SF/nagios/nsca-2.x/nsca-${PORTVERSION}

MAINTAINER= mm@FreeBSD.org
COMMENT=    Nagios Service Check Acceptor

LICENSE=    GPLv2

#.if !defined(_BUILDING_NSCA_CLIENT)
#RUN_DEPENDS=   nagios:${PORTSDIR}/net-mgmt/nagios
#.endif
LIB_DEPENDS=    libmcrypt.so:${PORTSDIR}/security/libmcrypt

.if !defined(_BUILDING_NSCA_CLIENT)
PKGNAMESUFFIX=  27
CONFLICTS=  nsca-2.9.*
.else
PKGNAMESUFFIX=  27-client
CONFLICTS=  nsca-client-2.9.*
.endif

GNU_CONFIGURE=  yes
USES=       perl5
CONFIGURE_ARGS= --prefix=${PREFIX} --localstatedir=/var/spool/nagios
DOCSDIR?=   ${PREFIX}/share/doc/${PORTNAME}${PKGNAMESUFFIX}

OPTIONS_DEFINE= DOCS

.if !defined(_BUILDING_NSCA_CLIENT)
USE_RC_SUBR=    nsca
PLIST_SUB+= SERVER=""
WITHOUT_CLIENT= yes
PKGMESSAGE= ${WRKDIR}/pkg-message
SUB_FILES+= pkg-message
.else
PLIST_SUB+= SERVER="@comment "
PKGMESSAGE= ${WRKDIR}/pkg-message.client
SUB_FILES+= pkg-message.client
.endif

.if defined(_BUILDING_NSCA_CLIENT)
PLIST_SUB+= CLIENT=""
.else
PLIST_SUB+= CLIENT="@comment "
.endif

DOCS=       Changelog LEGAL README SECURITY

do-install:
.if defined(_BUILDING_NSCA_CLIENT)
    ${INSTALL_PROGRAM} ${WRKSRC}/src/send_nsca ${STAGEDIR}${PREFIX}/sbin/send_nsca
    ${MKDIR} ${STAGEDIR}${PREFIX}/etc/nagios
    ${INSTALL_DATA} ${WRKSRC}/sample-config/send_nsca.cfg ${STAGEDIR}${PREFIX}/etc/nagios/send_nsca.cfg-sample
.else
    ${INSTALL_PROGRAM} ${WRKSRC}/src/nsca ${STAGEDIR}${PREFIX}/sbin/nsca
    ${MKDIR} ${STAGEDIR}${PREFIX}/etc/nagios
    ${INSTALL_DATA} ${WRKSRC}/sample-config/nsca.cfg ${STAGEDIR}${PREFIX}/etc/nagios/nsca.cfg-sample
.endif

post-install:
    @${MKDIR} ${STAGEDIR}${DOCSDIR}
    cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${STAGEDIR}${DOCSDIR}
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.mk>