# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 PortSystem 1.0 name nginx-devel set propername nginx version 1.27.0 revision 0 categories www mail license BSD maintainers {mps @Schamschula} openmaintainer conflicts nginx description High-performance HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 \ proxy server long_description Nginx ("engine x") is an HTTP and reverse proxy server, a mail proxy \ server, and a generic TCP/UDP proxy server. homepage https://nginx.org/ master_sites https://nginx.org/download:nginx \ https://github.com/simpl/ngx_devel_kit/archive/:devel_kit_module \ https://github.com/leev/ngx_http_geoip2_module/archive/:geoip2_module \ https://github.com/openresty/headers-more-nginx-module/archive/:h_more_module \ https://github.com/openresty/lua-nginx-module/archive/:lua_module \ https://codeload.github.com/arut/nginx-rtmp-module/tar.gz/:rtmp_module distfiles ${propername}-${version}${extract.suffix}:nginx checksums ${propername}-${version}${extract.suffix} \ rmd160 6778b6c15a622a5b81688e11a0df83816c4e3059 \ sha256 b7230e3cf87eaa2d4b0bc56aadc920a960c7873b9991a1b66ffcc08fc650129c \ size 1244887 depends_lib port:pcre \ port:zlib worksrcdir ${propername}-${version} patchfiles patch-auto__install.diff \ patch-conf__nginx.conf.diff set nginx_share ${prefix}/share/${propername} set nginx_examples ${nginx_share}/examples set nginx_confdir ${prefix}/etc/${propername} set nginx_logdir ${prefix}/var/log/${propername} set nginx_moduledir ${prefix}/etc/${propername}/modules set nginx_rundir ${prefix}/var/run/${propername} set nginx_pidfile ${nginx_rundir}/${propername}.pid set nginx_all_confs {fastcgi.conf fastcgi_params mime.types nginx.conf scgi_params uwsgi_params} set auto_activate_confs {nginx.conf mime.types fastcgi.conf} # for aforementioned re-defs of portfile-scoped vars in variant routines proc nginx_set_portfile_var {var_name new_value} { upvar $var_name portfile_var set portfile_var $new_value } # portfile-scoped vars for variant routines to re-def and use in port-stages (post-extract, pre-patch, etc) set nginx_lua_mod_dirname "" configure.args-append \ --with-cc-opt=\"${configure.cppflags} ${configure.cflags}\" \ --with-ld-opt=\"${configure.ldflags}\" \ --conf-path=${nginx_confdir}/${propername}.conf \ --error-log-path=${nginx_logdir}/error.log \ --http-log-path=${nginx_logdir}/access.log \ --pid-path=${nginx_pidfile} \ --lock-path=${nginx_rundir}/${propername}.lock \ --http-client-body-temp-path=${nginx_rundir}/client_body_temp \ --http-proxy-temp-path=${nginx_rundir}/proxy_temp \ --http-fastcgi-temp-path=${nginx_rundir}/fastcgi_temp \ --http-uwsgi-temp-path=${nginx_rundir}/uwsgi_temp \ --with-compat # pcre2 breaks the lua module (https://trac.macports.org/ticket/65150) configure.args-append \ --without-pcre2 # remove --disable-dependency-tracking configure.universal_args-delete --disable-dependency-tracking build.target build if {${subport} eq ${name}} { destroot.keepdirs ${destroot}${nginx_logdir} \ ${destroot}${nginx_rundir} post-destroot { xinstall -d -m 755 ${destroot}${nginx_share} xinstall -d -m 755 ${destroot}${nginx_examples} foreach conf ${nginx_all_confs} { set conf_path "${destroot}${nginx_confdir}/${conf}" if {[file exists ${conf_path}]} { file delete ${conf_path} } if {[file exists ${conf_path}.default]} { move ${conf_path}.default ${destroot}${nginx_examples} } } file rename ${destroot}${prefix}/html ${destroot}${nginx_share} # Install the manpage set man_path "${destroot}${prefix}/share/man/man8" xinstall -d -m 0755 ${man_path} xinstall -m 0644 ${worksrcpath}/man/${propername}.8 ${man_path} reinplace -q "s|/var/run/mynginx.pid|${nginx_pidfile}/|g" ${man_path}/${propername}.8 } post-activate { foreach conf ${auto_activate_confs} { if {![file exists ${nginx_confdir}/${conf}]} { xinstall -m 644 ${nginx_examples}/${conf}.default ${nginx_confdir}/${conf} } } } startupitem.create yes startupitem.pidfile auto ${nginx_pidfile} startupitem.executable ${prefix}/sbin/nginx -g "daemon off;" notes "\ A set of sample configuration files has been installed in ${nginx_examples}.\n\n\ Additionally, the files [join ${auto_activate_confs} ", "] have been copied to ${nginx_confdir} if they didn't exist yet.\n\ Adjust these files to your needs before starting nginx." default_variants +devel_kit +flv +http2 +mp4 +secure_link +ssl +stream } else { depends_lib port:${name} build.target modules notes "\ Add load_module etc/nginx/modules/.so; to ${nginx_confdir}/nginx.conf" } subport ${name}-geoip2 { set geoipext_filename ngx_http_geoip2_module set geoipext_version 3.4 revision 1 set geoipext_distname ${geoipext_filename}-${geoipext_version} distfiles-append ${geoipext_version}.tar.gz:geoip2_module checksums-append ${geoipext_version}.tar.gz \ rmd160 d6a4115102b8aa13205431d91fe46d60b0762dc8 \ sha256 ad72fc23348d715a330994984531fab9b3606e160483236737f9a4a6957d9452 \ size 8877 configure.args-append --add-dynamic-module=${workpath}/${geoipext_distname} depends_lib-append port:libmaxminddb destroot { xinstall -d -m 0755 ${destroot}${nginx_moduledir} move ${worksrcpath}/objs/ngx_http_geoip2_module.so ${destroot}${nginx_moduledir} } } subport ${name}-headers_more { set ngx_h_more_filename headers-more-nginx-module set ngx_h_more_version 0.37 revision 0 set ngx_h_more_distname ${ngx_h_more_filename}-${ngx_h_more_version} distfiles-append v${ngx_h_more_version}.tar.gz:h_more_module checksums-append v${ngx_h_more_version}.tar.gz \ rmd160 14e70a27cf6bcadfd792034ccaff14ef2e7a41e1 \ sha256 cf6e169d6b350c06d0c730b0eaf4973394026ad40094cddd3b3a5b346577019d \ size 29433 configure.args-append --add-dynamic-module=${workpath}/${ngx_h_more_distname} destroot { xinstall -d -m 0755 ${destroot}${nginx_moduledir} move ${worksrcpath}/objs/ngx_http_headers_more_filter_module.so ${destroot}${nginx_moduledir} } } subport ${name}-lua { depends_lib-append port:luajit-openresty set ngx_lua_filename lua-nginx-module set ngx_lua_version 0.10.26 revision 0 set ngx_lua_distname ${ngx_lua_filename}-${ngx_lua_version} distfiles-append v${ngx_lua_version}.tar.gz:lua_module checksums-append v${ngx_lua_version}.tar.gz \ rmd160 d7c1b5c585a265d084fb7c2bf82c214f26dfce3c \ sha256 a75983287a2bdc5e964ace56a51b215dc2ec996639d4916cd393d6ebba94b565 \ size 745785 platforms {darwin >= 11} configure.cflags -I${prefix}/include/luajit-2.1/ ${configure.cflags} configure.env LUAJIT_INC=${prefix}/include/luajit-2.1/ configure.env LUAJIT_LIB=${prefix}/lib configure.args-append --add-dynamic-module=${workpath}/${ngx_lua_distname} nginx_set_portfile_var nginx_lua_mod_dirname "${ngx_lua_distname}" patchfiles-append patch-lua_config.diff # patch routine balks on file names with "../", but rel-paths in patchfiles start from $worksrcpath pre-patch { ln -s "${workpath}/${nginx_lua_mod_dirname}" "${worksrcpath}/ngx_lua_distname.tmp" } post-patch { file delete "${worksrcpath}/ngx_lua_distname.tmp" } destroot { xinstall -d -m 0755 ${destroot}${nginx_moduledir} move ${worksrcpath}/objs/ngx_http_lua_module.so ${destroot}${nginx_moduledir} } } subport ${name}-rtmp { set rtmp_filename nginx-rtmp-module set rtmp_version 1.2.2 revision 1 set rtmp_distname ${rtmp_filename}-${rtmp_version} distfiles-append v${rtmp_version}:rtmp_module checksums-append v${rtmp_version} \ rmd160 a19f42e4f15214fd11ac8f334468dc400b86b5bd \ sha256 07f19b7bffec5e357bb8820c63e5281debd45f5a2e6d46b1636d9202c3e09d78 \ size 519934 configure.args-append --add-dynamic-module=${workpath}/${rtmp_distname} nginx_set_portfile_var nginx_rtmp_mod_dirname "${rtmp_distname}" destroot { xinstall -d -m 0755 ${destroot}${nginx_moduledir} move ${worksrcpath}/objs/ngx_rtmp_module.so ${destroot}${nginx_moduledir} } } variant auth_request description {Add client authorization based on the result of a subrequest} { configure.args-append --with-http_auth_request_module } variant addition description {Append text to pages} { configure.args-append --with-http_addition_module } variant dav description {Add WebDAV support to server} { configure.args-append --with-http_dav_module } variant debug description {Enable debug mode} { configure.args-append --with-debug } variant degradation description {Allow to return 204 or 444 code for some locations on low memory condition} { configure.args-append --with-http_degradation_module } variant devel_kit description {Enable ngx_devel_kit module (https://github.com/simpl/ngx_devel_kit)} { set devel_kit_filename ngx_devel_kit set devel_kit_version 0.3.3 set devel_kit_distname ${devel_kit_filename}-${devel_kit_version} distfiles-append v${devel_kit_version}.tar.gz:devel_kit_module checksums-append v${devel_kit_version}.tar.gz \ rmd160 3fdd31a09b276f2a4d47bea4f7503feddc1b265e \ sha256 faa2fcd5168b10764d35081356511d5f84db5c526a1aa4b6add2db94b6853b2b \ size 66561 configure.args-append --add-module=${workpath}/${devel_kit_distname} } variant flv description {Add FLV (Flash Video) streaming support to server} { configure.args-append --with-http_flv_module } variant gperftools description {Enable Google Performance Tools profiling for workers} { configure.args-append --with-google_perftools_module depends_lib-append port:gperftools # If 'google_perftools' port doesn't find headers needed for the profiler lib, it just quietly skips it. # Check if "-lprofiler" will fail -- if so, pre-empt configure-stage error with a more useful error msg. pre-configure { if {![file exists "${prefix}/lib/libprofiler.dylib"] && ![file exists "${prefix}/lib/libprofiler.a"]} { ui_error "\ The 'gperftools' port did not install a libprofiler library (libprofiler.dylib or\ libprofiler.a) on your version of macOS, but the +google_perftools variant will not work\ without this library. Disable the +google_perftools variant to continue installing ${propername}" error "Required libprofiler library missing from gperftools port." } } } variant gzip_static description {Avoids compressing the same file each time it is requested} { configure.args-append --with-http_gzip_static_module } variant http2 requires ssl description {Add HTTP/2 support to the server} { configure.args-append --with-http_v2_module } variant image_filter description {Transform images with libgd} { configure.args-append --with-http_image_filter_module depends_lib-append port:gd2 } variant mail description {Add IMAP4/POP3 mail proxy support} { configure.args-append --with-mail if {[variant_isset ssl]} { configure.args-append --with-mail_ssl_module } } variant mp4 description {Enables mp4 streaming with seeking ability} { configure.args-append --with-http_mp4_module } variant perl5 description {Add perl support to the server directly within nginx and call perl via SSI} { depends_lib-append port:perl5.30 configure.args-append --with-http_perl_module \ --with-perl=${prefix}/bin/perl5.30 } variant random_index description {Randomize directory indexes} { configure.args-append --with-http_random_index_module } variant realip description {For using nginx as backend} { configure.args-append --with-http_realip_module } variant secure_link description {Protect pages with a secret key} { configure.args-append --with-http_secure_link_module } variant ssl description {Add SSL (HTTPS) support to the server, and also to the mail proxy if that is enabled} { configure.args-append --with-http_ssl_module depends_lib-append path:lib/libssl.dylib:openssl } variant status description {Add /nginx_status support to the server} { configure.args-append --with-http_stub_status_module } variant substitution description {Replace text in pages} { configure.args-append --with-http_sub_module } variant stream description {Enable ngx_stream_core_module for generic TCP proxying and load balancing (install with +ssl to enable ngx_stream_ssl_module)} { configure.args-append --with-stream if {[variant_isset ssl]} { configure.args-append \ --with-stream_ssl_module --with-stream_ssl_preread_module } } variant threads description {Add threads support (http://nginx.org/en/docs/ngx_core_module.html#thread_pool)} { configure.args-append --with-threads } variant xslt description {Post-process pages with XSLT} { configure.args-append --with-http_xslt_module depends_lib-append port:libxslt } livecheck.type regexm livecheck.url ${homepage} livecheck.regex {nginx-(\d+\.\d+\.\d+)\s+mainline}