24 | | depends_lib port:pcre |
| 25 | depends_lib port:pcre |
| 26 | |
| 27 | startupitem.create yes |
| 28 | startupitem.start "${prefix}/share/${name}/varnish.init start" |
| 29 | startupitem.stop "${prefix}/share/${name}/varnish.init stop" |
| 30 | |
| 31 | post-destroot { |
| 32 | # create dir |
| 33 | xinstall -d -m 755 ${destroot}${prefix}/share/${name} |
| 34 | |
| 35 | # copy files |
| 36 | xinstall -m 644 ${filespath}/varnish.conf.in ${destroot}${prefix}/etc/${name}/varnish.conf.default |
| 37 | xinstall -m 755 ${filespath}/varnish.init.in ${destroot}${prefix}/share/${name}/${name}.init |
| 38 | xinstall -m 755 ${filespath}/varnish-vcl-reload.in ${destroot}${prefix}/sbin/varnish-vcl-reload |
| 39 | |
| 40 | # replace @PREFIX@ to ${prefix} |
| 41 | reinplace "s|@PREFIX@|${prefix}|g" \ |
| 42 | ${destroot}${prefix}/etc/${name}/varnish.conf.default \ |
| 43 | ${destroot}${prefix}/share/${name}/${name}.init \ |
| 44 | ${destroot}${prefix}/sbin/varnish-vcl-reload |
| 45 | |
| 46 | file rename ${destroot}${prefix}/etc/${name}/default.vcl ${destroot}${prefix}/etc/${name}/default.vcl.default |
| 47 | } |
| 48 | |
| 49 | post-activate { |
| 50 | if {![file exists ${prefix}/etc/${name}/default.vcl]} { |
| 51 | file copy ${prefix}/etc/${name}/default.vcl.default \ |
| 52 | ${prefix}/etc/${name}/default.vcl |
| 53 | } |
| 54 | if {![file exists ${prefix}/etc/${name}/varnish.conf]} { |
| 55 | file copy ${prefix}/etc/${name}/varnish.conf.default \ |
| 56 | ${prefix}/etc/${name}/varnish.conf |
| 57 | } |
| 58 | |
| 59 | # dirs nedded to run varnish |
| 60 | xinstall -d -m 755 -o nobody -g nobody ${prefix}/var/${name} |
| 61 | xinstall -d -m 755 -o nobody -g nobody ${prefix}/var/run/${name} |
| 62 | } |
| 63 | |
| 64 | livecheck.url ${master_sites} |
| 65 | livecheck.type regex |
| 66 | livecheck.regex ${name}-(\\d+\\.\\d+\\.\\d+).tar.gz |