source: trunk/dports/net/bro/Portfile

Last change on this file was 146517, checked in by raimue@…, 17 months ago

Mass rev-bump dependents of port openssl due to ABI change

Disabling SSLv2 in r146162 changed the ABI of the library, leading to loading
errors for binaries with references to SSLv2 symbols.

https://lists.macosforge.org/pipermail/macports-dev/2016-March/032531.html

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.7 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 146517 2016-03-10 17:49:28Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                bro
7version             2.4.1
8revision            1
9categories          net security
10platforms           darwin
11maintainers         nomaintainer
12license             BSD
13
14description         BRO is a Network Intrusion Detection System
15
16long_description    Bro is an open-source, Unix-based Network Intrusion \
17                    Detection System (NIDS) that passively monitors network \
18                    traffic and looks for suspicious activity.
19
20homepage            http://www.bro.org/
21master_sites        ${homepage}downloads/release/ \
22                    ${homepage}downloads/archive/
23
24checksums           rmd160  d0de91e52d5ff4edd08dff3b913a4250ad43e03a \
25                    sha256  d8b99673a5024630f6bae820c4f8c3ca9029f1167f9e5729c914c66e1fc7c8f6
26
27depends_build       port:cmake \
28                    port:libgeoip \
29                    port:swig-python
30
31# use the system-provided flex
32depends_lib         port:bison \
33                    port:curl \
34                    port:libmagic \
35                    port:libpcap \
36                    path:lib/libssl.dylib:openssl \
37                    port:perl5 \
38                    port:python27 \
39                    port:readline \
40                    port:zlib
41
42variant universal {}
43
44configure.cflags-append "${configure.cflags} [get_canonical_archflags cc]"
45configure.universal_args
46
47configure.args      --enable-mobile-ipv6 --conf-files-dir=${prefix}/etc/bro
48
49post-patch {
50    reinplace "s|\${BroBase}/spool|\${BroBase}/var/spool/bro|" ${worksrcpath}/aux/broctl/BroControl/options.py
51    reinplace "s|\${BroBase}/logs|\${BroBase}/var/log/bro|" ${worksrcpath}/aux/broctl/BroControl/options.py
52    reinplace "s|\${PREFIX}/logs|\${PREFIX}/var/log/bro|" ${worksrcpath}/aux/broctl/CMakeLists.txt
53    reinplace "s|{BroBase}/logs|{BroBase}/var/log/bro|" ${worksrcpath}/aux/broctl/doc/broctl.rst
54    reinplace "s|\${PREFIX}/spool|\${PREFIX}/var/spool/bro|" ${worksrcpath}/aux/broctl/CMakeLists.txt
55    reinplace "s|{BroBase}/spool|{BroBase}/var/spool/bro|" ${worksrcpath}/aux/broctl/doc/broctl.rst
56}
57
58post-destroot {
59    xinstall -d ${destroot}${prefix}/share/examples/${name}
60    move ${destroot}${prefix}/etc/bro/broccoli.conf ${destroot}${prefix}/share/examples/${name}/
61    move ${destroot}${prefix}/etc/bro/node.cfg ${destroot}${prefix}/share/examples/${name}/
62    move ${destroot}${prefix}/etc/bro/networks.cfg ${destroot}${prefix}/share/examples/${name}/
63    move ${destroot}${prefix}/etc/bro/broctl.cfg ${destroot}${prefix}/share/examples/${name}/
64    reinplace "s|${prefix}/spool|${prefix}/var/spool/bro|" ${destroot}${prefix}/share/examples/${name}/broctl.cfg
65    reinplace "s|${prefix}/logs|${prefix}/var/log/bro|" ${destroot}${prefix}/share/examples/${name}/broctl.cfg
66
67    reinplace "s|/usr/bin/python|${prefix}/bin/python2.7|" ${destroot}${prefix}/bin/broctl
68
69    reinplace "s| /usr/bin/env python|${prefix}/bin/python2.7|" ${destroot}${prefix}/bin/trace-summary
70
71    xinstall -d ${destroot}${prefix}/Library/LaunchDaemons/
72    copy ${filespath}/org.macports.bro.plist ${destroot}${prefix}/Library/LaunchDaemons/
73    reinplace "s|%%PREFIX%%|${prefix}|g" ${destroot}${prefix}/Library/LaunchDaemons/org.macports.bro.plist
74
75    xinstall -d ${destroot}${prefix}/etc/${name}
76    xinstall -d ${destroot}${prefix}/var/log/${name}
77    xinstall -d ${destroot}${prefix}/var/spool/${name}
78    destroot.keepdirs ${destroot}${prefix}/etc/${name} \
79        ${destroot}${prefix}/var/log/${name} \
80        ${destroot}${prefix}/var/spool/${name}
81}
82
83post-activate {
84    if {![file exists ${prefix}/etc/bro/broccoli.conf]} {
85        copy ${prefix}/share/examples/${name}/broccoli.conf ${prefix}/etc/bro/broccoli.conf
86    }
87    if {![file exists ${prefix}/etc/bro/node.cfg]} {
88        copy ${prefix}/share/examples/${name}/node.cfg ${prefix}/etc/bro/node.cfg
89    }
90    if {![file exists ${prefix}/etc/bro/networks.cfg]} {
91        copy ${prefix}/share/examples/${name}/networks.cfg ${prefix}/etc/bro/networks.cfg
92    }
93    if {![file exists ${prefix}/etc/bro/broctl.cfg]} {
94        copy ${prefix}/share/examples/${name}/broctl.cfg ${prefix}/etc/bro/broctl.cfg
95    }
96}
97
98startupitem.create      yes
99startupitem.netchange   yes
100startupitem.start       "${prefix}/bin/broctl start"
101startupitem.stop        "${prefix}/bin/broctl stop"
102startupitem.restart     "${prefix}/bin/broctl restart"
103
104# This doesn't work due to error: error: AF_UNIX path too long
105# To manual test:
106# sudo port build
107# cd ${worksrcpath}/aux/btest/testing
108# sudo make all
109#
110#test.run            yes
111#test.target         all
112#test.dir            ${worksrcpath}/aux/btest/testing
113
114notes "
115You'll need to set your BROHOME to ${prefix}/share/bro and your
116BROPATH to ${prefix}/share/bro/site:${prefix}/share/bro/policy
117to use the provided policies.
118
119Check online documentation to finish install
120http://www.bro.org/sphinx/quickstart/index.html
121
1221) review config: node.cfg, network.cfg, broctl.cfg
123   especially network interface, MailTo
124   Existing files have not been modified
125
1262) Run as root or with sudo
127     # broctl
128     \[BroControl\] > install
129     \[BroControl\] > start
130
1313) Use scheduled task for maintenance
132  # ln -s ${prefix}/Library/LaunchDaemons/org.macports.bro.plist /Library/LaunchDaemons/
133  # launchctl load -w /Library/LaunchDaemons/org.macports.bro.plist
134
135
136**** UPGRADING ****
137
138Paths have been changed to respect macports hierarchy
139${prefix}/etc -> ${prefix}/etc/bro
140${prefix}/spool -> ${prefix}/var/spool/bro
141${prefix}/logs -> ${prefix}/var/log/bro
142"
143
144livecheck.type      regex
145livecheck.url       ${homepage}download/
146livecheck.regex     ${name}-(\[0-9a-z.\]+)${extract.suffix}
Note: See TracBrowser for help on using the repository browser.