Ticket #42856: patch-bro-Portfile.diff

File patch-bro-Portfile.diff, 6.8 KB (added by jul_bsd@…, 11 years ago)
  • net/bro/Portfile

    old new  
    55
    66name                bro
    77version             2.2
     8revision            1
    89categories          net security
    910platforms           darwin
    1011maintainers         gmail.com:tanawts openmaintainer
     
    1718                    traffic and looks for suspicious activity.
    1819
    1920homepage            http://www.bro.org/
    20 master_sites        ${homepage}downloads/release/ \
    21                     ${homepage}downloads/archive/
    22 
    23 checksums           rmd160  ad1820eae034062c0e1125e4a4ac1e61960ad126 \
    24                     sha256  86909361c2d804681f314604a6ce763be663937b2f045c8d25d810528a633dc9
    2521
    2622depends_build       port:cmake \
    2723                    port:libgeoip \
     
    4137patchfiles          patch-CMakeLists.txt.diff
    4238
    4339universal_variant   no
     40test.run            yes
     41test.target         test-all
     42
     43## FIXME! ${prefix}/etc/bro, ${prefix}/var/spool/bro, ${prefix}/var/log/bro
     44configure.args      --enable-mobile-ipv6 --conf-files-dir=${prefix}/etc/bro
    4445
    45 configure.args      --enable-mobile-ipv6
    4646
    4747post-destroot {
    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}
    4967}
    5068
    5169post-activate {
    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
    5481    }
    5582}
    5683
    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."
     84startupitem.create      yes
     85startupitem.netchange   yes
     86startupitem.start       "${prefix}/bin/broctl start"
     87startupitem.stop        "${prefix}/bin/broctl stop"
     88startupitem.restart     "${prefix}/bin/broctl restart"
     89
     90notes "
     91You'll need to set your BROHOME to ${prefix}/share/bro and your
     92BROPATH to ${prefix}/share/bro/site:${prefix}/share/bro/policy
     93to use the provided policies. (which user?)
     94
     95Check online documentation to finish install
     96http://www.bro.org/sphinx/quickstart/index.html
     97
     981) review config: node.cfg, network.cfg, broctl.cfg
     99   especially network interface, MailTo
     100   Existing files have not been modified
     101
     1022) Run as root or w sudo
     103     # broctl
     104     \[BroControl\] > install
     105     \[BroControl\] > start
     1063) 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
     112Paths 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
     117BUG: System App firewall ask at each launch if bro can accept incoming connections.
     118
     119"
     120
     121if {${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
     139subport ${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
     154default_variants      +mhr
     155
     156## Extra scripts? http://www.bro.org/sphinx/scripts/scripts.html
     157variant 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}
    61170
    62171livecheck.type      regex
    63172livecheck.url       ${homepage}download/