# -*- 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 version 1.26.1 revision 0 categories www mail license BSD maintainers {mps @Schamschula} openmaintainer conflicts nginx-devel 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/vkholodkov/nginx-upload-module/archive/:upload_module \ https://github.com/evanmiller/mod_zip/archive/:zip_module \ https://people.freebsd.org/~osa/:redis_module \ https://github.com/masterzen/nginx-upload-progress-module/archive/:uploadprogress_module \ https://github.com/openresty/echo-nginx-module/archive/:echo_module \ https://github.com/arut/nginx-dav-ext-module/archive/:davext_module \ https://github.com/leev/ngx_http_geoip2_module/archive/:geoip2_module \ https://codeload.github.com/arut/nginx-rtmp-module/tar.gz/:rtmp_module \ https://github.com/slact/nchan/archive/:http_push_module \ https://github.com/simpl/ngx_devel_kit/archive/:devel_kit_module \ https://github.com/openresty/lua-nginx-module/archive/:lua_module \ https://github.com/openresty/headers-more-nginx-module/archive/:h_more_module \ https://github.com/TeslaGov/ngx-http-auth-jwt-module/archive/:jwt_module \ https://github.com/aperezdc/ngx-fancyindex/archive/:fancyindex_module \ https://github.com/kaltura/nginx-vod-module/archive/:vod_module distfiles ${name}-${version}${extract.suffix}:nginx checksums ${name}-${version}${extract.suffix} \ rmd160 16991790b1d875fb8e72e3ea6feb225aa79e4357 \ sha256 f9187468ff2eb159260bfd53867c25ff8e334726237acf227b9e870e53d3e36b \ size 1244738 depends_lib port:pcre \ port:zlib patchfiles patch-auto__install.diff \ patch-conf__nginx.conf.diff set nginx_share ${prefix}/share/${name} set nginx_examples ${nginx_share}/examples set nginx_confdir ${prefix}/etc/${name} set nginx_logdir ${prefix}/var/log/${name} set nginx_rundir ${prefix}/var/run/${name} set nginx_pidfile ${nginx_rundir}/${name}.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} # portfile-scoped vars for variant routines to re-def and use in port-stages (post-extract, pre-patch, etc) set nginx_lua_mod_dirname "" set nginx_upload_mod_dirname "" # 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 } configure.args-append \ --with-cc-opt=\"${configure.cppflags} ${configure.cflags}\" \ --with-ld-opt=\"${configure.ldflags}\" \ --conf-path=${nginx_confdir}/${name}.conf \ --error-log-path=${nginx_logdir}/error.log \ --http-log-path=${nginx_logdir}/access.log \ --pid-path=${nginx_pidfile} \ --lock-path=${nginx_rundir}/${name}.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 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/${name}.8 ${man_path} reinplace -q "s|/var/run/mynginx.pid|${nginx_pidfile}/|g" ${man_path}/${name}.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 +mp4 +flv +secure_link +ssl +http2 +stream +fancyindex 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 threads description {Add threads support (http://nginx.org/en/docs/ngx_core_module.html#thread_pool)} { configure.args-append --with-threads } variant davext description {Add WebDAV (extended) support to server} { set davext_filename nginx-dav-ext-module set davext_version 3.0.0 set davext_distname ${davext_filename}-${davext_version} distfiles-append v${davext_version}.tar.gz:davext_module checksums-append v${davext_version}.tar.gz \ rmd160 8d099215bde79492565a39c3c8feb7695138138e \ sha256 d2499d94d82d4e4eac8425d799e52883131ae86a956524040ff2fd230ef9f859 \ size 14558 configure.args-append --with-http_dav_module --add-module=${workpath}/${davext_distname} } 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 echo description {Brings echo, sleep, time, exec and more shell-style goodies to Nginx config file} { set echo_filename echo-nginx-module set echo_version 0.63 set echo_distname ${echo_filename}-${echo_version} distfiles-append v${echo_version}.tar.gz:echo_module checksums-append v${echo_version}.tar.gz \ rmd160 b280638afa7b59cf9956962fa568c23125d1ae75 \ sha256 8af374d29592ef95baee53c91959c7b04927f11304c318a94f0ee140760515a4 \ size 53421 configure.args-append --with-http_dav_module --add-module=${workpath}/${echo_distname} } variant flv description {Add FLV (Flash Video) streaming support to server} { configure.args-append --with-http_flv_module } variant geoip2 description {Enable Ngx http GeoIP2 module (https://github.com/leev/ngx_http_geoip2_module)} { set geoipext_filename ngx_http_geoip2_module set geoipext_version 3.4 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-module=${workpath}/${geoipext_distname} depends_lib-append port:libmaxminddb } 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 OS X, but the +google_perftools variant will not work\ without this library. Disable the +google_perftools variant to continue installing ${name}" 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 upload description {Enable Valery Kholodkov's upload module (http://grid.net.ru/nginx/upload.en.html)} { set upload_filename nginx-upload-module set upload_version 2.3.0 set upload_distname ${upload_version} distfiles-append ${upload_distname}.tar.gz:upload_module checksums-append ${upload_distname}.tar.gz \ rmd160 5443cf56908be57a95647146926110cdcf0a0bde \ sha256 c86e318addb9c88d70fdbd58ff1f6ef6f404a93070f6db8017a1f880c97946c4 \ size 40139 configure.args-append --add-module=${workpath}/${upload_filename}-${upload_distname} nginx_set_portfile_var nginx_upload_mod_dirname "${upload_distname}" } variant upload_progress description {Enable Brice Figureau's upload progress module (https://github.com/masterzen/nginx-upload-progress-module)} { set uploadprg_filename nginx_uploadprogress_module set uploadprg_version 0.9.2 set uploadprg_distname v${uploadprg_version} distfiles-append ${uploadprg_distname}.tar.gz:uploadprogress_module checksums-append ${uploadprg_distname}.tar.gz \ rmd160 eedb9d9acd6450df0f940902165dc5113ede0171 \ sha256 b286689355442657650421d8e8398bd4abf9dbbaade65947bb0cb74a349cc497 \ size 17268 configure.args-append --add-module=${workpath}/nginx-upload-progress-module-${uploadprg_version} } variant xslt description {Post-process pages with XSLT} { configure.args-append --with-http_xslt_module depends_lib-append port:libxslt } variant zip description {Enable Ngx zip download module (https://github.com/evanmiller/mod_zip)} { set zip_version 1.3.0 distfiles-append ${zip_version}.tar.gz:zip_module checksums-append ${zip_version}.tar.gz \ rmd160 d63baa2d56e957c895895e02ac399c67282a7acf \ sha256 5e7f24b6b4efb8258d92ec921ade9df69e4bad36f833a39b47ee947b3d637f22 \ size 30266 configure.args-append --add-module=${workpath}/mod_zip-${zip_version} patchfiles-append patch-src-http-ngx_http_upstream.c.diff \ patch-src-http-ngx_http_upstream.h.diff } variant redis description {Enable Ngx HTTP Redis module} { set redis_filename ngx_http_redis set redis_version 0.3.9 set redis_distname ${redis_filename}-${redis_version} distfiles-append ${redis_distname}.tar.gz:redis_module checksums-append ${redis_distname}.tar.gz \ rmd160 ecaa081631c67e8ab7ffe2f6abf49e78d8cddbda \ sha256 21f87540f0a44b23ffa5df16fb3d788bc90803b255ef14f9c26e3847a6f26f46 \ size 13051 configure.args-append --add-module=${workpath}/${redis_distname} } variant rtmp description {Enable Ngx RTMP module (https://github.com/arut/nginx-rtmp-module)} { set rtmp_filename nginx-rtmp-module set rtmp_version 1.2.2 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-module=${workpath}/${rtmp_distname} } variant http_push description {Enable Ngx HTTP Push module (https://github.com/slact/nchan)} { set http_push_filename nchan set http_push_version 1.3.6 set http_push_distname ${http_push_filename}-${http_push_version} distfiles-append v${http_push_version}.tar.gz:http_push_module checksums-append v${http_push_version}.tar.gz \ rmd160 46499a30841730923fae1d03e31b9af397269172 \ sha256 ba0b7cc6b710a20ce1ed2554caf56154035291aaf115e407d7a6bb699fde42df \ size 761436 configure.args-append --add-module=${workpath}/${http_push_distname} } 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 lua requires devel_kit description {Enable Lua module (https://github.com/openresty/lua-nginx-module)} { depends_lib-append port:luajit-openresty set ngx_lua_filename lua-nginx-module set ngx_lua_version 0.10.26 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 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-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" } } variant headers_more description {Enable headers-more module (https://github.com/openresty/headers-more-nginx-module)} { set ngx_h_more_filename headers-more-nginx-module set ngx_h_more_version 0.37 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-module=${workpath}/${ngx_h_more_distname} } # See https://github.com/TeslaGov/ngx-http-auth-jwt-module/issues/82 # variant jwt description {Add JWT (Javascript Web Token) support to server using TeslaGov's ngx-http-auth-jwt-module (https://github.com/TeslaGov/ngx-http-auth-jwt-module)} { # set jwt_filename ngx-http-auth-jwt-module # set jwt_version 1.1.0 # set jwt_distname ${jwt_filename}-${jwt_version} # distfiles-append ${jwt_version}.tar.gz:jwt_module # checksums-append ${jwt_version}.tar.gz \ # rmd160 41a340016ae7c7df7a306ac296b2ec26abb4a7d6 \ # sha256 effdcb27e492134e8e990d4e7edf26c72855ec5b7676ca997a69efcb589b35fe \ # size 14736 # # configure.args-append --add-dynamic-module=${workpath}/${jwt_distname} # depends_lib-append port:libjwt # } variant fancyindex description {Add fancy index support; file listings, like the built-in autoindex module does, but with a touch of style} { set fancyindex_filename ngx-fancyindex set fancyindex_version 0.5.2 set fancyindex_distname ${fancyindex_filename}-${fancyindex_version} distfiles-append v${fancyindex_version}.tar.gz:fancyindex_module checksums-append v${fancyindex_version}.tar.gz \ rmd160 71a2e8ab3d07396a7f55b8134a30916d6e0f5ed3 \ sha256 c3dd84d8ba0b8daeace3041ef5987e3fb96e9c7c17df30c9ffe2fe3aa2a0ca31 \ size 29052 configure.args-append --add-module=${workpath}/${fancyindex_distname} } variant vod description {Add MP4 repackeging for HLS, DASH, HDS, HSS using nginx-vod-module} { set vod_filename nginx-vod-module set vod_version 1.33 set vod_distname ${vod_filename}-${vod_version} distfiles-append ${vod_version}.tar.gz:vod_module checksums-append ${vod_version}.tar.gz \ rmd160 47f03c50054d55ed81055415f11bc97c2aca5ecc \ sha256 9c9600e5da4ee02ef6820d056da9eb5f3449f715468334ddab41727b76d478d8 \ size 471858 configure.args-append --add-module=${workpath}/${vod_distname} } livecheck.type regexm livecheck.url ${homepage}/en/download.html livecheck.regex {nginx-(1\.26\.\d+)}