Ticket #5387: Portfile.2.diff

File Portfile.2.diff, 1.3 KB (added by dports@…, 19 years ago)

Revised Portfile diff

  • Portfile

    old new  
    2424        depends_lib-append    port:mysql4
    2525        configure.args-append --with-mysql=${prefix}
    2626}
     27
     28variant server {
     29    startupitem.create    yes
     30    startupitem.start "${prefix}/bin/snort.sh -c ${prefix}/etc/${name}/snort.conf"
     31    startupitem.stop "killall ${name}"
     32}
     33
     34post-destroot {
     35# Copy the Snort database schemas
     36        xinstall -d -m 755 ${destroot}${prefix}/share/${name}/schemas
     37        eval xinstall -m 755 [glob ${worksrcpath}/schemas/create*] ${destroot}${prefix}/share/${name}/schemas
     38
     39        if { [variant_isset server] } {
     40                xinstall -d ${destroot}${prefix}/bin
     41                xinstall -m 755 ${portpath}/${filesdir}/snort.sh ${destroot}${prefix}/bin  }
     42
     43# A 60 second sleep time is used to allow MySQL to startup fully after boot so Snort won't bail
     44        reinplace "s|placeholder|sleep 60 ; ${prefix}/bin/snort -c ${prefix}/etc/snort/snort.conf|g" \
     45                ${destroot}${prefix}/bin/snort.sh
     46}
     47
     48post-activate {
     49        ui_msg "\n
     50The Snort database schemas are in ${prefix}/share/${name}/schemas.
     51
     52If you used the server variant, make sure to place your snort.conf file in
     53the location ${prefix}/etc/${name} or the startup script cannot find it.
     54\n"
     55}