Ticket #44463: patch-nginx-Portfile.diff

File patch-nginx-Portfile.diff, 2.1 KB (added by jul_bsd@…, 10 years ago)
  • www/nginx/Portfile

    old new  
    55
    66name                nginx
    77version             1.6.0
     8revision            1
    89categories          www mail
    910platforms           darwin
    1011license             BSD
     
    8283                    ${destroot}${nginx_rundir}
    8384
    8485post-destroot {
     86    xinstall -d ${destroot}${prefix}/share/examples/${name}/
    8587    foreach conf ${nginx_all_confs} {
    8688        set conf_path "${destroot}${nginx_confdir}/${conf}"
    8789        if {[file exists ${conf_path}]} {
    8890            file delete ${conf_path}
    8991        }
     92        if {[file exists ${conf_path}.default]} {
     93            move ${conf_path}.default ${destroot}${prefix}/share/examples/${name}/
     94        }
    9095    }
    9196    file mkdir ${destroot}${prefix}/share/nginx
    9297    file rename ${destroot}${prefix}/html ${destroot}${prefix}/share/nginx
    9398}
    9499
    95 startupitem.create      yes
     100post-activate {
     101    if ![file exists ${prefix}/etc/${name}/nginx.conf ] {
     102        copy ${prefix}/share/examples/${name}/nginx.conf.default ${prefix}/etc/${name}/nginx.conf
     103    }
     104    if ![file exists ${prefix}/etc/${name}/mime.types ] {
     105        copy ${prefix}/share/examples/${name}/mime.types.default ${prefix}/etc/${name}/mime.types
     106    }
     107    if ![file exists ${prefix}/etc/${name}/fastcgi_params ] {
     108        copy ${prefix}/share/examples/${name}/fastcgi_params.default ${prefix}/etc/${name}/fastcgi_params
     109    }
     110}
     111
     112startupitem.create  yes
    96113startupitem.pidfile     auto ${nginx_pidfile}
    97114startupitem.executable  ${prefix}/sbin/nginx
    98115
    99116notes                   \
    100     "A sample nginx configuration file has been installed in
    101     ${nginx_confdir}/nginx.conf.default.\nCopy the configuration to
    102     ${nginx_confdir}/nginx.conf\nand adjust it to your needs before starting\
     117    "A sample nginx configuration files hav been installed in
     118    ${prefix}/share/examples/${name}/. If no existing files, it has been
     119    copied to ${nginx_confdir}.\n
     120    Adjust it to your needs before starting\
    103121    nginx."
    104122
    105123variant addition description {Append text to pages} {