48 | | move ${destroot}${prefix}/etc/broccoli.conf ${destroot}${prefix}/etc/broccoli.conf.dist |
| 48 | xinstall -d ${destroot}${prefix}/share/examples/${name} |
| 49 | move ${destroot}${prefix}/etc/bro/broccoli.conf ${destroot}${prefix}/share/examples/${name}/ |
| 50 | move ${destroot}${prefix}/etc/bro/node.cfg ${destroot}${prefix}/share/examples/${name}/ |
| 51 | move ${destroot}${prefix}/etc/bro/networks.cfg ${destroot}${prefix}/share/examples/${name}/ |
| 52 | move ${destroot}${prefix}/etc/bro/broctl.cfg ${destroot}${prefix}/share/examples/${name}/ |
| 53 | reinplace "s|${prefix}/spool|${prefix}/var/spool/bro|" ${destroot}${prefix}/share/examples/${name}/broctl.cfg |
| 54 | reinplace "s|${prefix}/logs|${prefix}/var/log/bro|" ${destroot}${prefix}/share/examples/${name}/broctl.cfg |
| 55 | |
| 56 | reinplace "s|/usr/bin/python|${prefix}/bin/python2.7|" ${destroot}${prefix}/bin/broctl |
| 57 | reinplace "s| /usr/bin/env python|${prefix}/bin/python2.7|" ${destroot}${prefix}/bin/trace-summary |
| 58 | |
| 59 | xinstall -d ${destroot}${prefix}/Library/LaunchAgents/ |
| 60 | copy ${filespath}/org.macports.bro.plist ${destroot}${prefix}/Library/LaunchAgents/ |
| 61 | reinplace "s|%%PREFIX%%|${prefix}|g" ${destroot}${prefix}/Library/LaunchAgents/org.macports.bro.plist |
| 62 | |
| 63 | xinstall -d ${destroot}${prefix}/etc/${name} |
| 64 | xinstall -d ${destroot}${prefix}/var/log/${name} |
| 65 | destroot.keepdirs ${destroot}${prefix}/etc/${name} \ |
| 66 | ${destroot}${prefix}/var/log/${name} |
52 | | if {![file exists ${prefix}/etc/broccoli.conf]} { |
53 | | copy ${prefix}/etc/broccoli.conf.dist ${prefix}/etc/broccoli.conf |
| 70 | if {![file exists ${prefix}/etc/bro/broccoli.conf]} { |
| 71 | copy ${prefix}/share/examples/${name}/broccoli.conf ${prefix}/etc/bro/broccoli.conf |
| 72 | } |
| 73 | if {![file exists ${prefix}/etc/bro/node.cfg]} { |
| 74 | copy ${prefix}/share/examples/${name}/node.cfg ${prefix}/etc/bro/node.cfg |
| 75 | } |
| 76 | if {![file exists ${prefix}/etc/bro/networks.cfg]} { |
| 77 | copy ${prefix}/share/examples/${name}/networks.cfg ${prefix}/etc/bro/networks.cfg |
| 78 | } |
| 79 | if {![file exists ${prefix}/etc/bro/broctl.cfg]} { |
| 80 | copy ${prefix}/share/examples/${name}/broctl.cfg ${prefix}/etc/bro/broctl.cfg |
57 | | notes \ |
58 | | "You'll need to set your BROHOME to ${prefix}/share/bro and your\ |
59 | | BROPATH to ${prefix}/share/bro/site:${prefix}/share/bro/policy\ |
60 | | to use the provided policies." |
| 84 | startupitem.create yes |
| 85 | startupitem.netchange yes |
| 86 | startupitem.start "${prefix}/bin/broctl start" |
| 87 | startupitem.stop "${prefix}/bin/broctl stop" |
| 88 | startupitem.restart "${prefix}/bin/broctl restart" |
| 89 | |
| 90 | notes " |
| 91 | You'll need to set your BROHOME to ${prefix}/share/bro and your |
| 92 | BROPATH to ${prefix}/share/bro/site:${prefix}/share/bro/policy |
| 93 | to use the provided policies. (which user?) |
| 94 | |
| 95 | Check online documentation to finish install |
| 96 | http://www.bro.org/sphinx/quickstart/index.html |
| 97 | |
| 98 | 1) review config: node.cfg, network.cfg, broctl.cfg |
| 99 | especially network interface, MailTo |
| 100 | Existing files have not been modified |
| 101 | |
| 102 | 2) Run as root or w sudo |
| 103 | # broctl |
| 104 | \[BroControl\] > install |
| 105 | \[BroControl\] > start |
| 106 | 3) Use scheduled task for maintenance |
| 107 | # ln -s ${prefix}/Library/LaunchAgents/org.macports.bro.plist /Library/LaunchAgents/ |
| 108 | # launchctl load -w /Library/LaunchAgents/org.macports.bro.plist |
| 109 | |
| 110 | **** UPGRADING **** |
| 111 | |
| 112 | Paths have been changed to respect macports hierarchy |
| 113 | ${prefix}/etc -> ${prefix}/etc/bro |
| 114 | ${prefix}/spool -> ${prefix}/var/spool/bro |
| 115 | ${prefix}/logs -> ${prefix}/var/log/bro |
| 116 | |
| 117 | BUG: System App firewall ask at each launch if bro can accept incoming connections. |
| 118 | |
| 119 | " |
| 120 | |
| 121 | if {${subport} eq ${name}} { |
| 122 | master_sites ${homepage}downloads/release/ \ |
| 123 | ${homepage}downloads/archive/ |
| 124 | |
| 125 | checksums bro-${version}.tar.gz \ |
| 126 | rmd160 ad1820eae034062c0e1125e4a4ac1e61960ad126 \ |
| 127 | sha256 86909361c2d804681f314604a6ce763be663937b2f045c8d25d810528a633dc9 \ |
| 128 | post-patch { |
| 129 | reinplace "s|\${BroBase}/spool|\${BroBase}/var/spool/bro|" ${worksrcpath}/aux/broctl/BroControl/options.py |
| 130 | reinplace "s|\${BroBase}/logs|\${BroBase}/var/log/bro|" ${worksrcpath}/aux/broctl/BroControl/options.py |
| 131 | reinplace "s|\${PREFIX}/logs|\${PREFIX}/var/log/bro|" ${worksrcpath}/aux/broctl/CMakeLists.txt |
| 132 | reinplace "s|{BroBase}/logs|{BroBase}/var/log/bro|" ${worksrcpath}/aux/broctl/doc/broctl.rst |
| 133 | reinplace "s|\${PREFIX}/spool|\${PREFIX}/var/spool/bro|" ${worksrcpath}/aux/broctl/CMakeLists.txt |
| 134 | reinplace "s|{BroBase}/spool|{BroBase}/var/spool/bro|" ${worksrcpath}/aux/broctl/doc/broctl.rst |
| 135 | } |
| 136 | |
| 137 | } |
| 138 | |
| 139 | subport ${name}-devel { |
| 140 | |
| 141 | fetch.type git |
| 142 | git.url git://git.bro.org/bro |
| 143 | ## no support for tag, last one is release |
| 144 | #git.branch devel |
| 145 | ## 2014-03-21 NOK |
| 146 | #git.branch 0f3ed1a553ea40feb50037fbdc45733eeaadd50b |
| 147 | #git.branch 908b574c1823d2181cd628b11e6cd0117e2b449d |
| 148 | #git.branch 066473b1f1bc71fc500a0a0ec447e1603732c53a |
| 149 | patchfiles-delete patch-CMakeLists.txt.diff |
| 150 | |
| 151 | conflicts ${name} |
| 152 | } |
| 153 | |
| 154 | default_variants +mhr |
| 155 | |
| 156 | ## Extra scripts? http://www.bro.org/sphinx/scripts/scripts.html |
| 157 | variant mhr { |
| 158 | master_sites-append http://www.bro.org/sphinx/_downloads/ |
| 159 | distfiles-append detect-MHR.bro |
| 160 | checksums-append \ |
| 161 | detect-MHR.bro \ |
| 162 | rmd160 a84dc9b4adb78f9af0985dde36e09758a1280ff5 \ |
| 163 | sha256 02b3c9fa5d03a1ae2583e55ca6d17190e45214c1920968867bed13051868ca0d |
| 164 | |
| 165 | post-destroot { |
| 166 | ## no further actions needed. will be loaded by bro at next start |
| 167 | copy ${distpath}/detect-MHR.bro ${destroot}${prefix}/share/broctl/scripts/ |
| 168 | } |
| 169 | } |