Tweak net-mgmt/unifi2 version 2.4.6_4
[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.0
6 PORTREVISION=   3
7 CATEGORIES=     net-mgmt
8 MASTER_SITES=   https://www.monitoring-plugins.org/download/ LOCAL/mat/${PORTNAME}
9
10 MAINTAINER=     mat@FreeBSD.org
11 COMMENT=        Monitoring Plugins for Nagios
12
13 LICENSE=        GPLv3
14 LICENSE_FILE=   ${WRKSRC}/COPYING
15
16 CONFLICTS_INSTALL=      nagios-plugins-*
17
18 USES=           charsetfix gmake perl5 libtool
19 USE_SUBMAKE=    yes
20
21 OPTIONS_DEFINE= QSTAT FPING NETSNMP RADIUS MYSQL PGSQL LDAP IPV6 JAIL NLS DBI EXTRAOPTS SSH_PORTABLE
22 OPTIONS_SINGLE= DNS
23 OPTIONS_SINGLE_DNS=     DNS_BASE DNS_BINDTOOLS DNS_BIND99 DNS_BIND910
24 OPTIONS_DEFAULT=IPV6 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 JAIL_DESC=      Compilation within jail(8) (see help)
35 DBI_DESC=       Check database using DBI
36 EXTRAOPTS_DESC= Parsing of plugins ini config files for extra options
37 SSH_PORTABLE_DESC=      Build check_ssh with ports openssh (instead of base)
38
39 DNS_DESC=       Configuration of check_dig and check_dns (see help)
40
41 DNS_BASE_DESC=  >= 10 means drill for check_dig and no check_dns
42 DNS_BINDTOOLS_DESC=     Use dig and nslookup from dns/bind-tools
43 DNS_BIND99_DESC=        Use dig and nslookup from dns/bind99
44 DNS_BIND910_DESC=       Use dig and nslookup from dns/bind910
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 NAGIOSPOLLIP?=  127.0.0.1
57 NAGIOSPOLLIP6?= ::1
58
59 CONFIGURE_ARGS+=--with-cgiurl=${NAGIOSCGIURL} \
60                 --sbindir=${PREFIX}/${NAGIOSWWWDIR}/cgi-bin \
61                 --libexecdir=${PREFIX}/libexec/nagios \
62                 --datadir=${PREFIX}/share \
63                 --sysconfdir=${PREFIX}/etc/nagios \
64                 --localstatedir=${NAGIOSDIR} \
65                 --with-perl=${PERL} \
66                 --prefix=${PREFIX}
67
68 # Also, force some commands with their expected paths so that they don't get
69 # disabled.
70 CONFIGURE_ARGS+=--with-qmail-qstat-command=/var/qmail/bin/qmail-qstat
71
72 CPPFLAGS+=      -I${LOCALBASE}/include
73 LIBS+=          -L${LOCALBASE}/lib
74
75 QSTAT_BUILD_DEPENDS=    qstat:${PORTSDIR}/games/qstat
76 QSTAT_RUN_DEPENDS=      qstat:${PORTSDIR}/games/qstat
77 QSTAT_CONFIGURE_OFF=    ac_cv_path_PATH_TO_QUAKESTAT= \
78                         ac_cv_path_PATH_TO_QSTAT=
79
80 IPV6_CONFIGURE_WITH=    ipv6
81
82 FPING_BUILD_DEPENDS=    fping:${PORTSDIR}/net/fping
83 FPING_RUN_DEPENDS=      fping:${PORTSDIR}/net/fping
84 FPING_CONFIGURE_OFF=    ac_cv_path_PATH_TO_FPING= \
85                         ac_cv_path_PATH_TO_FPING6=
86
87 NETSNMP_BUILD_DEPENDS=  snmpcheck:${PORTSDIR}/net-mgmt/net-snmp \
88                 p5-Net-SNMP>=0:${PORTSDIR}/net-mgmt/p5-Net-SNMP
89 NETSNMP_RUN_DEPENDS=    snmpcheck:${PORTSDIR}/net-mgmt/net-snmp \
90                 p5-Net-SNMP>=0:${PORTSDIR}/net-mgmt/p5-Net-SNMP
91 NETSNMP_CONFIGURE_OFF=  ac_cv_path_PATH_TO_SNMPGET= \
92                         ac_cv_path_PATH_TO_SNMPGETNEXT=
93
94 RADIUS_LIB_DEPENDS=     libradiusclient-ng.so:${PORTSDIR}/net/radiusclient
95 RADIUS_CONFIGURE_WITH=  radius
96
97 MYSQL_USE=      mysql=yes
98 MYSQL_CONFIGURE_ON=     --with-mysql=${LOCALBASE}
99 MYSQL_CONFIGURE_OFF=    --without-mysql
100
101 PGSQL_USES=     pgsql
102 PGSQL_CONFIGURE_ON=     --with-pgsql=${LOCALBASE}
103 PGSQL_CONFIGURE_OFF=    --without-pgsql
104
105 LDAP_USE=       openldap=yes
106 LDAP_CONFIGURE_WITH=    ldap
107
108 NLS_USES=       gettext
109 NLS_CONFIGURE_ENABLE=   nls
110 NLS_USES_OFF=   gettext:build
111
112 DBI_LIB_DEPENDS=        libdbi.so:${PORTSDIR}/databases/libdbi
113 DBI_CONFIGURE_WITH=     dbi
114
115 DNS_BINDTOOLS_BUILD_DEPENDS=    ${LOCALBASE}/bin/dig:${PORTSDIR}/dns/bind-tools
116 DNS_BINDTOOLS_CONFIGURE_ON=     --with-dig-command=${LOCALBASE}/bin/dig \
117                                 --with-nslookup-command=${LOCALBASE}/bin/nslookup
118 DNS_BIND99_BUILD_DEPENDS=       ${LOCALBASE}/bin/dig:${PORTSDIR}/dns/bind99
119 DNS_BIND99_CONFIGURE_ON=        --with-dig-command=${LOCALBASE}/bin/dig \
120                                 --with-nslookup-command=${LOCALBASE}/bin/nslookup
121 DNS_BIND910_BUILD_DEPENDS=      ${LOCALBASE}/bin/dig:${PORTSDIR}/dns/bind910
122 DNS_BIND910_CONFIGURE_ON=       --with-dig-command=${LOCALBASE}/bin/dig \
123                                 --with-nslookup-command=${LOCALBASE}/bin/nslookup
124
125 SSH_PORTABLE_BUILD_DEPENDS=     ${LOCALBASE}/bin/ssh:${PORTSDIR}/security/openssh-portable
126 SSH_PORTABLE_RUN_DEPENDS:=      ${SSH_PORTABLE_BUILD_DEPENDS}
127 SSH_PORTABLE_CONFIGURE_ON=      --with-ssh-command=${LOCALBASE}/bin/ssh
128
129 .include <bsd.port.options.mk>
130
131 .if ${OSVERSION} > 1000055 && ${PORT_OPTIONS:MDNS_BASE}
132 EXTRA_PATCHES+= ${FILESDIR}/extra-patch-dig-to-drill.diff
133 CONFIGURE_ARGS+=--with-dig-command=/usr/bin/drill
134 PLIST_SUB+=     CHECK_DNS="@comment "
135 .else
136 .  if ${PORT_OPTIONS:MDNS_BASE}
137 CONFIGURE_ARGS+=        --with-dig-command=/usr/bin/dig \
138                         --with-nslookup-command=/usr/bin/nslookup
139 .  endif
140 PLIST_SUB+=     CHECK_DNS=""
141 .endif
142
143 .if !exists(/usr/bin/ssh) && empty(PORT_OPTIONS:MSSH_PORTABLE)
144 PLIST_SUB+=     SSH="@comment "
145 .else
146 PLIST_SUB+=     SSH=""
147 .endif
148
149 post-patch:
150 .for file in check_by_ssh.c check_disk.c check_http.c check_mrtgtraf.c \
151         check_nagios.c check_ntp.c check_ntp_peer.c check_ntp_time.c \
152         check_pgsql.c check_snmp.c check_ssh.c check_swap.c check_time.c \
153         check_users.c
154         @${REINPLACE_CMD} -e 's|setlocale (LC_ALL, "");|setlocale (LC_ALL, ""); setlocale(LC_NUMERIC, "C");|g' ${WRKSRC}/plugins/${file}
155 .endfor
156         @${REINPLACE_CMD} -e 's|chown root|${TRUE}|g' ${WRKSRC}/plugins-root/Makefile.in
157 .if ${PORT_OPTIONS:MJAIL}
158         @${REINPLACE_CMD} -e 's# 127\.0\.0\.1 # ${NAGIOSPOLLIP} #g' ${WRKSRC}/configure
159         @${REINPLACE_CMD} -e 's# ::1 # ${NAGIOSPOLLIP6} #g' ${WRKSRC}/configure
160 .endif
161
162 .include <bsd.port.mk>