Ticket #35863: 20121116-flexibleStartupItem+codeStyle+VclReloadScript.patch

File 20121116-flexibleStartupItem+codeStyle+VclReloadScript.patch, 3.2 KB (added by robsonpeixoto@…, 11 years ago)

Now, a patch thats realy work well

  • Portfile

     
    11# $Id$
    22
    3 PortSystem            1.0
     3PortSystem          1.0
    44
    5 name                  varnish
    6 epoch                 20110709
    7 version               3.0.3
    8 categories            www
    9 platforms             darwin
    10 maintainers           pmq openmaintainer
     5name                varnish
     6epoch               20110709
     7version             3.0.3
     8revision            1
     9categories          www
     10platforms           darwin
     11maintainers         pmq openmaintainer
    1112
    12 description           Varnish is a state-of-the-art, high-performance HTTP accelerator
    13 long_description      Varnish was written from the ground up to be a high \
    14                       performance caching reverse proxy.
     13description         Varnish is a state-of-the-art, high-performance HTTP accelerator
     14long_description    Varnish was written from the ground up to be a high \
     15                    performance caching reverse proxy.
    1516
    16 homepage              http://www.varnish-cache.org
    17 master_sites          http://repo.varnish-cache.org/source/
     17homepage            http://www.varnish-cache.org
     18master_sites       http://repo.varnish-cache.org/source/
    1819
    19 checksums             rmd160 a911a2637ef26607aad8a1c34a83bc797a15235d \
    20                       sha256 2d37d18d952f58b208ac3a0706d4d3e4c0de304b1fcc9df5019571c75f148ab2
     20checksums           rmd160 a911a2637ef26607aad8a1c34a83bc797a15235d \
     21                    sha256 2d37d18d952f58b208ac3a0706d4d3e4c0de304b1fcc9df5019571c75f148ab2
    2122
    22 depends_build         port:pkgconfig
     23depends_build       port:pkgconfig
    2324
    24 depends_lib           port:pcre
     25depends_lib         port:pcre
     26
     27startupitem.create  yes
     28startupitem.start   "${prefix}/share/${name}/varnish.init start"
     29startupitem.stop    "${prefix}/share/${name}/varnish.init stop"
     30
     31post-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
     49post-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
     64livecheck.url       ${master_sites}
     65livecheck.type      regex
     66livecheck.regex     ${name}-(\\d+\\.\\d+\\.\\d+).tar.gz