source: trunk/dports/net/argus-monitor/Portfile @ 139229

Last change on this file since 139229 was 139229, checked in by jeremyhu@…, 4 years ago

misc: Change port:openssl dependency to path:lib/libssl.dylib:openssl

This should allow usage of libressl as a replacement for openssl in relevant
ports. Not all ports have been tested, but libressl aims for API
compatibility with OpenSSL, so it is expected to work.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.6 KB
Line 
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 139229 2015-08-08 03:10:35Z jeremyhu@macports.org $
3
4PortSystem          1.0
5
6name                argus-monitor
7version             3.7
8categories          net
9license             Artistic
10maintainers         nomaintainer
11description         The All Seeing System and Network Monitoring Software
12long_description    ${description}
13homepage            http://argus.tcp4me.com/
14platforms           darwin
15master_sites        http://www.tcp4me.com/code/argus-archive/
16distfiles           argus-${version}.tgz
17
18checksums           rmd160  f8f9eeb6ca5451475594262efcdd571bda931f32 \
19                    sha256  796f2e0783d535556f457635561bee17cb82e3805c2f99d024068187f4b6f563
20
21worksrcdir          argus-${version}
22
23depends_lib         port:perl5.16 \
24                    port:postfix \
25                    path:lib/libssl.dylib:openssl \
26                    port:freetype \
27                    port:gd2 \
28                    port:fping \
29                    port:db53 \
30                    port:p5.16-dbi \
31                    port:p5.16-berkeleydb \
32                    port:p5.16-socket6 \
33                    port:p5.16-gd \
34                    port:p5.16-time-hires \
35                    port:p5.16-net-ssleay \
36                    port:p5.16-digest-hmac \
37                    port:p5.16-digest-md5 \
38                    port:p5.16-digest-sha1 \
39                    port:p5.16-crypt-des
40
41patchfiles          patch-Makefile.tplt.diff
42
43variant apple_postfix description {Use installed Apple postfix instead of MacPorts version} {
44    depends_lib-delete  port:postfix
45}
46
47startupitem.create  yes
48startupitem.name    argusd
49startupitem.executable \
50                    "${prefix}/sbin/argusd"
51
52# Set the --data_dir configure argument and give me a pointer to it for later reference.
53set argus_data_dir  ${prefix}/var/argus-monitor
54
55# Set the Argus htdocs directory.
56set argus_htdocs    ${prefix}/share/${name}/htdocs
57
58configure.env-append \
59                    PERLNAME=perl5.16
60
61configure.cmd       ./Configure
62configure.args      --bin_dir=${prefix}/bin \
63                    --sbin_dir=${prefix}/sbin \
64                    --lib_dir=${prefix}/lib/argus-monitor \
65                    --data_dir=${argus_data_dir} \
66                    --www_dir=${argus_htdocs}/ \
67                    --cgi_dir=${argus_htdocs}/cgi-bin
68
69post-patch {
70    if { [variant_isset apple_postfix] } {
71        reinplace "s|/lib/sendmail|/usr/sbin/sendmail|g" \
72            ${worksrcpath}/examples/config
73    } else {
74        reinplace "s|/lib/sendmail|${prefix}/sbin/sendmail|g" \
75            ${worksrcpath}/examples/config
76    }
77}
78
79post-destroot {
80    xinstall -m 755 -d ${destroot}${argus_htdocs}/sound
81    xinstall -m 755 -d ${destroot}${argus_htdocs}/img
82    xinstall -m 755 ${worksrcpath}/misc/whoopwhoop.wav ${destroot}${argus_htdocs}/sound
83    eval xinstall -m 640 [glob ${worksrcpath}/misc/*.gif] ${destroot}${argus_htdocs}/img
84    xinstall -m 644 -W ${worksrcpath}/misc argus.css argus.js \
85        ${destroot}${argus_htdocs}
86
87    file copy ${worksrcpath}/examples ${destroot}${prefix}/share/${name}
88
89    system "chown -R www:www ${destroot}${argus_data_dir}"
90    system "chown -R www:www ${destroot}${argus_htdocs}"
91
92    destroot.keepdirs \
93        ${destroot}${argus_data_dir}/gdata \
94        ${destroot}${argus_data_dir}/perl \
95        ${destroot}${argus_data_dir}/stats \
96        ${destroot}${argus_data_dir}/html \
97        ${destroot}${argus_data_dir}/notify
98}
99
100notes "
101  *** To complete the Argus install ***
102
1031) Modify the httpd.conf for Argus
104----------------------------------------------
105-Uncomment the line:
106        AddHandler cgi-script .cgi
107
108-Add a directive for the Argus data directory
109 
110        ScriptAlias /argus \"${argus_htdocs}/cgi-bin/arguscgi\"
111        <Directory \"${argus_htdocs}/cgi-bin\">
112            Allow from all
113            Options ExecCGI
114        </Directory>
115
116
1172) Setup postfix so Argus can send mail via the command-line
118----------------------------------------------
119    cd ${prefix}/etc/postfix
120    sudo cp master.cf.sample master.cf
121    sudo cp main.cf.sample main.cf
122    sudo cp aliases.sample aliases
123
124Redirect OS X's sendmail executable to the one from MacPorts.
125    sudo mv /usr/sbin/sendmail /usr/sbin/sendmail.old
126    sudo ln -s ${prefix}/sbin/sendmail /usr/sbin/sendmail
127
128Startup postfix and set it to run at sytem boot.
129    sudo launchctl load -w /Library/LaunchDaemons/org.macports.postfix.plist
130
131Test postfix by sending a test email from a terminal window.
132    mail joe@mycompany.com
133
134NOTE: Make sure the SMTP server of the receiving domain will relay
135      mail from your Argus workstation.
136
137
1382) Setup the Argus config files
139----------------------------------------------
140-Remove the suffix \".example\" from the files config and user in
141 ${argus_data_dir} and customize them.  Also see ${prefix}/share/${name}/examples.
142
143
1443) Make the Argus files owned by the Apache user/group (default is \"www\")
145----------------------------------------------
146-Execute this terminal command:
147    sudo chown -R <apache-user>:<apache-group> ${prefix}/share/${name}/
148    sudo chown -R <apache-user>:<apache-group> ${argus_data_dir}/
149
150
1514) Rename config.example and user.example to config and user and customize them.
152----------------------------------------------
153For full config file information, see the developer documentation at
154http://argus.tcp4me.com/docs.html. But in a nutshell, it goes like this ....
155
156-The Argus config file is hierarchical; parameters that can be specified at
157 an upper level are inherited by objects below when not explicitly specified.
158
159So you may use service groups:
160
161    Group \"WebServers\" {
162        frequency:  5min
163        retries:    5
164        retrydelay: 10min
165        notify: mail:netadmins@mycompany.com
166
167        Host \"webserver.mycompany.com\" {
168            Service TCP/HTTP
169            Service TCP/HTTPS
170            Service Ping
171        }
172
173        Host \"webmail.mycompany.com\" {
174            Service TCP/HTTP
175            Service TCP/HTTPS
176            Service TCP/POP
177            Service TCP/POPS
178            Service TCP/IMAP
179            Service TCP/IMAPS
180            Service TCP/SMTP
181            Service TCP/SMTPS
182            Service Ping
183            Service UDP {
184                port:   501
185            }
186
187        }
188
189        Host \"dns1.mycompany.com\" {
190            Service UDP/DNS
191
192        }
193    }
194
195-Or you may use the \"shorthand\" notation and fully specify the characteristics
196 of individual hosts completely.
197
198    Host \"www.example.com\" {
199        Service TCP/HTTP
200        Service TCP/HTTPS
201        Service Ping
202        Service TCP {
203            port: 12345
204            info: YoyoDyne Application Server
205        }
206    }
207
208NOTE: Unlike C or Perl, you cannot place the opening \{ on a different line,
209      and the closing \} must be on a line by itself (with optional whitespace).
210
211-Rename config.example to config and customize it with your login passwords.
212
213
2145) Start argusd.
215----------------------------------------------
216
217-Start argusd in the foreground to test it:
218    sudo argusd -fd  (foreground & debug)
219
220-When you have argusd starting without errors, shutdown the foreground
221 processs using argusctl (or Control-C) and use launchctl to start argusd
222 in the background and set it to run at boot:
223
224    argusctl shutdown
225    sudo launchctl load -w /Library/LaunchDaemons/org.macports.argusd.plist
226
227-NOTE: Config file changes are detected automatically by Argus within a few minutes,
228        but the impatient may use argusctl:
229
230    argusctl hup
231
232
2336) Login to the Argus web interface to monitor your services.
234----------------------------------------------
235Login at http://localhost/argus
236
237\n"
238
239livecheck.url       [lindex ${master_sites} 0]
240livecheck.regex     argus-(\[0-9.\]+).tgz
Note: See TracBrowser for help on using the repository browser.