Update databases/mariadb104-server to version 10.4.13_2
[dports.git] / net-mgmt / pandorafms_server / Makefile
1 # Created by: KIKUCHI Koichiro <koichiro@rworks.jp>
2 # $FreeBSD$
3
4 PORTNAME=       pandora_server
5 PORTREVISION=   1
6 CATEGORIES=     net-mgmt
7
8 MAINTAINER=     koichiro@rworks.jp
9 COMMENT=        Pandora FMS server
10
11 LICENSE=        ${PANDORA_LICENSE}
12 LICENSE_FILE=   ${PANDORA_LICENSE_FILE}
13
14 PANDORA_DEPS=   p5-DBI>=0:databases/p5-DBI \
15                 p5-HTML-Parser>=0:www/p5-HTML-Parser \
16                 p5-IO-Socket-INET6>=0:net/p5-IO-Socket-INET6 \
17                 p5-NetAddr-IP>=0:net-mgmt/p5-NetAddr-IP \
18                 net-snmp>=0:net-mgmt/net-snmp \
19                 p5-Socket6>=0:net/p5-Socket6 \
20                 p5-XML-Simple>=0:textproc/p5-XML-Simple \
21                 p5-XML-Twig>=0:textproc/p5-XML-Twig \
22                 p5-JSON>=0:converters/p5-JSON
23 BUILD_DEPENDS=  ${PANDORA_DEPS}
24 RUN_DEPENDS=    p5-libwww>=0:www/p5-libwww \
25                 p5-DBD-mysql>=4:databases/p5-DBD-mysql \
26                 wmic:net-mgmt/wmi-client \
27                 nmap:security/nmap \
28                 p5-Encode-Locale>=0:converters/p5-Encode-Locale \
29                 ${PANDORA_DEPS}
30
31 OPTIONS_DEFINE= DOCS TENTACLE XPROBE PGSQL EXTRAS
32 OPTIONS_DEFAULT=        TENTACLE XPROBE EXTRAS
33 DOCS_DESC=      Install AUTHORS, ChangeLog and README
34 TENTACLE_DESC=  Install tentacle_server
35 XPROBE_DESC=    Install xprobe
36 PGSQL_DESC=     Use PostgreSQL backend (experimental)
37 EXTRAS_DESC=    Extra dependencies for util scripts
38
39 USES=           perl5 shebangfix
40 SHEBANG_FILES=  FreeBSD/pandora_server \
41                 bin/pandora_server \
42                 util/integrity_check \
43                 util/pandora_backup.sh \
44                 util/pandora_count.sh \
45                 util/pandora_diagnostic.sh \
46                 util/pandora_remote_agent.sh \
47                 util/pandora_server \
48                 util/pandora_watchdog.sh \
49                 util/plugin/babel_plugin/babel_plugin.sh \
50                 util/plugin/create_integria_incident.sh \
51                 util/plugin/dns_plugin.sh \
52                 util/plugin/integria_plugin/integria_plugin.sh \
53                 util/plugin/mysql_plugin.sh \
54                 util/plugin/packet_loss.sh \
55                 util/plugin/ssh_pandoraplugin.sh \
56                 util/plugin/udp_nmap_plugin.sh \
57                 util/plugin/webcheck_plugin.sh \
58                 util/snmptrap_gen.sh \
59                 util/tentacle_serverd \
60                 util/trap_rate.sh
61 USE_PERL5=      build run
62 SUB_LIST+=      PERL="${PERL}" DATADIR="${DATADIR}"
63 SUB_FILES=      pkg-message
64
65 .include "${.CURDIR}/bsd.pandora.mk"
66
67 PORTDOCS+=      README
68 PANDORA_INSTALLER_ARGS+=        --destdir ${STAGEDIR}
69
70 .include <bsd.port.pre.mk>
71
72 .if ! ${PORT_OPTIONS:MTENTACLE}
73 PLIST_SUB+=     TENTACLE="@comment "
74 PANDORA_INSTALLER_ARGS+=--no-tentacle
75 .else
76 PLIST_SUB+=     TENTACLE=""
77 #USE_RC_SUBR+=  tentacle_server
78 .endif
79 .if ${PORT_OPTIONS:MXPROBE}
80 RUN_DEPENDS+=   ${LOCALBASE}/bin/xprobe2:net/xprobe
81 .endif
82 .if ${PORT_OPTIONS:MPGSQL}
83 RUN_DEPENDS+=   p5-DBD-Pg>=0:databases/p5-DBD-Pg
84 .endif
85 .if ${PORT_OPTIONS:MEXTRAS}
86 # plugin/bgp_pluin.pl
87 RUN_DEPENDS+=   p5-Net-SNMP>=0:net-mgmt/p5-Net-SNMP
88 # plugin/multicast.pl
89 RUN_DEPENDS+=   p5-IO-Socket-Multicast>=0:net/p5-IO-Socket-Multicast
90 # plugin/openvpn_pandoraplugin.pl
91 RUN_DEPENDS+=   p5-Net-Telnet>=0:net/p5-Net-Telnet
92 # plugin/integria_plugin/integria_plugin.sh, plugin/webcheck_plugin.sh,
93 # plugin/babel_plugin/babel_plugin.sh, plugin/create_integria_incident.sh
94 RUN_DEPENDS+=   ${LOCALBASE}/bin/wget:ftp/wget
95 # plugin/ipmi-plugin.pl, recon_scripts/ipmi-recon.pl
96 RUN_DEPENDS+=   ${LOCALBASE}/sbin/ipmi-sensors:sysutils/freeipmi
97 .endif
98
99 post-patch:
100         @${REINPLACE_CMD} \
101                 -e 's|%%PREFIX%%|${PREFIX}|g' \
102                 -e 's|%%DATADIR%%|${DATADIR}|g' \
103                 -e 's|%%MAN1PREFIX%%|${MAN1PREFIX}|g' \
104                 -e 's|%%PANDORA_ETCDIR%%|${PANDORA_ETCDIR}|g' \
105                 -e 's|%%PANDORA_LOGDIR%%|${PANDORA_LOGDIR}|g' \
106                 -e 's|%%PANDORA_SPOOLDIR%%|${PANDORA_SPOOLDIR}|g' \
107                 ${WRKSRC}/pandora_server_installer
108         @${REINPLACE_CMD} -i "" \
109                 -e 's,/usr/bin/perl,${PERL},g' \
110                 `${GREP} -rl /usr/bin/perl ${WRKSRC} | ${GREP} -v pandora_server_installer`
111
112 post-install:
113         @${FIND} ${STAGEDIR}${DATADIR} -type l -name PandoraFMS -delete
114 .for x in pandora_server tentacle_server
115         @cd ${STAGEDIR}${PREFIX}/etc/rc.d && test -f ${x} \
116                 && ${REINPLACE_CMD} -i "" -e 's|/usr/local|${PREFIX}|g' ${x}
117 .endfor
118         @${MV} ${STAGEDIR}${ETCDIR}/pandora_server.conf ${STAGEDIR}${ETCDIR}/pandora_server.conf.sample
119         @${MKDIR} ${STAGEDIR}${DOCSDIR}
120 .for x in ${PORTDOCS}
121         ${INSTALL_DATA} ${WRKSRC}/${x} ${STAGEDIR}${DOCSDIR}
122 .endfor
123
124 .include <bsd.port.post.mk>