Update x11-drivers/xf86-input-wacom to version 0.34.0_1
[dports.git] / net-mgmt / monitoring-plugins / Makefile
1 # Created by: Blaz Zupan <blaz@si.FreeBSD.org>
2 # $FreeBSD$
3
4 PORTNAME=       monitoring-plugins
5 PORTVERSION=    2.2
6 CATEGORIES=     net-mgmt
7 MASTER_SITES=   https://www.monitoring-plugins.org/download/ LOCAL/mat/${PORTNAME}
8
9 MAINTAINER=     mat@FreeBSD.org
10 COMMENT=        Monitoring Plugins for Nagios
11
12 LICENSE=        GPLv3
13 LICENSE_FILE=   ${WRKSRC}/COPYING
14
15 CONFLICTS_INSTALL=      nagios-plugins-*
16
17 USES=           charsetfix gmake perl5 libtool
18 USE_OPENSSL=    yes
19 USE_SUBMAKE=    yes
20
21 OPTIONS_DEFINE= QSTAT FPING NETSNMP RADIUS MYSQL PGSQL LDAP IPV6 NLS DBI EXTRAOPTS SSH_PORTABLE
22 OPTIONS_SINGLE= DNS
23 OPTIONS_SINGLE_DNS=     DNS_BASE DNS_BINDTOOLS DNS_BIND99 DNS_BIND910 DNS_BIND911
24 OPTIONS_DEFAULT=EXTRAOPTS DNS_BASE
25 OPTIONS_SUB=    yes
26
27 QSTAT_DESC=     Game server query support (check_game)
28 FPING_DESC=     Support for non-flooding fast ping (check_fping)
29 NETSNMP_DESC=   SNMP support (check_snmp)
30 RADIUS_DESC=    Radius support (check_radius)
31 MYSQL_DESC=     MySQL support (check_mysql)
32 PGSQL_DESC=     PostgreSQL support (check_pgsql)
33 LDAP_DESC=      OpenLDAP support (check_ldap)
34 DBI_DESC=       Check database using DBI
35 EXTRAOPTS_DESC= Parsing of plugins ini config files for extra options
36 SSH_PORTABLE_DESC=      Build check_ssh with ports openssh (instead of base)
37
38 DNS_DESC=       Configuration of check_dig and check_dns (see help)
39
40 DNS_BASE_DESC=  >= 10 means drill for check_dig and no check_dns
41 DNS_BINDTOOLS_DESC=     Use dig and nslookup from dns/bind-tools
42 DNS_BIND99_DESC=        Use dig and nslookup from dns/bind99
43 DNS_BIND910_DESC=       Use dig and nslookup from dns/bind910
44 DNS_BIND911_DESC=       Use dig and nslookup from dns/bind911
45
46 EXTRAOPTS_CONFIGURE_ENABLE=     extra-opts
47
48 GNU_CONFIGURE=  yes
49
50 NAGIOSDIR?=     /var/spool/nagios
51
52 NAGIOSWWWDIR?=  www/nagios
53 NAGIOSHTMURL?=  /nagios
54 NAGIOSCGIURL?=  ${NAGIOSHTMURL}/cgi-bin
55
56 CONFIGURE_ARGS+=--with-cgiurl=${NAGIOSCGIURL} \
57                 --sbindir=${PREFIX}/${NAGIOSWWWDIR}/cgi-bin \
58                 --libexecdir=${PREFIX}/libexec/nagios \
59                 --datadir=${PREFIX}/share \
60                 --sysconfdir=${PREFIX}/etc/nagios \
61                 --localstatedir=${NAGIOSDIR} \
62                 --with-perl=${PERL} \
63                 --prefix=${PREFIX}
64
65 # Also, force some commands with their expected paths so that they don't get
66 # disabled.
67 CONFIGURE_ARGS+=ac_cv_path_PATH_TO_QMAIL_QSTAT=/var/qmail/bin/qmail-qstat \
68                 ac_cv_path_PATH_TO_PING=/sbin/ping \
69                 ac_cv_path_PATH_TO_PING6=/sbin/ping6 \
70                 --with-ping-command="/sbin/ping -n -c %d %s" \
71                 --with-ping6-command="/sbin/ping6 -n -c %d %s" \
72                 ac_cv_path_PATH_TO_SMBCLIENT=${LOCALBASE}/bin/smbclient
73
74 CPPFLAGS+=      -I${LOCALBASE}/include
75 LIBS+=          -L${LOCALBASE}/lib
76
77 QSTAT_BUILD_DEPENDS=    qstat:games/qstat
78 QSTAT_RUN_DEPENDS=      qstat:games/qstat
79 QSTAT_CONFIGURE_OFF=    ac_cv_path_PATH_TO_QUAKESTAT= \
80                         ac_cv_path_PATH_TO_QSTAT=
81
82 IPV6_CONFIGURE_WITH=    ipv6
83
84 FPING_BUILD_DEPENDS=    fping:net/fping
85 FPING_RUN_DEPENDS=      fping:net/fping
86 FPING_CONFIGURE_OFF=    ac_cv_path_PATH_TO_FPING= \
87                         ac_cv_path_PATH_TO_FPING6=
88
89 NETSNMP_BUILD_DEPENDS=  snmpcheck:net-mgmt/net-snmp \
90                 p5-Net-SNMP>=0:net-mgmt/p5-Net-SNMP
91 NETSNMP_RUN_DEPENDS=    snmpcheck:net-mgmt/net-snmp \
92                 p5-Net-SNMP>=0:net-mgmt/p5-Net-SNMP
93 NETSNMP_CONFIGURE_OFF=  ac_cv_path_PATH_TO_SNMPGET= \
94                         ac_cv_path_PATH_TO_SNMPGETNEXT=
95
96 RADIUS_LIB_DEPENDS=     libradiusclient-ng.so:net/radiusclient
97 RADIUS_CONFIGURE_WITH=  radius
98
99 MYSQL_USE=      mysql=yes
100 MYSQL_CONFIGURE_WITH=   mysql=${LOCALBASE}
101
102 PGSQL_USES=     pgsql
103 PGSQL_CONFIGURE_WITH=   pgsql=${LOCALBASE}
104
105 LDAP_USE=       openldap=yes
106 LDAP_CONFIGURE_WITH=    ldap
107
108 NLS_USES=       gettext
109 NLS_CONFIGURE_ENABLE=   nls
110
111 DBI_LIB_DEPENDS=        libdbi.so:databases/libdbi
112 DBI_CONFIGURE_WITH=     dbi
113
114 DNS_BINDTOOLS_BUILD_DEPENDS=    ${LOCALBASE}/bin/dig:dns/bind-tools
115 DNS_BINDTOOLS_CONFIGURE_ON=     --with-dig-command=${LOCALBASE}/bin/dig \
116                                 --with-nslookup-command=${LOCALBASE}/bin/nslookup
117 DNS_BIND99_BUILD_DEPENDS=       ${LOCALBASE}/bin/dig:dns/bind99
118 DNS_BIND99_CONFIGURE_ON=        --with-dig-command=${LOCALBASE}/bin/dig \
119                                 --with-nslookup-command=${LOCALBASE}/bin/nslookup
120 DNS_BIND910_BUILD_DEPENDS=      ${LOCALBASE}/bin/dig:dns/bind910
121 DNS_BIND910_CONFIGURE_ON=       --with-dig-command=${LOCALBASE}/bin/dig \
122                                 --with-nslookup-command=${LOCALBASE}/bin/nslookup
123 DNS_BIND911_BUILD_DEPENDS=      ${LOCALBASE}/bin/dig:dns/bind911
124 DNS_BIND911_CONFIGURE_ON=       --with-dig-command=${LOCALBASE}/bin/dig \
125                                 --with-nslookup-command=${LOCALBASE}/bin/nslookup
126
127 SSH_PORTABLE_BUILD_DEPENDS=     ${LOCALBASE}/bin/ssh:security/openssh-portable
128 SSH_PORTABLE_RUN_DEPENDS:=      ${SSH_PORTABLE_BUILD_DEPENDS}
129 SSH_PORTABLE_CONFIGURE_ON=      --with-ssh-command=${LOCALBASE}/bin/ssh
130
131 .include <bsd.port.options.mk>
132
133 .if ${PORT_OPTIONS:MDNS_BASE}
134 EXTRA_PATCHES+= ${FILESDIR}/extra-patch-dig-to-drill.diff
135 CONFIGURE_ARGS+=--with-dig-command=/usr/bin/drill \
136                 ac_cv_path_PATH_TO_NSLOOKUP=
137 PLIST_SUB+=     CHECK_DNS="@comment "
138 .else
139 .  if ${PORT_OPTIONS:MDNS_BASE}
140 CONFIGURE_ARGS+=        --with-dig-command=/usr/bin/dig \
141                         --with-nslookup-command=/usr/bin/nslookup
142 .  endif
143 PLIST_SUB+=     CHECK_DNS=""
144 .endif
145
146 .if !exists(/usr/bin/ssh) && empty(PORT_OPTIONS:MSSH_PORTABLE)
147 PLIST_SUB+=     SSH="@comment "
148 .else
149 PLIST_SUB+=     SSH=""
150 .endif
151
152 post-patch:
153 .for file in check_by_ssh.c check_disk.c check_http.c check_mrtgtraf.c \
154         check_nagios.c check_ntp.c check_ntp_peer.c check_ntp_time.c \
155         check_pgsql.c check_snmp.c check_ssh.c check_swap.c check_time.c \
156         check_users.c
157         @${REINPLACE_CMD} -e 's|setlocale (LC_ALL, "");|setlocale (LC_ALL, ""); setlocale(LC_NUMERIC, "C");|g' ${WRKSRC}/plugins/${file}
158 .endfor
159         @${REINPLACE_CMD} -e 's|chown root|${TRUE}|g' ${WRKSRC}/plugins-root/Makefile.in
160
161 .include <bsd.port.mk>