1 | # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 |
---|
2 | # $Id: Portfile 92837 2012-05-09 00:51:48Z ryandesign@macports.org $ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | |
---|
6 | name xymon-client |
---|
7 | set shortname xymon |
---|
8 | conflicts xymon-server |
---|
9 | version 4.3.10 |
---|
10 | categories net |
---|
11 | platforms darwin |
---|
12 | license GPL-2 |
---|
13 | maintainers free.fr:fclaire |
---|
14 | |
---|
15 | description Xymon network monitor Client |
---|
16 | |
---|
17 | long_description Xymon is a system for monitoring of hosts and networks, \ |
---|
18 | inspired by the Big Brother system. It provides real-time \ |
---|
19 | monitoring, an easy web-interface, historical data, \ |
---|
20 | availability reports and performance graphs. \ |
---|
21 | Xymon was previously known as \"Hobbit\". |
---|
22 | |
---|
23 | homepage http://www.xymon.com/ |
---|
24 | master_sites sourceforge:project/xymon/Xymon/${version} |
---|
25 | distname ${shortname}-${version} |
---|
26 | dist_subdir ${shortname} |
---|
27 | |
---|
28 | checksums sha1 d37765da5741adc4282e081e3ad59862eb22353f \ |
---|
29 | rmd160 df5e01ab4528bc1146cdf784bbf69616f743bfa1 |
---|
30 | |
---|
31 | depends_lib port:rrdtool \ |
---|
32 | port:fping \ |
---|
33 | port:pcre \ |
---|
34 | port:libpng \ |
---|
35 | port:openssl \ |
---|
36 | port:openldap |
---|
37 | |
---|
38 | universal_variant no |
---|
39 | |
---|
40 | patchfiles patch-build-Makefile.Darwin.diff |
---|
41 | |
---|
42 | if {"darwin" == ${os.platform} && ${os.major} > 8} { |
---|
43 | set xymonuser _xymon |
---|
44 | } else { |
---|
45 | set xymonuser xymon |
---|
46 | } |
---|
47 | set xymongroup ${xymonuser} |
---|
48 | set xytopdir ${prefix}/lib/${shortname} |
---|
49 | set xyetcdir ${xytopdir}/client/etc |
---|
50 | set xylogdir ${xytopdir}/client/logs |
---|
51 | set xytmpdir ${xytopdir}/client/tmp |
---|
52 | set xyvardir ${xytopdir}/data |
---|
53 | set xywebdir ${xytopdir}/web |
---|
54 | set xywwwdir ${xytopdir}/www |
---|
55 | |
---|
56 | configure.cmd ./configure.client |
---|
57 | configure.args-append --rrdinclude ${prefix}/include \ |
---|
58 | --rrdlib ${prefix}/lib \ |
---|
59 | --pcreinclude ${prefix}/include \ |
---|
60 | --pcrelib ${prefix}/lib \ |
---|
61 | --sslinclude ${prefix}/include \ |
---|
62 | --ssllib ${prefix}/lib \ |
---|
63 | --ldapinclude ${prefix}/include \ |
---|
64 | --ldaplib ${prefix}/lib \ |
---|
65 | --fping ${prefix}/sbin/fping |
---|
66 | configure.env-append ENABLESSL=y \ |
---|
67 | XYMONUSER=${xymonuser} \ |
---|
68 | XYMONTOPDIR=${xytopdir} \ |
---|
69 | XYMONHOSTIP=127.0.0.1 \ |
---|
70 | XYMONHOSTOS=${os.platform} \ |
---|
71 | MANROOT=${prefix}/share/man \ |
---|
72 | INSTALLBINDIR=${xytopdir}/client/bin \ |
---|
73 | INSTALLETCDIR=${xyetcdir} \ |
---|
74 | INSTALLEXTDIR=${xytopdir}/client/ext \ |
---|
75 | INSTALLTMPDIR=${xytmpdir} \ |
---|
76 | INSTALLWEBDIR=${xywebdir} \ |
---|
77 | INSTALLWWWDIR=${xywwwdir} \ |
---|
78 | XYMONVAR=${xyvardir} \ |
---|
79 | CC=${configure.cc} \ |
---|
80 | CXX=${configure.cxx} \ |
---|
81 | CPP=${configure.cpp} |
---|
82 | |
---|
83 | build.args-append CC=${configure.cc} \ |
---|
84 | CXX=${configure.cxx} \ |
---|
85 | CPP=${configure.cpp} |
---|
86 | |
---|
87 | destroot.env-append INSTALLROOT=${destroot} |
---|
88 | destroot.keepdirs ${destroot}${xytopdir} \ |
---|
89 | ${destroot}${xylogdir} \ |
---|
90 | ${destroot}${xytmpdir} \ |
---|
91 | ${destroot}${xyvardir}/logs \ |
---|
92 | ${destroot}${xyvardir} \ |
---|
93 | ${destroot}${xywebdir} |
---|
94 | |
---|
95 | startupitem.create yes |
---|
96 | startupitem.start "sudo su ${xymonuser} -c \"${xytopdir}/client/runclient.sh start\"" |
---|
97 | startupitem.stop "sudo su ${xymonuser} -c \"${xytopdir}/client/runclient.sh stop\"" |
---|
98 | startupitem.restart "sudo su ${xymonuser} -c \"${xytopdir}/client/runclient.sh restart\"" |
---|
99 | #startupitem.pidfile auto ${xylogdir}/clientlaunch.*.pid |
---|
100 | startupitem.pidfile none |
---|
101 | |
---|
102 | add_users ${xymonuser} group=${xymongroup} realname=Xymon\ User home=${xytopdir} shell=/bin/bash |
---|
103 | |
---|
104 | post-destroot { |
---|
105 | xinstall -d -o ${xymonuser} -g ${xymongroup} ${destroot}${xylogdir} |
---|
106 | xinstall -d -o ${xymonuser} -g ${xymongroup} ${destroot}${xytmpdir} |
---|
107 | # Adding a suffix to config files |
---|
108 | foreach f { clientlaunch.cfg localclient.cfg xymonclient.cfg } { |
---|
109 | move ${destroot}${xyetcdir}/${f} ${destroot}${xyetcdir}/${f}.${version} |
---|
110 | } |
---|
111 | } |
---|
112 | |
---|
113 | post-activate { |
---|
114 | # If not already present we put default config files |
---|
115 | foreach f { clientlaunch.cfg localclient.cfg xymonclient.cfg } { |
---|
116 | if {![file exists ${xyetcdir}/${f}]} { |
---|
117 | file copy ${xyetcdir}/${f}.${version} ${xyetcdir}/${f} |
---|
118 | } |
---|
119 | } |
---|
120 | } |
---|
121 | |
---|
122 | notes "\nSet your Xymon server's IP address with the following command: |
---|
123 | $ sudo vi ${xyetcdir}/xymonclient.cfg |
---|
124 | |
---|
125 | If you wish your xymon client to report logfiles to your xymon server |
---|
126 | you need to add the user ${xymonuser} to the admin group like this: |
---|
127 | $ sudo dscl . -append /Groups/admin GroupMembership ${xymonuser} |
---|
128 | |
---|
129 | You can start,stop and restart the xymon client with: |
---|
130 | $ sudo -u ${xymonuser} ${xytopdir}/client/runclient.sh \[start|stop|restart\] |
---|
131 | " |
---|
132 | |
---|
133 | use_parallel_build no |
---|
134 | |
---|
135 | livecheck.type regex |
---|
136 | livecheck.url http://sourceforge.net/projects/${shortname}/files/ |
---|
137 | livecheck.regex ${shortname}-(\[0-9.\]+)\\.tar.gz |
---|
138 | |
---|