Ticket #5387: Portfile.5.diff

File Portfile.5.diff, 1.6 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
     30    startupitem.create    yes
     31    startupitem.start "${prefix}/share/${name}/snort.sh"
     32    startupitem.stop  "/bin/kill \$(cat /var/run/snort_*.pid)"
     33}
     34
     35post-destroot {
     36# Copy the Snort database schemas and sample snort.conf
     37        xinstall -d -m 755 ${destroot}${prefix}/share/${name}/schemas
     38        eval xinstall -m 755 [glob ${worksrcpath}/schemas/create*] ${destroot}${prefix}/share/${name}/schemas
     39        xinstall -d -m 755 ${destroot}${prefix}/etc/${name}
     40        xinstall -m 755 ${worksrcpath}/etc/snort.conf ${destroot}${prefix}/etc/${name}
     41
     42        if { [variant_isset server] } {
     43                xinstall -m 755 ${portpath}/${filesdir}/snort.sh ${destroot}${prefix}/share/${name}                   
     44
     45# A 60 second sleep time is used to allow MySQL to startup fully after boot so Snort won't bail
     46        reinplace "s|placeholder|echo Snort will start in 60s ; sleep 60 ; ${prefix}/bin/snort -D -c ${prefix}/etc/snort/snort.conf|g" \
     47                ${destroot}${prefix}/share/${name}/snort.sh
     48        }
     49}
     50
     51post-activate {
     52        ui_msg "\n
     53
     54                ***** File locations *****
     55
     56        The Snort database schemas -> ${prefix}/share/${name}/schemas
     57        The snort.conf sample file -> ${prefix}/etc/${name}
     58
     59NOTE:   If you installed Snort using the +server variant, make sure you do not
     60        change the location of the snort.conf file or the startup scripts
     61        will not be able to find it.
     62\n"
     63
     64}
     65