Update lang/perl5.16 to version 5.16.3_22
[dports.git] / net-mgmt / observium / Makefile
1 # Created by: rflynn@acsalaska.net
2 # $FreeBSD$
3
4 PORTNAME=       observium
5 PORTVERSION=    0.15.06.6430
6 PORTREVISION=   0
7 CATEGORIES=     net-mgmt
8 MASTER_SITES=   http://www.observium.org/
9 DISTNAME=       ${PORTNAME}-community-latest
10 DIST_SUBDIR=    ${PORTNAME}-${PORTVERSION}
11
12 MAINTAINER=     feld@FreeBSD.org
13 COMMENT=        Autodiscovering PHP/MySQL/SNMP based network monitoring
14
15 LICENSE=        GPLv3
16
17 WRKSRC=         ${WRKDIR}/${PORTNAME}
18
19 USES=           python shebangfix
20 SHEBANG_FILES=  html/js/makemini.pl \
21         mibs/process.pl \
22         scripts/agent-local/areca-hw \
23         scripts/agent-local/asterisk \
24         scripts/agent-local/bind \
25         scripts/agent-local/crashplan \
26         scripts/agent-local/edac \
27         scripts/agent-local/exim-mailqueue.sh \
28         scripts/agent-local/hdarray \
29         scripts/agent-local/ipmitool-sensor \
30         scripts/agent-local/ksm \
31         scripts/agent-local/lmsensors \
32         scripts/agent-local/postfix_mailgraph \
33         scripts/agent-local/postfix_qshape \
34         scripts/agent-local/postgresql.pl \
35         scripts/agent-local/sabnzbd-qstatus \
36         scripts/agent-local/temperature \
37         scripts/agent-local/vmwaretools \
38         scripts/agent-local/zimbra \
39         scripts/cron-hourly.sh \
40         scripts/cron-minute.sh \
41         scripts/cron.sh \
42         scripts/get-geshi.sh \
43         scripts/get-jpgraph.sh \
44         scripts/ifAlias scripts/rename-mibs.pl \
45         scripts/makecss.sh \
46         scripts/observium_agent \
47         scripts/removespikes.php scripts/rrdtoolx.py \
48         scripts/removespikes.pl scripts/add_ds.pl \
49         scripts/watchmaillog/watchmaillog.pl
50
51 USE_PHP=        ctype filter gd json mcrypt mysql session snmp tokenizer xml
52 WANT_PHP_CLI=   yes
53
54 NO_BUILD=       yes
55
56 RUN_DEPENDS+=   rrdtool:${PORTSDIR}/databases/rrdtool \
57                 dot:${PORTSDIR}/graphics/graphviz \
58                 Magick-config:${PORTSDIR}/graphics/ImageMagick \
59                 mtr:${PORTSDIR}/net/mtr-nox11 \
60                 ${LOCALBASE}/share/pear/Net/IPv4.php:${PORTSDIR}/net/pear-Net_IPv4 \
61                 ${LOCALBASE}/share/pear/Net/IPv6.php:${PORTSDIR}/net/pear-Net_IPv6 \
62                 snmpget:${PORTSDIR}/net-mgmt/net-snmp
63
64 OPTIONS_DEFINE= APACHEMOD FPING IPMITOOL LIBVIRT MYSQLD NAGPLUGINS NMAP PYPOLLER SVN WMIC
65 OPTIONS_DEFAULT=        APACHEMOD FPING IPMITOOL LIBVIRT NAGPLUGINS NMAP PYPOLLER SVN WMIC
66 APACHEMOD_DESC= Use PHP with Apache 2.2+ module
67 FPING_DESC=     Enable fping support ping monitoring
68 IPMITOOL_DESC=  Enable support for monitoring hardware IPMI
69 MYSQLD_DESC=    Use local MySQL server
70 WMIC_DESC=      Enable support for WMI polling
71 PYPOLLER_DESC=  Enable Python Poller Wrapper
72
73 FPING_RUN_DEPENDS=      fping:${PORTSDIR}/net/fping
74 IPMITOOL_RUN_DEPENDS=   ipmitool:${PORTSDIR}/sysutils/ipmitool
75 LIBVIRT_RUN_DEPENDS=    virsh:${PORTSDIR}/devel/libvirt
76 NAGPLUGINS_RUN_DEPENDS= ${LOCALBASE}/libexec/nagios/check_nagios:${PORTSDIR}/net-mgmt/nagios-plugins
77 NMAP_RUN_DEPENDS=       nmap:${PORTSDIR}/security/nmap
78 PYPOLLER_RUN_DEPENDS=   ${PYTHON_PKGNAMEPREFIX}MySQLdb>0:${PORTSDIR}/databases/py-MySQLdb
79 SVN_RUN_DEPENDS=        svn:${PORTSDIR}/devel/subversion
80 WMIC_RUN_DEPENDS=       wmic:${PORTSDIR}/net-mgmt/wmi-client
81
82 .include <bsd.port.options.mk>
83
84 SUB_FILES+=     pkg-message
85 SUB_LIST+=      PHP="${PHPBASE}/bin/php"
86
87 ROOT_FILES=     rename_device.php snmptrap.php .scrutinizer.yml add_device.php \
88                 snmpd.conf.example check-errors.php config_to_json.php delete_device.php \
89                 syslog.php irc.php snmp.conf.example adduser.php discovery.php \
90                 check-services.php poller.php config.php.default poller-wrapper.py
91 ROOT_DIRS=      html scripts includes update mibs
92
93 PORTDOCS=       INSTALL README
94 PORTEXAMPLES=   snmp.conf.example snmpd.conf.example
95
96 .if ${PORT_OPTIONS:MAPACHEMOD} && !defined(PACKAGE_BUILDING)
97 WANT_PHP_MOD=   yes
98 USE_APACHE_RUN= 22+
99 .else
100 # Package builder doesn't create php5 with module
101 WANT_PHP_WEB=   yes
102 .endif
103
104 .if ${PORT_OPTIONS:MMYSQLD}
105 USE_MYSQL=      server
106 .else
107 USE_MYSQL=      client
108 .endif
109
110 post-patch:
111         ${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/poller-wrapper.py ${WRKSRC}/poller.php
112
113 do-install:
114         ${MKDIR} ${STAGEDIR}/${WWWDIR}
115 .for dir in ${ROOT_DIRS}
116         ${MKDIR} ${STAGEDIR}/${WWWDIR}/${dir}
117         cd ${WRKSRC}/${dir} && ${COPYTREE_SHARE} . ${STAGEDIR}/${WWWDIR}/${dir}
118 .endfor
119 .for f in ${ROOT_FILES}
120         ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}/${WWWDIR}
121 .endfor
122         # Create empty rrd dir writable by www
123         ${MKDIR} ${STAGEDIR}/${WWWDIR}/rrd
124         # Files in scripts dir should be executable
125         ${FIND} ${STAGEDIR}/${WWWDIR}/scripts -type f -exec ${CHMOD} +x {} \;
126         # Ensure PHP and Python scripts are executable
127         ${FIND} ${STAGEDIR}/${WWWDIR} -type f -name '*.py' -or -type f -name '*.php' -exec ${CHMOD} +x {} \;
128         # Rename for @sample
129         ${MV} ${STAGEDIR}/${WWWDIR}/config.php.default ${STAGEDIR}/${WWWDIR}/config.php.default.sample
130
131 .if ${PORT_OPTIONS:MDOCS}
132         ${MKDIR} ${STAGEDIR}/${DOCSDIR}
133 .for f in ${PORTDOCS}
134         ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}/${DOCSDIR}
135 .endfor
136 .endif
137 .if ${PORT_OPTIONS:MEXAMPLES}
138         ${MKDIR} ${STAGEDIR}/${EXAMPLESDIR}
139 .for f in ${PORTEXAMPLES}
140         ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}/${EXAMPLESDIR}
141 .endfor
142 .endif
143
144 .include <bsd.port.mk>