summaryrefslogtreecommitdiff
path: root/net/nagios-plugins/Makefile
blob: 58cc28f8e01dce15328c58ffae7d10278e6942bf (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# $NetBSD: Makefile,v 1.44 2016/10/01 18:23:18 bouyer Exp $
#

PKGREVISION=	4
CATEGORIES=	net sysutils

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://sourceforge.net/projects/nagiosplug/
COMMENT=	Nagios plugins
LICENSE=	gnu-gpl-v2

PKG_DESTDIR_SUPPORT=	user-destdir

.include "../../net/nagios-plugins/Makefile.common"

.include "../../mk/bsd.prefs.mk"

USE_TOOLS+=	msgfmt msgmerge intltool perl:run xgettext

PKG_GROUPS+=	${NAGIOS_GROUP}
BUILD_DEFS+=	${NAGIOS_GROUP}

CONFIGURE_ARGS+= --without-pgsql --without-mysql \
		--without-smbclient-command --without-snmpget-command \
		--without-snmpgetnext-command --without-fping-command \
		--without-apt-get-command

SPECIAL_PERMS+=	${PREFIX}/libexec/nagios/check_icmp ${SETUID_ROOT_PERMS}
SPECIAL_PERMS+=	${PREFIX}/libexec/nagios/check_dhcp ${SETUID_ROOT_PERMS}

PLIST_VARS+=	linux sunos NetBSD
.if ${OPSYS} == "Linux"
PLIST.linux=	yes
.elif ${OPSYS} == "SunOS"
PLIST.sunos=	yes
.elif ${OPSYS} == "NetBSD"
PLIST.NetBSD=	yes
.endif

.if ${OPSYS} == "NetBSD"
SPECIAL_PERMS+=	${PREFIX}/libexec/nagios/check_ide_smart \
		${REAL_ROOT_USER} ${NAGIOS_GROUP} 4551
.endif

# required to enable large file support on Solaris
.if ${OPSYS} == "SunOS"
CPPFLAGS_LFS!=		getconf LFS_CFLAGS
MAKE_ENV+=		CPPFLAGS_LFS=${CPPFLAGS_LFS:Q}
.endif
LIBS.SunOS+=	-lm

#DEPENDS+=	nagios-base-*:../../net/nagios-base

.if !exists(/usr/bin/ssh)
DEPENDS+=	{ssh{,6}-[0-9]*,openssh-[0-9]*}:../../security/openssh
.endif

.if (!exists(/usr/bin/dig) && !exists(/usr/sbin/dig)) || \
    (!exists(/usr/bin/nslookup) && !exists(/usr/sbin/nslookup))
DEPENDS+=	bind-[0-9]*:../../net/bind910
.endif

.if ${OPSYS} == "NetBSD"
PING_CMD=	/sbin/ping -n -w %d -c %d %s
# The configure logic can't deal with IPv4 ping accepting a timeout (-w option) but IPv6 ping lacking it.
# So stuff the timeout into the -p (pad) option of ping6.
PING6_CMD=	/sbin/ping6 -n -p %d -c %d %s
.else
PING_CMD=	# empty
PING6_CMD=	# empty
.endif

.if !empty(PING_CMD)
CONFIGURE_ARGS+=	--with-ping-command="${PING_CMD}"
.endif
.if !empty(PING6_CMD)
CONFIGURE_ARGS+=	--with-ping6-command="${PING6_CMD}"
.endif

post-install:
	${CHMOD} -x ${DESTDIR}${PREFIX}/libexec/nagios/utils.pm

.include "../../mk/pthread.buildlink3.mk"
.include "../../security/openssl/buildlink3.mk"
.include "../../devel/gettext-lib/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"