From d1659bb53fd97aad684c84ebdb9eceddf94f9c60 Mon Sep 17 00:00:00 2001 From: tigro Date: Sat, 31 Aug 2024 19:14:02 +0300 Subject: [PATCH] import angie-1.6.2-1.el9 --- .angie.metadata | 62 + .gitignore | 62 + SOURCES/README-module-auth-jwt | 7 + SOURCES/README-module-auth-ldap | 7 + SOURCES/README-module-auth-spnego | 7 + SOURCES/README-module-brotli | 7 + SOURCES/README-module-cache-purge | 7 + SOURCES/README-module-dav-ext | 7 + SOURCES/README-module-dynamic-limit-req | 7 + SOURCES/README-module-echo | 7 + SOURCES/README-module-enhanced-memcached | 7 + SOURCES/README-module-eval | 7 + SOURCES/README-module-geoip2 | 7 + SOURCES/README-module-headers-more | 7 + SOURCES/README-module-image-filter | 2 + SOURCES/README-module-jwt | 7 + SOURCES/README-module-keyval | 7 + SOURCES/README-module-lua | 67 + SOURCES/README-module-modsecurity | 19 + SOURCES/README-module-ndk | 7 + SOURCES/README-module-njs | 7 + SOURCES/README-module-opentracing | 19 + SOURCES/README-module-otel | 35 + SOURCES/README-module-perl | 2 + SOURCES/README-module-postgres | 7 + SOURCES/README-module-redis2 | 7 + SOURCES/README-module-rtmp | 7 + SOURCES/README-module-set-misc | 7 + SOURCES/README-module-subs | 7 + SOURCES/README-module-testcookie | 7 + SOURCES/README-module-upload | 7 + SOURCES/README-module-vod | 7 + SOURCES/README-module-vts | 15 + SOURCES/README-module-xslt | 2 + SOURCES/README-module-zip | 7 + SOURCES/README-module-zstd | 7 + SOURCES/abseil-off_t.patch | 20 + SOURCES/abseil-str_format.patch | 10 + SOURCES/angie-module-modsecurity.logrotate | 9 + SOURCES/angie.conf | 42 + SOURCES/angie.logrotate | 14 + SOURCES/angie.service | 15 + SOURCES/angie.upgrade | 27 + SOURCES/configure-accelerator.patch | 1543 +++++++++++ SOURCES/dd-opentracing-cpp-cmakelists.patch | 24 + SOURCES/default.conf | 50 + SOURCES/example.conf | 24 + SOURCES/libinjection-version.patch | 14 + SOURCES/lua-cjson.patch | 29 + SOURCES/lua-config.patch | 26 + SOURCES/luajit2-Makefile.patch | 11 + SOURCES/luajit2-luaconf.h.patch | 13 + SOURCES/modsecurity-libmaxminddb.patch | 24 + SOURCES/modsecurity-ssdeep.patch | 13 + SOURCES/modsecurity.rules.conf | 18 + SOURCES/ngx_postgres-default_port.patch | 17 + SOURCES/ngx_postgres-dynamic.patch | 26 + .../ngx_postgres-subrequest_in_memory.patch | 18 + ...opentracing-cpp-fix-ftbfs-glibc-2.34.patch | 42 + SOURCES/stream-lua-config.patch | 26 + SOURCES/zstd-nginx-module.nostatic.patch | 24 + SPECS/angie.spec | 2406 +++++++++++++++++ 62 files changed, 4952 insertions(+) create mode 100644 .angie.metadata create mode 100644 .gitignore create mode 100644 SOURCES/README-module-auth-jwt create mode 100644 SOURCES/README-module-auth-ldap create mode 100644 SOURCES/README-module-auth-spnego create mode 100644 SOURCES/README-module-brotli create mode 100644 SOURCES/README-module-cache-purge create mode 100644 SOURCES/README-module-dav-ext create mode 100644 SOURCES/README-module-dynamic-limit-req create mode 100644 SOURCES/README-module-echo create mode 100644 SOURCES/README-module-enhanced-memcached create mode 100644 SOURCES/README-module-eval create mode 100644 SOURCES/README-module-geoip2 create mode 100644 SOURCES/README-module-headers-more create mode 100644 SOURCES/README-module-image-filter create mode 100644 SOURCES/README-module-jwt create mode 100644 SOURCES/README-module-keyval create mode 100644 SOURCES/README-module-lua create mode 100644 SOURCES/README-module-modsecurity create mode 100644 SOURCES/README-module-ndk create mode 100644 SOURCES/README-module-njs create mode 100644 SOURCES/README-module-opentracing create mode 100644 SOURCES/README-module-otel create mode 100644 SOURCES/README-module-perl create mode 100644 SOURCES/README-module-postgres create mode 100644 SOURCES/README-module-redis2 create mode 100644 SOURCES/README-module-rtmp create mode 100644 SOURCES/README-module-set-misc create mode 100644 SOURCES/README-module-subs create mode 100644 SOURCES/README-module-testcookie create mode 100644 SOURCES/README-module-upload create mode 100644 SOURCES/README-module-vod create mode 100644 SOURCES/README-module-vts create mode 100644 SOURCES/README-module-xslt create mode 100644 SOURCES/README-module-zip create mode 100644 SOURCES/README-module-zstd create mode 100644 SOURCES/abseil-off_t.patch create mode 100644 SOURCES/abseil-str_format.patch create mode 100644 SOURCES/angie-module-modsecurity.logrotate create mode 100644 SOURCES/angie.conf create mode 100644 SOURCES/angie.logrotate create mode 100644 SOURCES/angie.service create mode 100644 SOURCES/angie.upgrade create mode 100644 SOURCES/configure-accelerator.patch create mode 100644 SOURCES/dd-opentracing-cpp-cmakelists.patch create mode 100644 SOURCES/default.conf create mode 100644 SOURCES/example.conf create mode 100644 SOURCES/libinjection-version.patch create mode 100644 SOURCES/lua-cjson.patch create mode 100644 SOURCES/lua-config.patch create mode 100644 SOURCES/luajit2-Makefile.patch create mode 100644 SOURCES/luajit2-luaconf.h.patch create mode 100644 SOURCES/modsecurity-libmaxminddb.patch create mode 100644 SOURCES/modsecurity-ssdeep.patch create mode 100644 SOURCES/modsecurity.rules.conf create mode 100644 SOURCES/ngx_postgres-default_port.patch create mode 100644 SOURCES/ngx_postgres-dynamic.patch create mode 100644 SOURCES/ngx_postgres-subrequest_in_memory.patch create mode 100644 SOURCES/opentracing-cpp-fix-ftbfs-glibc-2.34.patch create mode 100644 SOURCES/stream-lua-config.patch create mode 100644 SOURCES/zstd-nginx-module.nostatic.patch create mode 100644 SPECS/angie.spec diff --git a/.angie.metadata b/.angie.metadata new file mode 100644 index 0000000..3c47ec0 --- /dev/null +++ b/.angie.metadata @@ -0,0 +1,62 @@ +32801a5817cfd4acf74f1c1345498d8e2ab8a61a SOURCES/ngx_http_enhanced_memcached_module-v0.3.tar.gz +aa2751fa737792591cd4c6d53b93f6a51b947956 SOURCES/set-misc-nginx-module-v0.33.tar.gz +b40f2de3fc7a84d116f3ac6ae24e7dbb3a9de25b SOURCES/nginx-jwt-module-v3.4.1.tar.gz +4d41125dc2f50062f1f497a9b19bbca7c2845ce5 SOURCES/ngx_postgres-1.0rc7.tar.gz +34c710f37ad1bcc76db137e597b96ce41f69b133 SOURCES/lua-resty-openidc-v1.7.6.tar.gz +86e7cf0162169ceec765c699419dde9ebce651f4 SOURCES/stream-lua-nginx-module-bea8a0c0de94cede71554f53818ac0267d675d63.tar.gz +f5dccf21dc05cddb6205164a8fd3cf210926ef6c SOURCES/opentracing-cpp-v1.6.0.tar.gz +f00e346646e96be49abfe986b512c21c2084bcb1 SOURCES/echo-nginx-module-v0.63.tar.gz +7064d5cc11cb22b7ef2dc952bdac035e548cbffd SOURCES/ssdeep-release-2.14.1.tar.gz +524407402df7e73df9def85345c8bea324dceede SOURCES/nginx-dav-ext-module-v3.0.0.tar.gz +76a1b0f6f95c9a817cb96739e28ae9172bb19df6 SOURCES/ngx_devel_kit-v0.3.3.tar.gz +1a2c7dae62d51cc773226d0e1555182cac5696c0 SOURCES/angie-1.6.2.tar.gz +d7b01219559620ba10ba7bd1dcbbd38ddc7468d5 SOURCES/grpc-v1.46.7.tar.gz +9521fe484cf7bfcba5bd6a041a83f86bfb803aa4 SOURCES/lua-resty-lrucache-v0.13.tar.gz +d8484122c1734e00c39d0c36b485f9aa8fcd6eac SOURCES/nginx-upload-module-2.3.0.tar.gz +85a4026394915589f461062dbb8b13643925a6c1 SOURCES/lua-resty-openssl-1.4.0.tar.gz +e6d560e4bce2e4f22eeca3295a03d6909935c2cd SOURCES/lua-resty-string-v0.15.tar.gz +172c26e961e70563a91b66dd224e38f8ee58a815 SOURCES/protobuf-v3.19.5.tar.gz +1f9b404e3dc483dab1ec0bb7644f0658241f3c00 SOURCES/nginx-keyval-0.3.0.tar.gz +8f7fabc60072c2f86450d24b7bf9c0fc31ffa9eb SOURCES/nginx-otel-v0.1.1.tar.gz +b9629d51f4a67b55d70407054c689a17cf8244c1 SOURCES/ngx_brotli-v1.0.0rc.tar.gz +5775402ffc460079c950e7bfd1e743463aed16fe SOURCES/dd-opentracing-cpp-v1.3.7.tar.gz +173829c5d3aaedff277519604d5bf3e963075b24 SOURCES/opentelemetry-proto-v1.0.0.tar.gz +6f8e2ffc4a1737186c92598443f56a9c22798e6d SOURCES/chronos-v0.2-4.tar.gz +8b2a940dd0131f7b16aea50507d684ee912d779e SOURCES/nginx-eval-module-2016.06.10.tar.gz +c4a5ae103fc4af61821b5d5f2eb7c6882f789ec0 SOURCES/re2-2024-03-01.tar.gz +526e9dba53c5c9ae557ae768c527d2cfb6f762d8 SOURCES/lua-resty-jwt-v0.2.3.tar.gz +a036f35dfc8c2f1fa38e16805891fb338273cbcb SOURCES/nginx-vod-module-1.33.tar.gz +b2354ac36d5b7fc099ff588cd0478494e0ef9cca SOURCES/zipkin-cpp-opentracing-966416e4d6aec23f572730aede6c087ccce6d194.tar.gz +62cc7e19c7a178bba1f5d3fbb602bbd154aefa60 SOURCES/nginx-module-stream-sts-v0.1.1.tar.gz +1df81ff28f4ea1431363655951861af56cec7aee SOURCES/lua-cjson-2.1.0.tar.gz +abaa2e8737976c6eccf3c8f2f7672f4b7cd7f573 SOURCES/ngx_http_substitutions_filter_module-e12e965ac1837ca709709f9a26f572a54d83430e.tar.gz +c86880022ca39f67bba970d529ae12ff2568ab35 SOURCES/nginx-auth-ldap-241200eac8e4acae74d353291bd27f79e5ca3dc4.tar.gz +4e74bcbcf523bbba57de2ca9dbc6c3b0355ffc0d SOURCES/lua-nginx-module-v0.10.26.tar.gz +36b3bcd24a7a531aa3d9570b40b0186fb5986417 SOURCES/mod_zip-1.3.0.tar.gz +97ea2c8d75610eac98ab84770baae2bf09a47bef SOURCES/libinjection-b9fcaaf9e50e9492807b23ffcc6af46ee1f203b9.tar.gz +acff5edcd79bb39be93d48d0d2721fba7d1a2f62 SOURCES/opentelemetry-cpp-v1.11.0.tar.gz +940d5b82126e328e67be1d249b3c67fb144edd08 SOURCES/lua-resty-session-v3.10.tar.gz +f4aad87ad4214e066fd7388ddbdb21550c817286 SOURCES/ModSecurity-nginx-v1.0.3.tar.gz +e3eec85876c70ee770258ebad009320b45df20a8 SOURCES/testcookie-nginx-module-64137c2f7e66e8866f56fdecaaf09ac10a034da9.tar.gz +fa8466435edac11c2ba9fd91749559f04534c52a SOURCES/spnego-http-auth-nginx-module-v1.1.1.tar.gz +fdd403ea8cb45f44dd76ff2aad3ccf51014d2526 SOURCES/ngx_dynamic_limit_req_module-1.9.3.tar.gz +0711f54f680027ea23eb4d11c87c7274ba55eb3a SOURCES/headers-more-nginx-module-v0.37.tar.gz +4b6cef784bc7acaa6651f5616ede7a3b60625891 SOURCES/nginx-opentracing-v0.35.3.tar.gz +b358aa19f7a3f31584751a9f4e477c5f27d4474a SOURCES/redis2-nginx-module-v0.15.tar.gz +eb0667726a4bb14bf3cdc893583f423ada832804 SOURCES/ngx_http_geoip2_module-3.4.tar.gz +a206b9717e28102e088784ac001a2149c26eb2aa SOURCES/nginx-module-vts-v0.2.2.tar.gz +7e9fb77e0e59ad8a322ce86d5b9ee112bdae91fb SOURCES/lua-resty-hmac-5f60e1a28b9fdd7939f0e1738171f0ca5fe22978.tar.gz +6a4b5c2195c125c7e9ac04fe9e5fb6c0a3705763 SOURCES/luajit2-v2.1-20240626.tar.gz +6e0029b72ddd55daf043252b088849aa8822fded SOURCES/njs-0.8.5.tar.gz +32be45997d530d0a59ea8636686553abcc536479 SOURCES/ModSecurity-v3.0.12.tar.gz +5df4fe9e8262727170ccd59a14a55a0d73d7c370 SOURCES/nginx-auth-jwt-0.7.0.tar.gz +96e1476960799bb71b58ddfa764ddbd98fd732e1 SOURCES/c-ares-cares-1_27_0.tar.gz +fb5cf748d87dd448576d73b057855fc12cad9896 SOURCES/nginx-rtmp-module-v1.2.2.tar.gz +1194355eab5775ba0c9ab6e50b5969e12bed7fd3 SOURCES/nginx-module-sts-v0.1.1.tar.gz +8cce502d785f2563b5a844024b47e6a5ff2234bf SOURCES/lua-dumper-v0.1.1.tar.gz +db452736b5e7e549489104c7bb9d5b3a7631e162 SOURCES/lua-resty-core-v0.1.28.tar.gz +88e5720e1755e89a19e97043387b1fa001acb810 SOURCES/zstd-nginx-module-f4ba115e0b0eaecde545e5f37db6aa18917d8f4b.tar.gz +7c4f2f246405cae0acd3fbc33b7031fda0a94800 SOURCES/ngx_cache_purge-2.5.3.tar.gz +9295fae0d51e49e9147d9da7db14099a8dff9f7d SOURCES/inspect.lua-v3.1.3.tar.gz +42106c9af382666d1c35d79731df1919baea3c9d SOURCES/lua-resty-http-v0.17.2.tar.gz +8ec1d0e9f51ecbc9bf67b3f07007d2b04b0ca198 SOURCES/abseil-cpp-20211102.0.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b495103 --- /dev/null +++ b/.gitignore @@ -0,0 +1,62 @@ +SOURCES/ngx_http_enhanced_memcached_module-v0.3.tar.gz +SOURCES/set-misc-nginx-module-v0.33.tar.gz +SOURCES/nginx-jwt-module-v3.4.1.tar.gz +SOURCES/ngx_postgres-1.0rc7.tar.gz +SOURCES/lua-resty-openidc-v1.7.6.tar.gz +SOURCES/stream-lua-nginx-module-bea8a0c0de94cede71554f53818ac0267d675d63.tar.gz +SOURCES/opentracing-cpp-v1.6.0.tar.gz +SOURCES/echo-nginx-module-v0.63.tar.gz +SOURCES/ssdeep-release-2.14.1.tar.gz +SOURCES/nginx-dav-ext-module-v3.0.0.tar.gz +SOURCES/ngx_devel_kit-v0.3.3.tar.gz +SOURCES/angie-1.6.2.tar.gz +SOURCES/grpc-v1.46.7.tar.gz +SOURCES/lua-resty-lrucache-v0.13.tar.gz +SOURCES/nginx-upload-module-2.3.0.tar.gz +SOURCES/lua-resty-openssl-1.4.0.tar.gz +SOURCES/lua-resty-string-v0.15.tar.gz +SOURCES/protobuf-v3.19.5.tar.gz +SOURCES/nginx-keyval-0.3.0.tar.gz +SOURCES/nginx-otel-v0.1.1.tar.gz +SOURCES/ngx_brotli-v1.0.0rc.tar.gz +SOURCES/dd-opentracing-cpp-v1.3.7.tar.gz +SOURCES/opentelemetry-proto-v1.0.0.tar.gz +SOURCES/chronos-v0.2-4.tar.gz +SOURCES/nginx-eval-module-2016.06.10.tar.gz +SOURCES/re2-2024-03-01.tar.gz +SOURCES/lua-resty-jwt-v0.2.3.tar.gz +SOURCES/nginx-vod-module-1.33.tar.gz +SOURCES/zipkin-cpp-opentracing-966416e4d6aec23f572730aede6c087ccce6d194.tar.gz +SOURCES/nginx-module-stream-sts-v0.1.1.tar.gz +SOURCES/lua-cjson-2.1.0.tar.gz +SOURCES/ngx_http_substitutions_filter_module-e12e965ac1837ca709709f9a26f572a54d83430e.tar.gz +SOURCES/nginx-auth-ldap-241200eac8e4acae74d353291bd27f79e5ca3dc4.tar.gz +SOURCES/lua-nginx-module-v0.10.26.tar.gz +SOURCES/mod_zip-1.3.0.tar.gz +SOURCES/libinjection-b9fcaaf9e50e9492807b23ffcc6af46ee1f203b9.tar.gz +SOURCES/opentelemetry-cpp-v1.11.0.tar.gz +SOURCES/lua-resty-session-v3.10.tar.gz +SOURCES/ModSecurity-nginx-v1.0.3.tar.gz +SOURCES/testcookie-nginx-module-64137c2f7e66e8866f56fdecaaf09ac10a034da9.tar.gz +SOURCES/spnego-http-auth-nginx-module-v1.1.1.tar.gz +SOURCES/ngx_dynamic_limit_req_module-1.9.3.tar.gz +SOURCES/headers-more-nginx-module-v0.37.tar.gz +SOURCES/nginx-opentracing-v0.35.3.tar.gz +SOURCES/redis2-nginx-module-v0.15.tar.gz +SOURCES/ngx_http_geoip2_module-3.4.tar.gz +SOURCES/nginx-module-vts-v0.2.2.tar.gz +SOURCES/lua-resty-hmac-5f60e1a28b9fdd7939f0e1738171f0ca5fe22978.tar.gz +SOURCES/luajit2-v2.1-20240626.tar.gz +SOURCES/njs-0.8.5.tar.gz +SOURCES/ModSecurity-v3.0.12.tar.gz +SOURCES/nginx-auth-jwt-0.7.0.tar.gz +SOURCES/c-ares-cares-1_27_0.tar.gz +SOURCES/nginx-rtmp-module-v1.2.2.tar.gz +SOURCES/nginx-module-sts-v0.1.1.tar.gz +SOURCES/lua-dumper-v0.1.1.tar.gz +SOURCES/lua-resty-core-v0.1.28.tar.gz +SOURCES/zstd-nginx-module-f4ba115e0b0eaecde545e5f37db6aa18917d8f4b.tar.gz +SOURCES/ngx_cache_purge-2.5.3.tar.gz +SOURCES/inspect.lua-v3.1.3.tar.gz +SOURCES/lua-resty-http-v0.17.2.tar.gz +SOURCES/abseil-cpp-20211102.0.tar.gz diff --git a/SOURCES/README-module-auth-jwt b/SOURCES/README-module-auth-jwt new file mode 100644 index 0000000..393bb81 --- /dev/null +++ b/SOURCES/README-module-auth-jwt @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/kjdev/nginx-auth-jwt + Version: 0.7.0 + Archive: https://github.com/kjdev/nginx-auth-jwt/archive/0.7.0.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-auth-ldap b/SOURCES/README-module-auth-ldap new file mode 100644 index 0000000..516cc23 --- /dev/null +++ b/SOURCES/README-module-auth-ldap @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/kvspb/nginx-auth-ldap + Version: 241200eac8e4acae74d353291bd27f79e5ca3dc4 + Archive: https://github.com/kvspb/nginx-auth-ldap/archive/241200eac8e4acae74d353291bd27f79e5ca3dc4.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-auth-spnego b/SOURCES/README-module-auth-spnego new file mode 100644 index 0000000..63ec4ab --- /dev/null +++ b/SOURCES/README-module-auth-spnego @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/stnoonan/spnego-http-auth-nginx-module + Version: v1.1.1 + Archive: https://github.com/stnoonan/spnego-http-auth-nginx-module/archive/refs/tags/v1.1.1.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-brotli b/SOURCES/README-module-brotli new file mode 100644 index 0000000..4afdf85 --- /dev/null +++ b/SOURCES/README-module-brotli @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/google/ngx_brotli + Version: v1.0.0rc + Archive: https://github.com/google/ngx_brotli/archive/refs/tags/v1.0.0rc.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-cache-purge b/SOURCES/README-module-cache-purge new file mode 100644 index 0000000..5cde3ec --- /dev/null +++ b/SOURCES/README-module-cache-purge @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/nginx-modules/ngx_cache_purge + Version: 2.5.3 + Archive: https://github.com/nginx-modules/ngx_cache_purge/archive/refs/tags/2.5.3.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-dav-ext b/SOURCES/README-module-dav-ext new file mode 100644 index 0000000..5c9dbec --- /dev/null +++ b/SOURCES/README-module-dav-ext @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/arut/nginx-dav-ext-module + Version: v3.0.0 + Archive: https://github.com/arut/nginx-dav-ext-module/archive/refs/tags/v3.0.0.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-dynamic-limit-req b/SOURCES/README-module-dynamic-limit-req new file mode 100644 index 0000000..8e89cfd --- /dev/null +++ b/SOURCES/README-module-dynamic-limit-req @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/limithit/ngx_dynamic_limit_req_module + Version: 1.9.3 + Archive: https://github.com/limithit/ngx_dynamic_limit_req_module/archive/refs/tags/1.9.3.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-echo b/SOURCES/README-module-echo new file mode 100644 index 0000000..d808dfa --- /dev/null +++ b/SOURCES/README-module-echo @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/openresty/echo-nginx-module + Version: v0.63 + Archive: https://github.com/openresty/echo-nginx-module/archive/refs/tags/v0.63.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-enhanced-memcached b/SOURCES/README-module-enhanced-memcached new file mode 100644 index 0000000..f485d8c --- /dev/null +++ b/SOURCES/README-module-enhanced-memcached @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/bpaquet/ngx_http_enhanced_memcached_module + Version: v0.3 + Archive: https://github.com/bpaquet/ngx_http_enhanced_memcached_module/archive/refs/tags/v0.3.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-eval b/SOURCES/README-module-eval new file mode 100644 index 0000000..c703356 --- /dev/null +++ b/SOURCES/README-module-eval @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/openresty/nginx-eval-module + Version: 2016.06.10 + Archive: https://github.com/openresty/nginx-eval-module/archive/refs/tags/2016.06.10.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-geoip2 b/SOURCES/README-module-geoip2 new file mode 100644 index 0000000..55853bd --- /dev/null +++ b/SOURCES/README-module-geoip2 @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/leev/ngx_http_geoip2_module + Version: 3.4 + Archive: https://github.com/leev/ngx_http_geoip2_module/archive/refs/tags/3.4.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-headers-more b/SOURCES/README-module-headers-more new file mode 100644 index 0000000..436296b --- /dev/null +++ b/SOURCES/README-module-headers-more @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/openresty/headers-more-nginx-module + Version: v0.37 + Archive: https://github.com/openresty/headers-more-nginx-module/archive/refs/tags/v0.37.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-image-filter b/SOURCES/README-module-image-filter new file mode 100644 index 0000000..67df518 --- /dev/null +++ b/SOURCES/README-module-image-filter @@ -0,0 +1,2 @@ +Please find the official documentation for this module here: +https://angie.software/en/http_image_filter/ diff --git a/SOURCES/README-module-jwt b/SOURCES/README-module-jwt new file mode 100644 index 0000000..9cb3e05 --- /dev/null +++ b/SOURCES/README-module-jwt @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/max-lt/nginx-jwt-module + Version: v3.4.1 + Archive: https://github.com/max-lt/nginx-jwt-module/archive/refs/tags/v3.4.1.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-keyval b/SOURCES/README-module-keyval new file mode 100644 index 0000000..f838078 --- /dev/null +++ b/SOURCES/README-module-keyval @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/kjdev/nginx-keyval + Version: 0.3.0 + Archive: https://github.com/kjdev/nginx-keyval/archive/refs/tags/0.3.0.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-lua b/SOURCES/README-module-lua new file mode 100644 index 0000000..aa368e9 --- /dev/null +++ b/SOURCES/README-module-lua @@ -0,0 +1,67 @@ +This package has been built using the below sources: + +- Project: https://github.com/openresty/lua-nginx-module + Version: v0.10.26 + Archive: https://github.com/openresty/lua-nginx-module/archive/refs/tags/v0.10.26.tar.gz + +- Project: https://github.com/openresty/stream-lua-nginx-module + Version: bea8a0c0de94cede71554f53818ac0267d675d63 + Archive: https://github.com/openresty/stream-lua-nginx-module/archive/bea8a0c0de94cede71554f53818ac0267d675d63.tar.gz + +- Project: https://github.com/openresty/luajit2 + Version: v2.1-20240626 + Archive: https://github.com/openresty/luajit2/archive/refs/tags/v2.1-20240626.tar.gz + +- Project: https://github.com/ldrumm/chronos + Version: v0.2-4 + Archive: https://github.com/ldrumm/chronos/archive/refs/tags/v0.2-4.tar.gz + +- Project: https://github.com/kikito/inspect.lua + Version: v3.1.3 + Archive: https://github.com/kikito/inspect.lua/archive/refs/tags/v3.1.3.tar.gz + +- Project: https://github.com/mpx/lua-cjson + Version: 2.1.0 + Archive: https://github.com/mpx/lua-cjson/archive/refs/tags/2.1.0.tar.gz + +- Project: https://github.com/edubart/lua-dumper + Version: v0.1.1 + Archive: https://github.com/edubart/lua-dumper/archive/refs/tags/v0.1.1.tar.gz + +- Project: https://github.com/openresty/lua-resty-core + Version: v0.1.28 + Archive: https://github.com/openresty/lua-resty-core/archive/refs/tags/v0.1.28.tar.gz + +- Project: https://github.com/jkeys089/lua-resty-hmac + Version: 5f60e1a28b9fdd7939f0e1738171f0ca5fe22978 + Archive: https://github.com/jkeys089/lua-resty-hmac/archive/5f60e1a28b9fdd7939f0e1738171f0ca5fe22978.tar.gz + +- Project: https://github.com/ledgetech/lua-resty-http + Version: v0.17.2 + Archive: https://github.com/ledgetech/lua-resty-http/archive/refs/tags/v0.17.2.tar.gz + +- Project: https://github.com/cdbattags/lua-resty-jwt + Version: v0.2.3 + Archive: https://github.com/cdbattags/lua-resty-jwt/archive/refs/tags/v0.2.3.tar.gz + +- Project: https://github.com/openresty/lua-resty-lrucache + Version: v0.13 + Archive: https://github.com/openresty/lua-resty-lrucache/archive/refs/tags/v0.13.tar.gz + +- Project: https://github.com/zmartzone/lua-resty-openidc + Version: v1.7.6 + Archive: https://github.com/zmartzone/lua-resty-openidc/archive/refs/tags/v1.7.6.tar.gz + +- Project: https://github.com/fffonion/lua-resty-openssl + Version: 1.4.0 + Archive: https://github.com/fffonion/lua-resty-openssl/archive/refs/tags/1.4.0.tar.gz + +- Project: https://github.com/bungle/lua-resty-session + Version: v3.10 + Archive: https://github.com/bungle/lua-resty-session/archive/refs/tags/v3.10.tar.gz + +- Project: https://github.com/openresty/lua-resty-string + Version: v0.15 + Archive: https://github.com/openresty/lua-resty-string/archive/refs/tags/v0.15.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-modsecurity b/SOURCES/README-module-modsecurity new file mode 100644 index 0000000..3265e1d --- /dev/null +++ b/SOURCES/README-module-modsecurity @@ -0,0 +1,19 @@ +This package has been built using the below sources: + +- Project: https://github.com/owasp-modsecurity/ModSecurity-nginx + Version: v1.0.3 + Archive: https://github.com/owasp-modsecurity/ModSecurity-nginx/archive/refs/tags/v1.0.3.tar.gz + +- Project: https://github.com/owasp-modsecurity/ModSecurity + Version: v3.0.12 + Archive: https://github.com/owasp-modsecurity/ModSecurity/archive/refs/tags/v3.0.12.tar.gz + +- Project: https://github.com/libinjection/libinjection + Version: b9fcaaf9e50e9492807b23ffcc6af46ee1f203b9 + Archive: https://github.com/libinjection/libinjection/archive/b9fcaaf9e50e9492807b23ffcc6af46ee1f203b9.tar.gz + +- Project: https://github.com/ssdeep-project/ssdeep + Version: release-2.14.1 + Archive: https://github.com/ssdeep-project/ssdeep/archive/refs/tags/release-2.14.1.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-ndk b/SOURCES/README-module-ndk new file mode 100644 index 0000000..caaf079 --- /dev/null +++ b/SOURCES/README-module-ndk @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/vision5/ngx_devel_kit + Version: v0.3.3 + Archive: https://github.com/vision5/ngx_devel_kit/archive/refs/tags/v0.3.3.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-njs b/SOURCES/README-module-njs new file mode 100644 index 0000000..eae9e88 --- /dev/null +++ b/SOURCES/README-module-njs @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/nginx/njs + Version: 0.8.5 + Archive: https://github.com/nginx/njs/archive/refs/tags/0.8.5.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-opentracing b/SOURCES/README-module-opentracing new file mode 100644 index 0000000..e8881a0 --- /dev/null +++ b/SOURCES/README-module-opentracing @@ -0,0 +1,19 @@ +This package has been built using the below sources: + +- Project: https://github.com/opentracing-contrib/nginx-opentracing + Version: v0.35.3 + Archive: https://github.com/opentracing-contrib/nginx-opentracing/archive/refs/tags/v0.35.3.tar.gz + +- Project: https://github.com/opentracing/opentracing-cpp + Version: v1.6.0 + Archive: https://github.com/opentracing/opentracing-cpp/archive/refs/tags/v1.6.0.tar.gz + +- Project: https://github.com/DataDog/dd-opentracing-cpp + Version: v1.3.7 + Archive: https://github.com/DataDog/dd-opentracing-cpp/archive/refs/tags/v1.3.7.tar.gz + +- Project: https://github.com/rnburn/zipkin-cpp-opentracing + Version: 966416e4d6aec23f572730aede6c087ccce6d194 + Archive: https://github.com/rnburn/zipkin-cpp-opentracing/archive/966416e4d6aec23f572730aede6c087ccce6d194.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-otel b/SOURCES/README-module-otel new file mode 100644 index 0000000..ba9a6ce --- /dev/null +++ b/SOURCES/README-module-otel @@ -0,0 +1,35 @@ +This package has been built using the below sources: + +- Project: https://github.com/nginxinc/nginx-otel + Version: v0.1.1 + Archive: https://github.com/nginxinc/nginx-otel/archive/refs/tags/v0.1.1.tar.gz + +- Project: https://github.com/abseil/abseil-cpp + Version: 20211102.0 + Archive: https://github.com/abseil/abseil-cpp/archive/refs/tags/20211102.0.tar.gz + +- Project: https://github.com/c-ares/c-ares + Version: cares-1_27_0 + Archive: https://github.com/c-ares/c-ares/archive/refs/tags/cares-1_27_0.tar.gz + +- Project: https://github.com/grpc/grpc + Version: v1.46.7 + Archive: https://github.com/grpc/grpc/archive/refs/tags/v1.46.7.tar.gz + +- Project: https://github.com/open-telemetry/opentelemetry-cpp + Version: v1.11.0 + Archive: https://github.com/open-telemetry/opentelemetry-cpp/archive/refs/tags/v1.11.0.tar.gz + +- Project: https://github.com/open-telemetry/opentelemetry-proto + Version: v1.0.0 + Archive: https://github.com/open-telemetry/opentelemetry-proto/archive/refs/tags/v1.0.0.tar.gz + +- Project: https://github.com/protocolbuffers/protobuf + Version: v3.19.5 + Archive: https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.19.5.tar.gz + +- Project: https://github.com/google/re2 + Version: 2024-03-01 + Archive: https://github.com/google/re2/archive/refs/tags/2024-03-01.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-perl b/SOURCES/README-module-perl new file mode 100644 index 0000000..65979ff --- /dev/null +++ b/SOURCES/README-module-perl @@ -0,0 +1,2 @@ +Please find the official documentation for this module here: +https://angie.software/en/http_perl/ diff --git a/SOURCES/README-module-postgres b/SOURCES/README-module-postgres new file mode 100644 index 0000000..6b164f9 --- /dev/null +++ b/SOURCES/README-module-postgres @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/FRiCKLE/ngx_postgres + Version: 1.0rc7 + Archive: https://github.com/FRiCKLE/ngx_postgres/archive/refs/tags/1.0rc7.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-redis2 b/SOURCES/README-module-redis2 new file mode 100644 index 0000000..bdb9db7 --- /dev/null +++ b/SOURCES/README-module-redis2 @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/openresty/redis2-nginx-module + Version: v0.15 + Archive: https://github.com/openresty/redis2-nginx-module/archive/refs/tags/v0.15.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-rtmp b/SOURCES/README-module-rtmp new file mode 100644 index 0000000..5fd937e --- /dev/null +++ b/SOURCES/README-module-rtmp @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/arut/nginx-rtmp-module + Version: v1.2.2 + Archive: https://github.com/arut/nginx-rtmp-module/archive/refs/tags/v1.2.2.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-set-misc b/SOURCES/README-module-set-misc new file mode 100644 index 0000000..5c9cef5 --- /dev/null +++ b/SOURCES/README-module-set-misc @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/openresty/set-misc-nginx-module + Version: v0.33 + Archive: https://github.com/openresty/set-misc-nginx-module/archive/refs/tags/v0.33.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-subs b/SOURCES/README-module-subs new file mode 100644 index 0000000..13790be --- /dev/null +++ b/SOURCES/README-module-subs @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/yaoweibin/ngx_http_substitutions_filter_module + Version: e12e965ac1837ca709709f9a26f572a54d83430e + Archive: https://github.com/yaoweibin/ngx_http_substitutions_filter_module/archive/e12e965ac1837ca709709f9a26f572a54d83430e.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-testcookie b/SOURCES/README-module-testcookie new file mode 100644 index 0000000..89532be --- /dev/null +++ b/SOURCES/README-module-testcookie @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/kyprizel/testcookie-nginx-module + Version: 64137c2f7e66e8866f56fdecaaf09ac10a034da9 + Archive: https://github.com/kyprizel/testcookie-nginx-module/archive/64137c2f7e66e8866f56fdecaaf09ac10a034da9.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-upload b/SOURCES/README-module-upload new file mode 100644 index 0000000..0ec16d8 --- /dev/null +++ b/SOURCES/README-module-upload @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/fdintino/nginx-upload-module + Version: 2.3.0 + Archive: https://github.com/fdintino/nginx-upload-module/archive/refs/tags/2.3.0.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-vod b/SOURCES/README-module-vod new file mode 100644 index 0000000..507a391 --- /dev/null +++ b/SOURCES/README-module-vod @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/kaltura/nginx-vod-module + Version: 1.33 + Archive: https://github.com/kaltura/nginx-vod-module/archive/refs/tags/1.33.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-vts b/SOURCES/README-module-vts new file mode 100644 index 0000000..9cb526a --- /dev/null +++ b/SOURCES/README-module-vts @@ -0,0 +1,15 @@ +This package has been built using the below sources: + +- Project: https://github.com/vozlt/nginx-module-vts + Version: v0.2.2 + Archive: https://github.com/vozlt/nginx-module-vts/archive/refs/tags/v0.2.2.tar.gz + +- Project: https://github.com/vozlt/nginx-module-stream-sts + Version: v0.1.1 + Archive: https://github.com/vozlt/nginx-module-stream-sts/archive/refs/tags/v0.1.1.tar.gz + +- Project: https://github.com/vozlt/nginx-module-sts + Version: v0.1.1 + Archive: https://github.com/vozlt/nginx-module-sts/archive/refs/tags/v0.1.1.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-xslt b/SOURCES/README-module-xslt new file mode 100644 index 0000000..e9b0cfd --- /dev/null +++ b/SOURCES/README-module-xslt @@ -0,0 +1,2 @@ +Please find the official documentation for this module here: +https://angie.software/en/http_xslt/ diff --git a/SOURCES/README-module-zip b/SOURCES/README-module-zip new file mode 100644 index 0000000..3317ec6 --- /dev/null +++ b/SOURCES/README-module-zip @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/evanmiller/mod_zip + Version: 1.3.0 + Archive: https://github.com/evanmiller/mod_zip/archive/refs/tags/1.3.0.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/README-module-zstd b/SOURCES/README-module-zstd new file mode 100644 index 0000000..8ea7eac --- /dev/null +++ b/SOURCES/README-module-zstd @@ -0,0 +1,7 @@ +This package has been built using the below sources: + +- Project: https://github.com/tokers/zstd-nginx-module + Version: f4ba115e0b0eaecde545e5f37db6aa18917d8f4b + Archive: https://github.com/tokers/zstd-nginx-module/archive/f4ba115e0b0eaecde545e5f37db6aa18917d8f4b.tar.gz + +Please refer to the given links for further details. diff --git a/SOURCES/abseil-off_t.patch b/SOURCES/abseil-off_t.patch new file mode 100644 index 0000000..fd4e995 --- /dev/null +++ b/SOURCES/abseil-off_t.patch @@ -0,0 +1,20 @@ +--- absl/base/internal/direct_mmap.h ++++ absl/base/internal/direct_mmap.h +@@ -72,7 +72,7 @@ namespace base_internal { + // Platform specific logic extracted from + // https://chromium.googlesource.com/linux-syscall-support/+/master/linux_syscall_support.h + inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd, +- off64_t offset) noexcept { ++ off_t offset) noexcept { + #if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \ + defined(__m68k__) || defined(__sh__) || \ + (defined(__hppa__) && !defined(__LP64__)) || \ +@@ -102,7 +102,7 @@ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd, + #else + return reinterpret_cast( + syscall(SYS_mmap2, start, length, prot, flags, fd, +- static_cast(offset / pagesize))); ++ static_cast(offset / pagesize))); // NOLINT + #endif + #elif defined(__s390x__) + // On s390x, mmap() arguments are passed in memory. diff --git a/SOURCES/abseil-str_format.patch b/SOURCES/abseil-str_format.patch new file mode 100644 index 0000000..30f31a7 --- /dev/null +++ b/SOURCES/abseil-str_format.patch @@ -0,0 +1,10 @@ +--- absl/strings/internal/str_format/extension.h ++++ absl/strings/internal/str_format/extension.h +@@ -17,6 +17,7 @@ + #define ABSL_STRINGS_INTERNAL_STR_FORMAT_EXTENSION_H_ + + #include ++#include + + #include + #include diff --git a/SOURCES/angie-module-modsecurity.logrotate b/SOURCES/angie-module-modsecurity.logrotate new file mode 100644 index 0000000..582c4b1 --- /dev/null +++ b/SOURCES/angie-module-modsecurity.logrotate @@ -0,0 +1,9 @@ +/var/log/angie/modsecurity/*.log { + daily + missingok + rotate 31 + compress + delaycompress + notifempty + copytruncate +} diff --git a/SOURCES/angie.conf b/SOURCES/angie.conf new file mode 100644 index 0000000..63b0416 --- /dev/null +++ b/SOURCES/angie.conf @@ -0,0 +1,42 @@ +user angie; +worker_processes auto; +worker_rlimit_nofile 65536; + +error_log /var/log/angie/error.log notice; +pid /run/angie.pid; + +events { + worker_connections 65536; +} + + +http { + include /etc/angie/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + log_format extended '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" rt="$request_time" ' + '"$http_user_agent" "$http_x_forwarded_for" ' + 'h="$host" sn="$server_name" ru="$request_uri" u="$uri" ' + 'ucs="$upstream_cache_status" ua="$upstream_addr" us="$upstream_status" ' + 'uct="$upstream_connect_time" urt="$upstream_response_time"'; + + access_log /var/log/angie/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + include /etc/angie/http.d/*.conf; +} + +#stream { +# include /etc/angie/stream.d/*.conf; +#} diff --git a/SOURCES/angie.logrotate b/SOURCES/angie.logrotate new file mode 100644 index 0000000..7ab4c7f --- /dev/null +++ b/SOURCES/angie.logrotate @@ -0,0 +1,14 @@ +/var/log/angie/*.log { + daily + missingok + rotate 31 + compress + delaycompress + notifempty + sharedscripts + postrotate + if [ -f /run/angie.pid ]; then + kill -USR1 $(cat /run/angie.pid) + fi + endscript +} diff --git a/SOURCES/angie.service b/SOURCES/angie.service new file mode 100644 index 0000000..b3469bc --- /dev/null +++ b/SOURCES/angie.service @@ -0,0 +1,15 @@ +[Unit] +Description=Angie - high performance web server +Documentation=https://angie.software/en/ +After=network-online.target remote-fs.target nss-lookup.target +Wants=network-online.target + +[Service] +Type=forking +PIDFile=/run/angie.pid +ExecStart=/usr/sbin/angie -c /etc/angie/angie.conf +ExecReload=/bin/sh -c "/bin/kill -s HUP $(/bin/cat /run/angie.pid)" +ExecStop=/bin/sh -c "/bin/kill -s TERM $(/bin/cat /run/angie.pid)" + +[Install] +WantedBy=multi-user.target diff --git a/SOURCES/angie.upgrade b/SOURCES/angie.upgrade new file mode 100644 index 0000000..6667982 --- /dev/null +++ b/SOURCES/angie.upgrade @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Legacy action script for "service angie upgrade" + +prog=angie +angie=/usr/sbin/angie +conffile=/etc/angie/angie.conf +pidfile=/run/angie.pid + +oldbinpidfile=${pidfile}.oldbin +${angie} -t -c ${conffile} -q || exit 6 +echo -n $"Starting new master $prog: " +pkill -F ${pidfile} ${prog} --signal USR2 +echo + +for i in `/usr/bin/seq 5`; do + /bin/sleep 1 + if [ -f ${oldbinpidfile} -a -f ${pidfile} ]; then + echo -n $"Graceful shutdown of old $prog: " + pkill -F ${oldbinpidfile} ${prog} --signal QUIT + echo + exit 0 + fi +done + +echo "Upgrade failed!" +exit 1 diff --git a/SOURCES/configure-accelerator.patch b/SOURCES/configure-accelerator.patch new file mode 100644 index 0000000..0742305 --- /dev/null +++ b/SOURCES/configure-accelerator.patch @@ -0,0 +1,1543 @@ +# HG changeset patch +# User Vladimir Khomutov +# Date 1721036673 -10800 +# Mon Jul 15 12:44:33 2024 +0300 +# Node ID 1a5ebc8fd6df82e6f6c53306cfb858e674e7a664 +# Parent 0b88485f70ed6715b9b48ef1b19529262168a312 +Configure: makefile generator optimizations. + +The generator makes multiple sed(1) calls, even when not really needed. +The code is thrashed with multiple copies of regular expressions making +it hard to read. + +Most sed calls are replaced with shell builtins and moved into functions, each +performing clear task, making the rest of the code easier to read. Functions +save results to variables instead of echoing. + +The most often and useless case: replacing slash with configured directory +separator (which is also slash on UNIX platform) using sed(1) is optimized. +* * * +Configure: avoid calling external tools. + +Avoid calling tr(1) when converting feature/include name to macro. +* * * +Configure: separate compile and linking steps. + +This allows to cache compilation results using ccache. +* * * +Configure: use auto/define instead of direct access. +* * * +Configure: test for C compiler presence is moved to cc/conf. + +The test has nothing to do with the compiler name and makes it harder +to cache the script result in the following patch. +* * * +Configure: feature cache. + +If requested by --feature-cache[=path] configuration option, results of +each autotest performed on a first run are captured and saved as files. + +Upon the second invocation, instead of performing actual feature test, +a cached result is used. + +The test must set ngx_found and provide convenient way to capture other +execution results (i.e. set variables, auto/have calls etc). + +When reading cache results, configure script does not invoke any system +commands/compilers/tools that may affect resulting configuration. + +diff --git a/auto/cache b/auto/cache +new file mode 100644 +--- /dev/null ++++ b/auto/cache +@@ -0,0 +1,74 @@ ++ ++# Copyright (C) 2024 Web Server LLC ++ ++ ++if [ $NGX_FEATURE_CACHE = YES ]; then ++ NGX_FC_PATH=$NGX_OBJS ++ ++elif [ $NGX_FEATURE_CACHE != NO ]; then ++ ++ NGX_FC_PATH=${NGX_FEATURE_CACHE} ++ mkdir -p $NGX_FC_PATH ++fi ++ ++ ++# tries to load cache for current autotest environment ++check_cache() ++{ ++ if [ $NGX_FEATURE_CACHE = NO ]; then ++ return 1 ++ fi ++ ++ # remove chars non-suitable for filename and limit length to 64 ++ ++ OPTIND=1 ++ ngx_uniq= ++ N=0 ++ ++ while getopts ":" opt "-$1"; do ++ case "$OPTARG" in ++ [A-Za-z0-9]) ++ ngx_uniq=${ngx_uniq}$OPTARG ++ ;; ++ *) ++ ngx_uniq=${ngx_uniq}_ ++ ;; ++ esac ++ ++ N=$(($N + 1)) ++ ++ if [ $N -gt 64 ]; then ++ break ++ fi ++ done ++ ++ NGX_AUTOTEST_CACHE=$NGX_FC_PATH/$2.$ngx_uniq.cache ++ ++ if [ -f $NGX_AUTOTEST_CACHE ]; then ++ ++ . $NGX_AUTOTEST_CACHE ++ ++ if [ $ngx_found = yes ]; then ++ echo "using cached $1 ... found" ++ else ++ echo "using cached $1 ... not found" ++ fi ++ ++ return 0 ++ ++ else ++ return 1 ++ fi ++} ++ ++ ++cache_output_start() ++{ ++ exec 3>&1 1>$NGX_AUTOTEST_CACHE ++} ++ ++ ++cache_output_end() ++{ ++ exec 1>&3 3>&- ++} +diff --git a/auto/cc/clang b/auto/cc/clang +--- a/auto/cc/clang ++++ b/auto/cc/clang +@@ -1,18 +1,11 @@ + ++# Copyright (C) 2024 Web Server LLC + # Copyright (C) Nginx, Inc. + + + # clang + +- +-NGX_CLANG_VER=`$CC -v 2>&1 | grep 'version' 2>&1 \ +- | sed -n -e 's/^.*clang version \(.*\)/\1/p' \ +- -e 's/^.*LLVM version \(.*\)/\1/p'` +- +-echo " + clang version: $NGX_CLANG_VER" +- +-have=NGX_COMPILER value="\"clang $NGX_CLANG_VER\"" . auto/define +- ++. auto/cc/clang.version + + CC_TEST_FLAGS="-pipe" + +diff --git a/auto/cc/clang.version b/auto/cc/clang.version +new file mode 100644 +--- /dev/null ++++ b/auto/cc/clang.version +@@ -0,0 +1,28 @@ ++ ++# Copyright (C) 2024 Web Server LLC ++# Copyright (C) Nginx, Inc. ++ ++ ++if check_cache "clang version" "cc"; then ++ return ++fi ++ ++NGX_CLANG_VER=`$CC -v 2>&1 | grep 'version' 2>&1 \ ++ | sed -n -e 's/^.*clang version \(.*\)/\1/p' \ ++ -e 's/^.*LLVM version \(.*\)/\1/p'` ++ ++echo " + clang version: $NGX_CLANG_VER" ++ ++have=NGX_COMPILER value="\"clang $NGX_CLANG_VER\"" . auto/define ++ ++if [ $NGX_FEATURE_CACHE = NO ]; then ++ return ++fi ++ ++cache_output_start ++ ++echo "ngx_found=yes" ++echo "NGX_CLANG_VER=\"$NGX_CLANG_VER\"" ++echo 'have=NGX_COMPILER value="\"clang $NGX_CLANG_VER\"" . auto/define' ++ ++cache_output_end +diff --git a/auto/cc/conf b/auto/cc/conf +--- a/auto/cc/conf ++++ b/auto/cc/conf +@@ -35,6 +35,26 @@ ngx_spacer= + ngx_long_regex_cont=$ngx_regex_cont + ngx_long_cont=$ngx_cont + ++ ++if [ "$NGX_PLATFORM" != win32 ]; then ++ ++ ngx_feature="C compiler" ++ ngx_feature_name= ++ ngx_feature_run=yes ++ ngx_feature_incs= ++ ngx_feature_path= ++ ngx_feature_libs= ++ ngx_feature_test= ++ . auto/feature ++ ++ if [ $ngx_found = no ]; then ++ echo ++ echo $0: error: C compiler $CC is not found ++ echo ++ exit 1 ++ fi ++fi ++ + . auto/cc/name + + if test -n "$CFLAGS"; then +diff --git a/auto/cc/gcc b/auto/cc/gcc +--- a/auto/cc/gcc ++++ b/auto/cc/gcc +@@ -1,20 +1,10 @@ + ++# Copyright (C) 2024 Web Server LLC + # Copyright (C) Igor Sysoev + # Copyright (C) Nginx, Inc. + + +-# gcc 2.7.2.3, 2.8.1, 2.95.4, egcs-1.1.2 +-# 3.0.4, 3.1.1, 3.2.3, 3.3.2, 3.3.3, 3.3.4, 3.4.0, 3.4.2 +-# 4.0.0, 4.0.1, 4.1.0 +- +- +-NGX_GCC_VER=`$CC -v 2>&1 | grep 'gcc version' 2>&1 \ +- | sed -e 's/^.* version \(.*\)/\1/'` +- +-echo " + gcc version: $NGX_GCC_VER" +- +-have=NGX_COMPILER value="\"gcc $NGX_GCC_VER\"" . auto/define +- ++. auto/cc/gcc.version + + # Solaris 7's /usr/ccs/bin/as does not support "-pipe" + +diff --git a/auto/cc/gcc.version b/auto/cc/gcc.version +new file mode 100644 +--- /dev/null ++++ b/auto/cc/gcc.version +@@ -0,0 +1,33 @@ ++ ++# Copyright (C) 2024 Web Server LLC ++# Copyright (C) Igor Sysoev ++# Copyright (C) Nginx, Inc. ++ ++ ++if check_cache "gcc version" "cc"; then ++ return ++fi ++ ++# gcc 2.7.2.3, 2.8.1, 2.95.4, egcs-1.1.2 ++# 3.0.4, 3.1.1, 3.2.3, 3.3.2, 3.3.3, 3.3.4, 3.4.0, 3.4.2 ++# 4.0.0, 4.0.1, 4.1.0 ++ ++ ++NGX_GCC_VER=`$CC -v 2>&1 | grep 'gcc version' 2>&1 \ ++ | sed -e 's/^.* version \(.*\)/\1/'` ++ ++echo " + gcc version: $NGX_GCC_VER" ++ ++have=NGX_COMPILER value="\"gcc $NGX_GCC_VER\"" . auto/define ++ ++if [ $NGX_FEATURE_CACHE = NO ]; then ++ return ++fi ++ ++cache_output_start ++ ++echo "ngx_found=yes" ++echo "NGX_GCC_VER=\"$NGX_GCC_VER\"" ++echo 'have=NGX_COMPILER value="\"gcc $NGX_GCC_VER\"" . auto/define' ++ ++cache_output_end +diff --git a/auto/cc/name b/auto/cc/name +--- a/auto/cc/name ++++ b/auto/cc/name +@@ -1,29 +1,13 @@ + ++# Copyright (C) 2024 Web Server LLC + # Copyright (C) Igor Sysoev + # Copyright (C) Nginx, Inc. + + +-if [ "$NGX_PLATFORM" != win32 ]; then +- +- ngx_feature="C compiler" +- ngx_feature_name= +- ngx_feature_run=yes +- ngx_feature_incs= +- ngx_feature_path= +- ngx_feature_libs= +- ngx_feature_test= +- . auto/feature +- +- if [ $ngx_found = no ]; then +- echo +- echo $0: error: C compiler $CC is not found +- echo +- exit 1 +- fi +- ++if check_cache "compiler name" "cc"; then ++ return + fi + +- + if [ "$CC" = cl ]; then + NGX_CC_NAME=msvc + echo " + using Microsoft Visual C++ compiler" +@@ -68,3 +52,14 @@ else + NGX_CC_NAME=unknown + + fi ++ ++if [ $NGX_FEATURE_CACHE = NO ]; then ++ return ++fi ++ ++cache_output_start ++ ++echo "ngx_found=yes" ++echo "NGX_CC_NAME=$NGX_CC_NAME" ++ ++cache_output_end +diff --git a/auto/endianness b/auto/endianness +--- a/auto/endianness ++++ b/auto/endianness +@@ -1,8 +1,13 @@ + ++# Copyright (C) 2024 Web Server LLC + # Copyright (C) Igor Sysoev + # Copyright (C) Nginx, Inc. + + ++if check_cache "little endian" "endianness"; then ++ return ++fi ++ + echo $ngx_n "checking for system byte ordering ...$ngx_c" + + cat << END >> $NGX_AUTOCONF_ERR +@@ -12,6 +17,7 @@ checking for system byte ordering + + END + ++ngx_found=no + + cat << END > $NGX_AUTOTEST.c + +@@ -26,8 +32,10 @@ int main(void) { + + END + +-ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \ +- -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs" ++ngx_test="($CC -c $CC_TEST_FLAGS $CC_AUX_FLAGS \ ++ -o $NGX_AUTOTEST.o $NGX_AUTOTEST.c && \ ++ $CC $CC_TEST_FLAGS $CC_AUX_FLAGS \ ++ -o $NGX_AUTOTEST $NGX_AUTOTEST.o $NGX_LD_OPT $ngx_feature_libs)" + + eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1" + +@@ -35,6 +43,7 @@ if [ -x $NGX_AUTOTEST ]; then + if $NGX_AUTOTEST >/dev/null 2>&1; then + echo " little endian" + have=NGX_HAVE_LITTLE_ENDIAN . auto/have ++ ngx_found=yes + else + echo " big endian" + fi +@@ -48,3 +57,17 @@ else + echo "$0: error: cannot detect system byte ordering" + exit 1 + fi ++ ++if [ $NGX_FEATURE_CACHE = NO ]; then ++ return ++fi ++ ++cache_output_start ++ ++echo "ngx_found=$ngx_found" ++ ++if [ $ngx_found = yes ]; then ++ echo "have=NGX_HAVE_LITTLE_ENDIAN . auto/have" ++fi ++ ++cache_output_end +diff --git a/auto/feature b/auto/feature +--- a/auto/feature ++++ b/auto/feature +@@ -1,8 +1,13 @@ + ++# Copyright (C) 2024 Web Server LLC + # Copyright (C) Igor Sysoev + # Copyright (C) Nginx, Inc. + + ++if check_cache "$ngx_feature" "feature"; then ++ return ++fi ++ + echo $ngx_n "checking for $ngx_feature ...$ngx_c" + + cat << END >> $NGX_AUTOCONF_ERR +@@ -13,10 +18,12 @@ checking for $ngx_feature + END + + ngx_found=no ++ngx_add_have=no ++ngx_add_value=no + + if test -n "$ngx_feature_name"; then +- ngx_have_feature=`echo $ngx_feature_name \ +- | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ++ name2macro "$ngx_feature_name" ++ ngx_have_feature="$res" + fi + + if test -n "$ngx_feature_path"; then +@@ -39,8 +46,10 @@ int main(void) { + END + + +-ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS $ngx_feature_inc_path \ +- -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_TEST_LD_OPT $ngx_feature_libs" ++ngx_test="($CC -c $CC_TEST_FLAGS $CC_AUX_FLAGS $ngx_feature_inc_path \ ++ -o $NGX_AUTOTEST.o $NGX_AUTOTEST.c && \ ++ $CC $CC_TEST_FLAGS $CC_AUX_FLAGS \ ++ -o $NGX_AUTOTEST $NGX_AUTOTEST.o $NGX_TEST_LD_OPT $ngx_feature_libs)" + + ngx_feature_inc_path= + +@@ -59,6 +68,7 @@ if [ -x $NGX_AUTOTEST ]; then + + if test -n "$ngx_feature_name"; then + have=$ngx_have_feature . auto/have ++ ngx_add_have=yes + fi + + else +@@ -72,13 +82,9 @@ if [ -x $NGX_AUTOTEST ]; then + echo " found" + ngx_found=yes + +- cat << END >> $NGX_AUTO_CONFIG_H ++ have="$ngx_feature_name" value="$($NGX_AUTOTEST)" . auto/define ++ ngx_add_value=$value + +-#ifndef $ngx_feature_name +-#define $ngx_feature_name `$NGX_AUTOTEST` +-#endif +- +-END + else + echo " found but is not working" + fi +@@ -95,6 +101,7 @@ END + + if test -n "$ngx_feature_name"; then + have=$ngx_have_feature . auto/have ++ ngx_add_have=yes + fi + fi + ;; +@@ -105,6 +112,7 @@ END + + if test -n "$ngx_feature_name"; then + have=$ngx_have_feature . auto/have ++ ngx_add_have=yes + fi + ;; + +@@ -121,3 +129,21 @@ else + fi + + rm -rf $NGX_AUTOTEST* ++ ++if [ $NGX_FEATURE_CACHE = NO ]; then ++ return ++fi ++ ++cache_output_start ++ ++echo "ngx_found=$ngx_found" ++ ++if [ $ngx_add_have = yes ]; then ++ echo "have=$ngx_have_feature . auto/have" ++fi ++ ++if [ $ngx_add_value != no ]; then ++ echo "have=\"$ngx_feature_name\" value=\"$ngx_add_value\" . auto/define" ++fi ++ ++cache_output_end +diff --git a/auto/include b/auto/include +--- a/auto/include ++++ b/auto/include +@@ -1,8 +1,13 @@ + ++# Copyright (C) 2024 Web Server LLC + # Copyright (C) Igor Sysoev + # Copyright (C) Nginx, Inc. + + ++if check_cache "$ngx_include" "include"; then ++ return ++fi ++ + echo $ngx_n "checking for $ngx_include ...$ngx_c" + + cat << END >> $NGX_AUTOCONF_ERR +@@ -27,7 +32,8 @@ int main(void) { + END + + +-ngx_test="$CC -o $NGX_AUTOTEST $NGX_AUTOTEST.c" ++ngx_test="($CC -c -o $NGX_AUTOTEST.o $NGX_AUTOTEST.c && \ ++ $CC -o $NGX_AUTOTEST $NGX_AUTOTEST.o)" + + eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1" + +@@ -37,9 +43,8 @@ if [ -x $NGX_AUTOTEST ]; then + + echo " found" + +- ngx_name=`echo $ngx_include \ +- | tr abcdefghijklmnopqrstuvwxyz/. ABCDEFGHIJKLMNOPQRSTUVWXYZ__` +- ++ name2macro "$ngx_include" ++ ngx_name="$res" + + have=NGX_HAVE_$ngx_name . auto/have_headers + +@@ -56,3 +61,18 @@ else + fi + + rm -rf $NGX_AUTOTEST* ++ ++if [ $NGX_FEATURE_CACHE = NO ]; then ++ return ++fi ++ ++cache_output_start ++ ++echo "ngx_found=$ngx_found" ++ ++if [ $ngx_found = yes ]; then ++ echo "have=NGX_HAVE_$ngx_name . auto/have_headers" ++ echo "NGX_INCLUDE_$ngx_name='#include <$ngx_include>'" ++fi ++ ++cache_output_end +diff --git a/auto/make b/auto/make +--- a/auto/make ++++ b/auto/make +@@ -1,8 +1,96 @@ + ++# Copyright (C) 2024 Web Server LLC + # Copyright (C) Igor Sysoev + # Copyright (C) Nginx, Inc. + + ++dirsep() ++{ ++ if [ "$ngx_dirsep" = "/" ]; then ++ res="$@" ++ return ++ fi ++ ++ res=$(echo "$@" | sed -e "s/\//$ngx_regex_dirsep/g") ++} ++ ++ ++fmt_link() ++{ ++ dirsep "$@" ++ res="$ngx_long_cont$res" ++} ++ ++ ++fmt_list() ++{ ++ first="$1" ++ shift ++ last= ++ ++ for i in $@; do ++ last="$last$prefix$i" ++ done ++ ++ dirsep "$first$last" ++} ++ ++ ++fmt_incs() ++{ ++ prefix="$ngx_cont$ngx_include_opt" fmt_list "$@" ++} ++ ++ ++fmt_deps() ++{ ++ prefix="$ngx_cont" fmt_list "$@" ++} ++ ++ ++fmt_objs() ++{ ++ prefix="$ngx_long_cont" fmt_list "$@" ++} ++ ++ ++src2obj() ++{ ++ res= ++ case $1 in ++ *.c) res="${1%.c}.$ngx_objext" ;; ++ *.cc) res="${1%.cc}.$ngx_objext" ;; ++ *.cpp) res="${1%.cpp}.$ngx_objext";; ++ *.S) res="${1%.S}.$ngx_objext" ;; ++ *) res="$1" ;; ++ esac ++ ++ res="$NGX_OBJS$ngx_dirsep$res" ++} ++ ++ ++srcs2objs() ++{ ++ res= ++ ++ for i in $@; do ++ case $i in ++ *.c) i="${i%.c}.$ngx_objext" ;; ++ *.cc) i="${i%.cc}.$ngx_objext" ;; ++ *.cpp) i="${i%.cpp}.$ngx_objext";; ++ *.S) i="${i%.S}.$ngx_objext" ;; ++ *) i="$i" ;; ++ esac ++ ++ if [ -n "$res" ]; then ++ res="$res $NGX_OBJS/$i" ++ else ++ res="$NGX_OBJS/$i" ++ fi ++ done ++} ++ ++ + echo "creating $NGX_MAKEFILE" + + mkdir -p $NGX_OBJS/src/core $NGX_OBJS/src/event $NGX_OBJS/src/event/modules \ +@@ -15,8 +103,8 @@ mkdir -p $NGX_OBJS/src/core $NGX_OBJS/sr + $NGX_OBJS/src/misc + + +-ngx_objs_dir=$NGX_OBJS$ngx_regex_dirsep +-ngx_use_pch=`echo $NGX_USE_PCH | sed -e "s/\//$ngx_regex_dirsep/g"` ++dirsep "$NGX_USE_PCH" ++ngx_use_pch=$res + + + cat << END > $NGX_MAKEFILE +@@ -38,9 +126,8 @@ fi + + # ALL_INCS, required by the addons and by OpenWatcom C precompiled headers + +-ngx_incs=`echo $CORE_INCS $NGX_OBJS $HTTP_INCS $MAIL_INCS $STREAM_INCS\ +- | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \ +- -e "s/\//$ngx_regex_dirsep/g"` ++fmt_incs $CORE_INCS $NGX_OBJS $HTTP_INCS $MAIL_INCS $STREAM_INCS ++ngx_incs=$res + + cat << END >> $NGX_MAKEFILE + +@@ -54,13 +141,11 @@ ngx_all_srcs="$CORE_SRCS" + + # the core dependencies and include paths + +-ngx_deps=`echo $CORE_DEPS $NGX_AUTO_CONFIG_H $NGX_PCH \ +- | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \ +- -e "s/\//$ngx_regex_dirsep/g"` ++fmt_deps $CORE_DEPS $NGX_AUTO_CONFIG_H $NGX_PCH ++ngx_deps=$res + +-ngx_incs=`echo $CORE_INCS $NGX_OBJS \ +- | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \ +- -e "s/\//$ngx_regex_dirsep/g"` ++fmt_incs $CORE_INCS $NGX_OBJS ++ngx_incs=$res + + cat << END >> $NGX_MAKEFILE + +@@ -78,13 +163,11 @@ if [ $HTTP = YES ]; then + + ngx_all_srcs="$ngx_all_srcs $HTTP_SRCS" + +- ngx_deps=`echo $HTTP_DEPS \ +- | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \ +- -e "s/\//$ngx_regex_dirsep/g"` ++ fmt_deps $HTTP_DEPS ++ ngx_deps=$res + +- ngx_incs=`echo $HTTP_INCS \ +- | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \ +- -e "s/\//$ngx_regex_dirsep/g"` ++ fmt_incs $HTTP_INCS ++ ngx_incs=$res + + cat << END >> $NGX_MAKEFILE + +@@ -106,13 +189,11 @@ if [ $MAIL != NO ]; then + ngx_all_srcs="$ngx_all_srcs $MAIL_SRCS" + fi + +- ngx_deps=`echo $MAIL_DEPS \ +- | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \ +- -e "s/\//$ngx_regex_dirsep/g"` ++ fmt_deps $MAIL_DEPS ++ ngx_deps=$res + +- ngx_incs=`echo $MAIL_INCS \ +- | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \ +- -e "s/\//$ngx_regex_dirsep/g"` ++ fmt_incs $MAIL_INCS ++ ngx_incs=$res + + cat << END >> $NGX_MAKEFILE + +@@ -134,13 +215,11 @@ if [ $STREAM != NO ]; then + ngx_all_srcs="$ngx_all_srcs $STREAM_SRCS" + fi + +- ngx_deps=`echo $STREAM_DEPS \ +- | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \ +- -e "s/\//$ngx_regex_dirsep/g"` ++ fmt_deps $STREAM_DEPS ++ ngx_deps=$res + +- ngx_incs=`echo $STREAM_INCS \ +- | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \ +- -e "s/\//$ngx_regex_dirsep/g"` ++ fmt_incs $STREAM_INCS ++ ngx_incs=$res + + cat << END >> $NGX_MAKEFILE + +@@ -170,7 +249,8 @@ fi + + # angie + +-ngx_all_srcs=`echo $ngx_all_srcs | sed -e "s/\//$ngx_regex_dirsep/g"` ++dirsep $ngx_all_srcs ++ngx_all_srcs=$res + + for ngx_src in $NGX_ADDON_SRCS + do +@@ -178,49 +258,45 @@ do + + test -d $NGX_OBJS/$ngx_obj || mkdir -p $NGX_OBJS/$ngx_obj + +- ngx_obj=`echo $ngx_obj/\`basename $ngx_src\` \ +- | sed -e "s/\//$ngx_regex_dirsep/g"` ++ dirsep $ngx_obj/`basename $ngx_src`; ngx_obj=$res + + ngx_all_srcs="$ngx_all_srcs $ngx_obj" + done + +-ngx_all_objs=`echo $ngx_all_srcs \ +- | sed -e "s#\([^ ]*\.\)cpp#$NGX_OBJS\/\1$ngx_objext#g" \ +- -e "s#\([^ ]*\.\)cc#$NGX_OBJS\/\1$ngx_objext#g" \ +- -e "s#\([^ ]*\.\)c#$NGX_OBJS\/\1$ngx_objext#g" \ +- -e "s#\([^ ]*\.\)S#$NGX_OBJS\/\1$ngx_objext#g"` ++srcs2objs $ngx_all_srcs ++ngx_all_objs=$res + +-ngx_modules_c=`echo $NGX_MODULES_C | sed -e "s/\//$ngx_regex_dirsep/g"` ++dirsep $NGX_MODULES_C ++ngx_modules_c=$res + +-ngx_modules_obj=`echo $ngx_modules_c | sed -e "s/\(.*\.\)c/\1$ngx_objext/"` ++ngx_modules_obj=${ngx_modules_c%.c}.$ngx_objext + + + if test -n "$NGX_RES"; then + ngx_res=$NGX_RES + else + ngx_res="$NGX_RC $NGX_ICONS" +- ngx_rcc=`echo $NGX_RCC | sed -e "s/\//$ngx_regex_dirsep/g"` ++ dirsep $NGX_RCC ++ ngx_rcc=$res + fi + +-ngx_deps=`echo $ngx_all_objs $ngx_modules_obj $ngx_res $LINK_DEPS \ +- | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \ +- -e "s/\//$ngx_regex_dirsep/g"` ++fmt_deps $ngx_all_objs $ngx_modules_obj $ngx_res $LINK_DEPS ++ngx_deps=$res + +-ngx_objs=`echo $ngx_all_objs $ngx_modules_obj \ +- | sed -e "s/ *\([^ ][^ ]*\)/$ngx_long_regex_cont\1/g" \ +- -e "s/\//$ngx_regex_dirsep/g"` ++fmt_objs $ngx_all_objs $ngx_modules_obj ++ngx_objs=$res + + ngx_libs= + if test -n "$NGX_LD_OPT$CORE_LIBS"; then +- ngx_libs=`echo $NGX_LD_OPT $CORE_LIBS \ +- | sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"` ++ fmt_link $NGX_LD_OPT $CORE_LIBS ++ ngx_libs=$res + fi + +-ngx_link=${CORE_LINK:+`echo $CORE_LINK \ +- | sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"`} ++fmt_link $CORE_LINK ++ngx_link=${CORE_LINK:+$res} + +-ngx_main_link=${MAIN_LINK:+`echo $MAIN_LINK \ +- | sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"`} ++fmt_link $MAIN_LINK ++ngx_main_link=${MAIN_LINK:+$res} + + + cat << END >> $NGX_MAKEFILE +@@ -258,12 +334,8 @@ END + + for ngx_src in $CORE_SRCS + do +- ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"` +- ngx_obj=`echo $ngx_src \ +- | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \ +- -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \ +- -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \ +- -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"` ++ dirsep $ngx_src; ngx_src=$res ++ src2obj $ngx_src; ngx_obj=$res + + cat << END >> $NGX_MAKEFILE + +@@ -289,12 +361,8 @@ if [ $HTTP = YES ]; then + + for ngx_source in $HTTP_SRCS + do +- ngx_src=`echo $ngx_source | sed -e "s/\//$ngx_regex_dirsep/g"` +- ngx_obj=`echo $ngx_src \ +- | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \ +- -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \ +- -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \ +- -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"` ++ dirsep $ngx_source; ngx_src=$res ++ src2obj $ngx_src; ngx_obj=$res + + if [ $ngx_source = src/http/modules/perl/ngx_http_perl_module.c ]; then + +@@ -331,12 +399,8 @@ if [ $MAIL = YES ]; then + + for ngx_src in $MAIL_SRCS + do +- ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"` +- ngx_obj=`echo $ngx_src \ +- | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \ +- -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \ +- -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \ +- -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"` ++ dirsep $ngx_src; ngx_src=$res ++ src2obj $ngx_src; ngx_obj=$res + + cat << END >> $NGX_MAKEFILE + +@@ -361,12 +425,8 @@ if [ $STREAM = YES ]; then + + for ngx_src in $STREAM_SRCS + do +- ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"` +- ngx_obj=`echo $ngx_src \ +- | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \ +- -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \ +- -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \ +- -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"` ++ dirsep $ngx_src; ngx_src=$res ++ src2obj $ngx_src; ngx_obj=$res + + cat << END >> $NGX_MAKEFILE + +@@ -387,12 +447,8 @@ if test -n "$MISC_SRCS"; then + + for ngx_src in $MISC_SRCS + do +- ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"` +- ngx_obj=`echo $ngx_src \ +- | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \ +- -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \ +- -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \ +- -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"` ++ dirsep $ngx_src; ngx_src=$res ++ src2obj $ngx_src; ngx_obj=$res + + cat << END >> $NGX_MAKEFILE + +@@ -415,16 +471,9 @@ if test -n "$NGX_ADDON_SRCS"; then + do + ngx_obj="addon/`basename \`dirname $ngx_src\``" + +- ngx_obj=`echo $ngx_obj/\`basename $ngx_src\` \ +- | sed -e "s/\//$ngx_regex_dirsep/g"` +- +- ngx_obj=`echo $ngx_obj \ +- | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \ +- -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \ +- -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \ +- -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"` +- +- ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"` ++ dirsep $ngx_obj/`basename $ngx_src`; ngx_obj=$res ++ src2obj $ngx_obj; ngx_obj=$res ++ dirsep $ngx_src; ngx_src=$res + + cat << END >> $NGX_MAKEFILE + +@@ -454,9 +503,8 @@ fi + + if test -n "$NGX_RES"; then + +- ngx_res=`echo "$NGX_RES: $NGX_RC $NGX_ICONS" \ +- | sed -e "s/\//$ngx_regex_dirsep/g"` +- ngx_rcc=`echo $NGX_RCC | sed -e "s/\//$ngx_regex_dirsep/g"` ++ dirsep "$NGX_RES: $NGX_RC $NGX_ICONS"; ngx_res=$res ++ dirsep $NGX_RCC; ngx_rcc=$res + + cat << END >> $NGX_MAKEFILE + +@@ -474,11 +522,12 @@ if test -n "$NGX_PCH"; then + echo "#include " > $NGX_OBJS/ngx_pch.c + + ngx_pch="src/core/ngx_config.h $OS_CONFIG $NGX_OBJS/ngx_auto_config.h" +- ngx_pch=`echo "$NGX_PCH: $ngx_pch" | sed -e "s/\//$ngx_regex_dirsep/g"` ++ dirsep "$NGX_PCH: $ngx_pch" ++ ngx_pch=$res + + ngx_src="\$(CC) \$(CFLAGS) $NGX_BUILD_PCH $ngx_compile_opt \$(ALL_INCS)" + ngx_src="$ngx_src $ngx_objout$NGX_OBJS/ngx_pch.obj $NGX_OBJS/ngx_pch.c" +- ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"` ++ dirsep $ngx_src; ngx_src=$res + + cat << END >> $NGX_MAKEFILE + +@@ -563,10 +612,9 @@ END + + END + +- ngx_modules_c=`echo $ngx_modules_c | sed -e "s/\//$ngx_regex_dirsep/g"` ++ dirsep $ngx_modules_c; ngx_modules_c=$res + +- ngx_modules_obj=`echo $ngx_modules_c \ +- | sed -e "s/\(.*\.\)c/\1$ngx_objext/"` ++ ngx_modules_obj=${ngx_modules_c%.c}.$ngx_objext + + ngx_module_objs= + for ngx_src in $ngx_module_srcs $ngx_module_shrd +@@ -585,19 +633,14 @@ END + ngx_module_objs="$ngx_module_objs $ngx_obj" + done + +- ngx_module_objs=`echo $ngx_module_objs \ +- | sed -e "s#\([^ ]*\.\)cpp#$NGX_OBJS\/\1$ngx_objext#g" \ +- -e "s#\([^ ]*\.\)cc#$NGX_OBJS\/\1$ngx_objext#g" \ +- -e "s#\([^ ]*\.\)c#$NGX_OBJS\/\1$ngx_objext#g" \ +- -e "s#\([^ ]*\.\)S#$NGX_OBJS\/\1$ngx_objext#g"` ++ srcs2objs $ngx_module_objs ++ ngx_module_objs=$res + +- ngx_deps=`echo $ngx_module_objs $ngx_modules_obj $LINK_DEPS \ +- | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \ +- -e "s/\//$ngx_regex_dirsep/g"` ++ fmt_deps $ngx_module_objs $ngx_modules_obj $LINK_DEPS ++ ngx_deps=$res + +- ngx_objs=`echo $ngx_module_objs $ngx_modules_obj \ +- | sed -e "s/ *\([^ ][^ ]*\)/$ngx_long_regex_cont\1/g" \ +- -e "s/\//$ngx_regex_dirsep/g"` ++ fmt_objs $ngx_module_objs $ngx_modules_obj ++ ngx_objs=$res + + ngx_obj=$NGX_OBJS$ngx_dirsep$ngx_module$ngx_modext + +@@ -607,15 +650,15 @@ END + + ngx_libs= + if test -n "$NGX_LD_OPT$ngx_module_libs"; then +- ngx_libs=`echo $NGX_LD_OPT $ngx_module_libs \ +- | sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"` ++ fmt_link $NGX_LD_OPT $ngx_module_libs ++ ngx_libs=$res + fi + +- ngx_link=${CORE_LINK:+`echo $CORE_LINK \ +- | sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"`} ++ fmt_link $CORE_LINK ++ ngx_link=${CORE_LINK:+$res} + +- ngx_module_link=${MODULE_LINK:+`echo $MODULE_LINK \ +- | sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"`} ++ fmt_link $MODULE_LINK ++ ngx_module_link=${MODULE_LINK:+$res} + + + cat << END >> $NGX_MAKEFILE +@@ -635,22 +678,16 @@ END + do + case "$ngx_source" in + src/*) +- ngx_obj=`echo $ngx_source | sed -e "s/\//$ngx_regex_dirsep/g"` ++ dirsep $ngx_source; ngx_obj=$res + ;; + *) + ngx_obj="addon/`basename \`dirname $ngx_source\``" +- ngx_obj=`echo $ngx_obj/\`basename $ngx_source\` \ +- | sed -e "s/\//$ngx_regex_dirsep/g"` ++ dirsep $ngx_obj/`basename $ngx_source`; ngx_obj=$res + ;; + esac + +- ngx_obj=`echo $ngx_obj \ +- | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \ +- -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \ +- -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \ +- -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"` +- +- ngx_src=`echo $ngx_source | sed -e "s/\//$ngx_regex_dirsep/g"` ++ src2obj $ngx_obj; ngx_obj=$res ++ dirsep $ngx_source; ngx_src=$res + + if [ $ngx_source = src/http/modules/perl/ngx_http_perl_module.c ]; then + +diff --git a/auto/options b/auto/options +--- a/auto/options ++++ b/auto/options +@@ -18,6 +18,8 @@ NGX_USER= + NGX_GROUP= + NGX_BUILD= + ++NGX_FEATURE_CACHE=NO ++ + CC=${CC:-cc} + CPP= + NGX_OBJS=objs +@@ -229,6 +231,9 @@ do + --user=*) NGX_USER="$value" ;; + --group=*) NGX_GROUP="$value" ;; + ++ --feature-cache) NGX_FEATURE_CACHE=YES ;; ++ --feature-cache=*) NGX_FEATURE_CACHE=$value ;; ++ + --crossbuild=*) NGX_PLATFORM="$value" ;; + + --build=*) NGX_BUILD="$value" ;; +@@ -494,6 +499,9 @@ cat << END + --group=GROUP set non-privileged group for + worker processes + ++ --feature-cache enable configure feature cache ++ --feature-cache=path use configure feature cache at given path ++ + --build=NAME set build name + --builddir=DIR set build directory + +diff --git a/auto/os/freebsd b/auto/os/freebsd +--- a/auto/os/freebsd ++++ b/auto/os/freebsd +@@ -1,4 +1,5 @@ + ++# Copyright (C) 2024 Web Server LLC + # Copyright (C) Igor Sysoev + # Copyright (C) Nginx, Inc. + +@@ -12,17 +13,7 @@ CORE_SRCS="$UNIX_SRCS $FREEBSD_SRCS" + ngx_spacer=' + ' + +- +-# __FreeBSD_version and sysctl kern.osreldate are the best ways +-# to determine whether some capability exists and is safe to use. +-# __FreeBSD_version is used for the testing of the build environment. +-# sysctl kern.osreldate is used for the testing of the kernel capabilities. +- +-version=`grep "#define __FreeBSD_version" /usr/include/osreldate.h \ +- | sed -e 's/^.* \(.*\)$/\1/'` +- +-osreldate=`/sbin/sysctl -n kern.osreldate` +- ++. auto/os/freebsd.version + + # setproctitle() in libutil + +diff --git a/auto/os/freebsd.version b/auto/os/freebsd.version +new file mode 100644 +--- /dev/null ++++ b/auto/os/freebsd.version +@@ -0,0 +1,31 @@ ++ ++# Copyright (C) 2024 Web Server LLC ++# Copyright (C) Igor Sysoev ++# Copyright (C) Nginx, Inc. ++ ++ ++if check_cache "freebsd version" "os"; then ++ return ++fi ++ ++# __FreeBSD_version and sysctl kern.osreldate are the best ways ++# to determine whether some capability exists and is safe to use. ++# __FreeBSD_version is used for the testing of the build environment. ++# sysctl kern.osreldate is used for the testing of the kernel capabilities. ++ ++version=`grep "#define __FreeBSD_version" /usr/include/osreldate.h \ ++ | sed -e 's/^.* \(.*\)$/\1/'` ++ ++osreldate=`/sbin/sysctl -n kern.osreldate` ++ ++if [ $NGX_FEATURE_CACHE = NO ]; then ++ return ++fi ++ ++cache_output_start ++ ++echo "ngx_found=yes" ++echo "version=\"$version\"" ++echo "osreldate=\"$osreldate\"" ++ ++cache_output_end +diff --git a/auto/os/linux b/auto/os/linux +--- a/auto/os/linux ++++ b/auto/os/linux +@@ -1,4 +1,5 @@ + ++# Copyright (C) 2024 Web Server LLC + # Copyright (C) Igor Sysoev + # Copyright (C) Nginx, Inc. + +@@ -15,16 +16,7 @@ ngx_spacer=' + cc_aux_flags="$CC_AUX_FLAGS" + CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64" + +- +-# Linux kernel version +- +-version=$((`uname -r \ +- | sed -n -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/ \ +- \1*256*256+\2*256+\3/p' \ +- -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1*256*256+\2*256/p'`)) +- +-version=${version:-0} +- ++. auto/os/linux.kernel_version + + # posix_fadvise64() had been implemented in 2.5.60 + +diff --git a/auto/os/linux.kernel_version b/auto/os/linux.kernel_version +new file mode 100644 +--- /dev/null ++++ b/auto/os/linux.kernel_version +@@ -0,0 +1,29 @@ ++ ++# Copyright (C) 2024 Web Server LLC ++# Copyright (C) Igor Sysoev ++# Copyright (C) Nginx, Inc. ++ ++ ++if check_cache "kernel version" "os"; then ++ return ++fi ++ ++# Linux kernel version ++ ++version=$((`uname -r \ ++ | sed -n -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/ \ ++ \1*256*256+\2*256+\3/p' \ ++ -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1*256*256+\2*256/p'`)) ++ ++version=${version:-0} ++ ++if [ $NGX_FEATURE_CACHE = NO ]; then ++ return ++fi ++ ++cache_output_start ++ ++echo "ngx_found=yes" ++echo "version=\"$version\"" ++ ++cache_output_end +diff --git a/auto/platform b/auto/platform +new file mode 100644 +--- /dev/null ++++ b/auto/platform +@@ -0,0 +1,39 @@ ++ ++# Copyright (C) 2024 Web Server LLC ++# Copyright (C) Igor Sysoev ++# Copyright (C) Nginx, Inc. ++ ++ ++if check_cache "OS info" "os"; then ++ return ++fi ++ ++echo "checking for OS" ++ ++NGX_SYSTEM=`uname -s 2>/dev/null` ++NGX_RELEASE=`uname -r 2>/dev/null` ++NGX_MACHINE=`uname -m 2>/dev/null` ++ ++echo " + $NGX_SYSTEM $NGX_RELEASE $NGX_MACHINE" ++ ++NGX_PLATFORM="$NGX_SYSTEM:$NGX_RELEASE:$NGX_MACHINE"; ++ ++case "$NGX_SYSTEM" in ++ MINGW32_* | MINGW64_* | MSYS_*) ++ NGX_PLATFORM=win32 ++ ;; ++esac ++ ++if [ $NGX_FEATURE_CACHE = NO ]; then ++ return ++fi ++ ++cache_output_start ++ ++echo "ngx_found=yes" ++echo "NGX_SYSTEM=\"$NGX_SYSTEM\"" ++echo "NGX_RELEASE=\"$NGX_RELEASE\"" ++echo "NGX_MACHINE=\"$NGX_MACHINE\"" ++echo "NGX_PLATFORM=\"$NGX_PLATFORM\"" ++ ++cache_output_end +diff --git a/auto/types/sizeof b/auto/types/sizeof +--- a/auto/types/sizeof ++++ b/auto/types/sizeof +@@ -1,8 +1,13 @@ + ++# Copyright (C) 2024 Web Server LLC + # Copyright (C) Igor Sysoev + # Copyright (C) Nginx, Inc. + + ++if check_cache "$ngx_type" "sizeof"; then ++ return ++fi ++ + echo $ngx_n "checking for $ngx_type size ...$ngx_c" + + cat << END >> $NGX_AUTOCONF_ERR +@@ -33,8 +38,10 @@ int main(void) { + END + + +-ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \ +- -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs" ++ngx_test="($CC -c $CC_TEST_FLAGS $CC_AUX_FLAGS \ ++ -o $NGX_AUTOTEST.o $NGX_AUTOTEST.c && \ ++ $CC $CC_TEST_FLAGS $CC_AUX_FLAGS \ ++ -o $NGX_AUTOTEST $NGX_AUTOTEST.o $NGX_LD_OPT $ngx_feature_libs)" + + eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1" + +@@ -74,3 +81,16 @@ esac + + rm -rf $NGX_AUTOTEST* + ++ ++if [ $NGX_FEATURE_CACHE = NO ]; then ++ return ++fi ++ ++cache_output_start ++ ++echo "ngx_found=yes" ++echo "ngx_size=$ngx_size" ++echo "ngx_max_value=$ngx_max_value" ++echo "ngx_max_len='$ngx_max_len'" ++ ++cache_output_end +diff --git a/auto/types/typedef b/auto/types/typedef +--- a/auto/types/typedef ++++ b/auto/types/typedef +@@ -1,8 +1,13 @@ + ++# Copyright (C) 2024 Web Server LLC + # Copyright (C) Igor Sysoev + # Copyright (C) Nginx, Inc. + + ++if check_cache "$ngx_type" "typedef"; then ++ return ++fi ++ + echo $ngx_n "checking for $ngx_type ...$ngx_c" + + cat << END >> $NGX_AUTOCONF_ERR +@@ -34,8 +39,10 @@ int main(void) { + + END + +- ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \ +- -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs" ++ ngx_test="($CC -c $CC_TEST_FLAGS $CC_AUX_FLAGS \ ++ -o $NGX_AUTOTEST.o $NGX_AUTOTEST.c && \ ++ $CC $CC_TEST_FLAGS $CC_AUX_FLAGS \ ++ -o $NGX_AUTOTEST $NGX_AUTOTEST.o $NGX_LD_OPT $ngx_feature_libs)" + + eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1" + +@@ -80,3 +87,17 @@ fi + if [ $ngx_found != yes ]; then + echo "typedef $ngx_found $ngx_type;" >> $NGX_AUTO_CONFIG_H + fi ++ ++if [ $NGX_FEATURE_CACHE = NO ]; then ++ return ++fi ++ ++cache_output_start ++ ++echo "ngx_found=yes" ++ ++if [ $ngx_found != yes ]; then ++ echo "echo \"typedef $ngx_found $ngx_type;\" >> \$NGX_AUTO_CONFIG_H" ++fi ++ ++cache_output_end +diff --git a/auto/types/uintptr_t b/auto/types/uintptr_t +--- a/auto/types/uintptr_t ++++ b/auto/types/uintptr_t +@@ -1,8 +1,13 @@ + ++# Copyright (C) 2024 Web Server LLC + # Copyright (C) Igor Sysoev + # Copyright (C) Nginx, Inc. + + ++if check_cache "uintptr_t type" "uintptr_t"; then ++ return ++fi ++ + echo $ngx_n "checking for uintptr_t ...$ngx_c" + + cat << END >> $NGX_AUTOCONF_ERR +@@ -26,8 +31,10 @@ int main(void) { + + END + +-ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \ +- -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT" ++ngx_test="($CC -c $CC_TEST_FLAGS $CC_AUX_FLAGS \ ++ -o $NGX_AUTOTEST.o $NGX_AUTOTEST.c && \ ++ $CC $CC_TEST_FLAGS $CC_AUX_FLAGS \ ++ -o $NGX_AUTOTEST $NGX_AUTOTEST.o $NGX_LD_OPT)" + + eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1" + +@@ -48,3 +55,23 @@ if [ $found = no ]; then + echo "typedef $found uintptr_t;" >> $NGX_AUTO_CONFIG_H + echo "typedef $found intptr_t;" | sed -e 's/u//g' >> $NGX_AUTO_CONFIG_H + fi ++ ++if [ $NGX_FEATURE_CACHE = NO ]; then ++ return ++fi ++ ++cache_output_start ++ ++echo "ngx_found=yes" ++ ++if [ $found = yes ]; then ++ cache_output_end ++ return ++fi ++ ++sfound=$(echo $found | sed -e 's/u//g') ++ ++echo "echo \"typedef $found uintptr_t;\" >> \$NGX_AUTO_CONFIG_H" ++echo "echo \"typedef $sfound intptr_t;\" >> \$NGX_AUTO_CONFIG_H" ++ ++cache_output_end +diff --git a/auto/unix b/auto/unix +--- a/auto/unix ++++ b/auto/unix +@@ -1,4 +1,5 @@ + ++# Copyright (C) 2024 Web Server LLC + # Copyright (C) Igor Sysoev + # Copyright (C) Nginx, Inc. + +@@ -6,24 +7,7 @@ + NGX_USER=${NGX_USER:-nobody} + + if [ -z "$NGX_GROUP" ]; then +- if [ $NGX_USER = nobody ]; then +- if grep nobody /etc/group 2>&1 >/dev/null; then +- echo "checking for nobody group ... found" +- NGX_GROUP=nobody +- else +- echo "checking for nobody group ... not found" +- +- if grep nogroup /etc/group 2>&1 >/dev/null; then +- echo "checking for nogroup group ... found" +- NGX_GROUP=nogroup +- else +- echo "checking for nogroup group ... not found" +- NGX_GROUP=nobody +- fi +- fi +- else +- NGX_GROUP=$NGX_USER +- fi ++ . auto/unix.group + fi + + +diff --git a/auto/unix.group b/auto/unix.group +new file mode 100644 +--- /dev/null ++++ b/auto/unix.group +@@ -0,0 +1,39 @@ ++ ++# Copyright (C) 2024 Web Server LLC ++# Copyright (C) Igor Sysoev ++# Copyright (C) Nginx, Inc. ++ ++ ++if check_cache "unix group" "os"; then ++ return ++fi ++ ++if [ $NGX_USER = nobody ]; then ++ if grep nobody /etc/group 2>&1 >/dev/null; then ++ echo "checking for nobody group ... found" ++ NGX_GROUP=nobody ++ else ++ echo "checking for nobody group ... not found" ++ ++ if grep nogroup /etc/group 2>&1 >/dev/null; then ++ echo "checking for nogroup group ... found" ++ NGX_GROUP=nogroup ++ else ++ echo "checking for nogroup group ... not found" ++ NGX_GROUP=nobody ++ fi ++ fi ++else ++ NGX_GROUP=$NGX_USER ++fi ++ ++if [ $NGX_FEATURE_CACHE = NO ]; then ++ return ++fi ++ ++cache_output_start ++ ++echo "ngx_found=yes" ++echo "NGX_GROUP=$NGX_GROUP" ++ ++cache_output_end +diff --git a/auto/utils b/auto/utils +new file mode 100644 +--- /dev/null ++++ b/auto/utils +@@ -0,0 +1,33 @@ ++ ++# Copyright (C) 2024 Web Server LLC ++ ++ ++name2macro() ++{ ++ case "$1" in ++ *[a-z/.]*) ++ ;; ++ *) ++ res=$1 ++ return ++ ;; ++ esac ++ ++ OPTIND=1 ++ res= ++ ++ while getopts ":" opt "-$1"; do ++ r= ++ case "$OPTARG" in ++ "a") r="A" ;; "b") r="B" ;; "c") r="C" ;; "d") r="D" ;; ++ "e") r="E" ;; "f") r="F" ;; "g") r="G" ;; "h") r="H" ;; ++ "i") r="I" ;; "j") r="J" ;; "k") r="K" ;; "l") r="L" ;; ++ "m") r="M" ;; "n") r="N" ;; "o") r="O" ;; "p") r="P" ;; ++ "q") r="Q" ;; "r") r="R" ;; "s") r="S" ;; "t") r="T" ;; ++ "u") r="U" ;; "v") r="V" ;; "w") r="W" ;; "x") r="X" ;; ++ "y") r="Y" ;; "z") r="Z" ;; "/") r="_" ;; ".") r="_" ;; ++ *) r="${OPTARG}" ;; ++ esac ++ res="$res$r" ++ done ++} +diff --git a/configure b/configure +--- a/configure ++++ b/configure +@@ -10,6 +10,8 @@ export LC_ALL + + . auto/options + . auto/init ++. auto/utils ++. auto/cache + . auto/sources + + test -d $NGX_OBJS || mkdir -p $NGX_OBJS +@@ -26,21 +28,7 @@ fi + + + if test -z "$NGX_PLATFORM"; then +- echo "checking for OS" +- +- NGX_SYSTEM=`uname -s 2>/dev/null` +- NGX_RELEASE=`uname -r 2>/dev/null` +- NGX_MACHINE=`uname -m 2>/dev/null` +- +- echo " + $NGX_SYSTEM $NGX_RELEASE $NGX_MACHINE" +- +- NGX_PLATFORM="$NGX_SYSTEM:$NGX_RELEASE:$NGX_MACHINE"; +- +- case "$NGX_SYSTEM" in +- MINGW32_* | MINGW64_* | MSYS_*) +- NGX_PLATFORM=win32 +- ;; +- esac ++ . auto/platform + + else + echo "building for $NGX_PLATFORM" diff --git a/SOURCES/dd-opentracing-cpp-cmakelists.patch b/SOURCES/dd-opentracing-cpp-cmakelists.patch new file mode 100644 index 0000000..ce98866 --- /dev/null +++ b/SOURCES/dd-opentracing-cpp-cmakelists.patch @@ -0,0 +1,24 @@ +--- CMakeLists.txt.orig ++++ CMakeLists.txt +@@ -27,10 +27,6 @@ + endif() + set(CMAKE_CXX_STANDARD 14) + +-# Includes +-include_directories(SYSTEM 3rd_party/include deps/include) +-include_directories(include) +- + # Libraries + set(CMAKE_LIBRARY_PATH deps/lib) + +@@ -40,6 +36,10 @@ + find_library(MSGPACK_LIB msgpack) + find_package(CURL) + find_package(Threads REQUIRED) ++ ++# Includes ++include_directories(SYSTEM ${OPENTRACING_INCLUDE_DIR} 3rd_party/include deps/include) ++include_directories(include) + + # Code Sanitizers + set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/3rd_party/sanitizers-cmake" ${CMAKE_MODULE_PATH}) diff --git a/SOURCES/default.conf b/SOURCES/default.conf new file mode 100644 index 0000000..204f06a --- /dev/null +++ b/SOURCES/default.conf @@ -0,0 +1,50 @@ +server { + listen 80; + server_name localhost; + + #access_log /var/log/angie/host.access.log main; + + location / { + root /usr/share/angie/html; + index index.html index.htm; + } + + location /status/ { + api /status/; + allow 127.0.0.1; + deny all; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/angie/html; + } + + # proxy the PHP scripts to Apache listening on 127.0.0.1:80 + # + #location ~ \.php$ { + # proxy_pass http://127.0.0.1; + #} + + # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 + # + #location ~ \.php$ { + # root html; + # fastcgi_pass 127.0.0.1:9000; + # fastcgi_index index.php; + # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; + # include fastcgi_params; + #} + + # deny access to .htaccess files, if Apache's document root + # concurs with angie's one + # + #location ~ /\.ht { + # deny all; + #} +} + diff --git a/SOURCES/example.conf b/SOURCES/example.conf new file mode 100644 index 0000000..b4beadd --- /dev/null +++ b/SOURCES/example.conf @@ -0,0 +1,24 @@ +#upstream stream_backend { +# server backend1.example.com:12345 weight=5; +# server backend2.example.com:12345 max_fails=2 fail_timeout=30s; +# server backend3.example.com:12345 max_conns=3; +#} +# +#upstream dns_servers { +# least_conn; +# server 192.168.136.130:53; +# server 192.168.136.131:53; +# server 192.168.136.132:53; +#} +# +#server { +# listen 12345; +# proxy_pass stream_backend; +# proxy_timeout 3s; +# proxy_connect_timeout 1s; +#} +# +#server { +# listen 53 udp; +# proxy_pass dns_servers; +#} diff --git a/SOURCES/libinjection-version.patch b/SOURCES/libinjection-version.patch new file mode 100644 index 0000000..462fe09 --- /dev/null +++ b/SOURCES/libinjection-version.patch @@ -0,0 +1,14 @@ +--- src/libinjection_sqli.c.orig ++++ src/libinjection_sqli.c +@@ -18,10 +18,7 @@ + #include "libinjection_sqli.h" + #include "libinjection_sqli_data.h" + +-#ifdef __clang_analyzer__ +-// make clang analyzer happy by defining a dummy version +-#define LIBINJECTION_VERSION "undefined" +-#endif ++#define LIBINJECTION_VERSION "b9fcaaf9e50e9492807b23ffcc6af46ee1f203b9" + + #define LIBINJECTION_SQLI_TOKEN_SIZE sizeof(((stoken_t*)(0))->val) + #define LIBINJECTION_SQLI_MAX_TOKENS 5 diff --git a/SOURCES/lua-cjson.patch b/SOURCES/lua-cjson.patch new file mode 100644 index 0000000..7bb6539 --- /dev/null +++ b/SOURCES/lua-cjson.patch @@ -0,0 +1,29 @@ +--- lua_cjson.c ++++ lua_cjson.c +@@ -1290,26 +1290,6 @@ + + /* ===== INITIALISATION ===== */ + +-#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 +-/* Compatibility for Lua 5.1. +- * +- * luaL_setfuncs() is used to create a module table where the functions have +- * json_config_t as their first upvalue. Code borrowed from Lua 5.2 source. */ +-static void luaL_setfuncs (lua_State *l, const luaL_Reg *reg, int nup) +-{ +- int i; +- +- luaL_checkstack(l, nup, "too many upvalues"); +- for (; reg->name != NULL; reg++) { /* fill the table with given functions */ +- for (i = 0; i < nup; i++) /* copy upvalues to the top */ +- lua_pushvalue(l, -nup); +- lua_pushcclosure(l, reg->func, nup); /* closure with those upvalues */ +- lua_setfield(l, -(nup + 2), reg->name); +- } +- lua_pop(l, nup); /* remove upvalues */ +-} +-#endif +- + /* Call target function in protected mode with all supplied args. + * Assumes target function only returns a single non-nil value. + * Convert and return thrown errors as: nil, "error message" */ diff --git a/SOURCES/lua-config.patch b/SOURCES/lua-config.patch new file mode 100644 index 0000000..066347c --- /dev/null +++ b/SOURCES/lua-config.patch @@ -0,0 +1,26 @@ +--- config.orig ++++ config +@@ -45,9 +45,9 @@ + NGX_TEST_LD_OPT="$ngx_lua_opt_L $NGX_TEST_LD_OPT" + + if [ $NGX_RPATH = YES ]; then +- ngx_feature_libs="-R$LUAJIT_LIB $ngx_lua_opt_L -lluajit-5.1 $luajit_ld_opt" ++ ngx_feature_libs="-R$LUAJIT_LIB $ngx_lua_opt_L -l:libluajit-5.1.a $luajit_ld_opt" + else +- ngx_feature_libs="$ngx_lua_opt_L -lluajit-5.1 $luajit_ld_opt" ++ ngx_feature_libs="$ngx_lua_opt_L -l:libluajit-5.1.a $luajit_ld_opt" + fi + + . auto/feature +@@ -71,9 +71,9 @@ + NGX_TEST_LD_OPT="$ngx_lua_opt_L $NGX_TEST_LD_OPT" + + if [ $NGX_RPATH = YES ]; then +- ngx_feature_libs="-R$LUAJIT_LIB $ngx_lua_opt_L -lluajit-5.1 $luajit_ld_opt" ++ ngx_feature_libs="-R$LUAJIT_LIB $ngx_lua_opt_L -l:libluajit-5.1.a $luajit_ld_opt" + else +- ngx_feature_libs="$ngx_lua_opt_L -lluajit-5.1 $luajit_ld_opt" ++ ngx_feature_libs="$ngx_lua_opt_L -l:libluajit-5.1.a $luajit_ld_opt" + fi + + . auto/feature diff --git a/SOURCES/luajit2-Makefile.patch b/SOURCES/luajit2-Makefile.patch new file mode 100644 index 0000000..a2da949 --- /dev/null +++ b/SOURCES/luajit2-Makefile.patch @@ -0,0 +1,11 @@ +--- Makefile.orig ++++ Makefile +@@ -25,7 +25,7 @@ + # Change the installation path as needed. This automatically adjusts + # the paths in src/luaconf.h, too. Note: PREFIX must be an absolute path! + # +-export PREFIX= /usr/local ++export PREFIX= /usr + export MULTILIB= lib + ############################################################################## + diff --git a/SOURCES/luajit2-luaconf.h.patch b/SOURCES/luajit2-luaconf.h.patch new file mode 100644 index 0000000..af56eee --- /dev/null +++ b/SOURCES/luajit2-luaconf.h.patch @@ -0,0 +1,13 @@ +--- src/luaconf.h.orig ++++ src/luaconf.h +@@ -58,8 +58,8 @@ + #define LUA_LCPATH1 ";" LUA_LCDIR "?.so" + #define LUA_LCPATH2 ";" LUA_LCDIR "loadall.so" + +-#define LUA_PATH_DEFAULT "./?.lua" LUA_JPATH LUA_LLPATH LUA_RLPATH +-#define LUA_CPATH_DEFAULT "./?.so" LUA_LCPATH1 LUA_RCPATH LUA_LCPATH2 ++#define LUA_PATH_DEFAULT "./?.lua" ";/usr/share/angie/luajit/?.lua" ";/usr/share/angie/luajit/?/init.lua" LUA_JPATH LUA_LLPATH LUA_RLPATH ++#define LUA_CPATH_DEFAULT "./?.so" ";/usr/lib64/angie/luajit/?.so" LUA_LCPATH1 LUA_RCPATH LUA_LCPATH2 + #endif + + /* Environment variable names for path overrides and initialization code. */ diff --git a/SOURCES/modsecurity-libmaxminddb.patch b/SOURCES/modsecurity-libmaxminddb.patch new file mode 100644 index 0000000..c946bf1 --- /dev/null +++ b/SOURCES/modsecurity-libmaxminddb.patch @@ -0,0 +1,24 @@ +# see https://github.com/owasp-modsecurity/ModSecurity/issues/2254 +--- src/utils/geo_lookup.h.orig ++++ src/utils/geo_lookup.h +@@ -50,7 +50,7 @@ + void cleanUp(); + + bool lookup(const std::string& target, Transaction *transaction, +- std::function debug) const; ++ std::function debug); + + private: + GeoLookup() : +--- src/utils/geo_lookup.cc.orig ++++ src/utils/geo_lookup.cc +@@ -113,7 +113,7 @@ + + + bool GeoLookup::lookup(const std::string& target, Transaction *trans, +- std::function debug) const { ++ std::function debug) { + + if (m_version == NOT_LOADED) { + if (debug) { + diff --git a/SOURCES/modsecurity-ssdeep.patch b/SOURCES/modsecurity-ssdeep.patch new file mode 100644 index 0000000..e138579 --- /dev/null +++ b/SOURCES/modsecurity-ssdeep.patch @@ -0,0 +1,13 @@ +--- build/ssdeep.m4.orig ++++ build/ssdeep.m4 +@@ -34,6 +34,10 @@ + if test "x${with_ssdeep}" == "xyes"; then + SSDEEP_MANDATORY=yes + AC_MSG_NOTICE([SSDEEP support was marked as mandatory by the utilization of --with-ssdeep=yes]) ++ elif test "x${with_ssdeep}" != "x"; then ++ SSDEEP_MANDATORY=yes ++ SSDEEP_POSSIBLE_PATHS="${with_ssdeep}" ++ AC_MSG_NOTICE([SSDEEP support was marked as mandatory by the utilization of --with-ssdeep=path]) + else + SSDEEP_MANDATORY=no + fi diff --git a/SOURCES/modsecurity.rules.conf b/SOURCES/modsecurity.rules.conf new file mode 100644 index 0000000..ccaf8c3 --- /dev/null +++ b/SOURCES/modsecurity.rules.conf @@ -0,0 +1,18 @@ +Include modsecurity.conf + +# To enable the OWASP CRS, please perform the following steps: +# +# 1. Checkout Core Rule Set from GitHub and create config files as shown below: +# +# cd /var/lib/angie/modsecurity +# sudo git clone -b v3.3.5 -c advice.detachedHead=false https://github.com/coreruleset/coreruleset +# sudo cp coreruleset/crs-setup.conf.example coreruleset/crs-setup.conf +# sudo cp coreruleset/rules/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf.example \ +# coreruleset/rules/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf +# sudo cp coreruleset/rules/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf.example \ +# coreruleset/rules/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf +# +# 2. Uncomment both 'Include' directives below + +#Include /var/lib/angie/modsecurity/coreruleset/crs-setup.conf +#Include /var/lib/angie/modsecurity/coreruleset/rules/*.conf diff --git a/SOURCES/ngx_postgres-default_port.patch b/SOURCES/ngx_postgres-default_port.patch new file mode 100644 index 0000000..fae8f26 --- /dev/null +++ b/SOURCES/ngx_postgres-default_port.patch @@ -0,0 +1,17 @@ +--- src/ngx_postgres_module.c.orig ++++ src/ngx_postgres_module.c +@@ -1320,12 +1320,14 @@ + continue; + } + ++#if (nginx_version < 1011006) + if (uscfp[i]->default_port && url->default_port + && (uscfp[i]->default_port != url->default_port)) + { + dd("default_port doesn't match"); + continue; + } ++#endif + + dd("returning"); + return uscfp[i]; diff --git a/SOURCES/ngx_postgres-dynamic.patch b/SOURCES/ngx_postgres-dynamic.patch new file mode 100644 index 0000000..a34522c --- /dev/null +++ b/SOURCES/ngx_postgres-dynamic.patch @@ -0,0 +1,26 @@ +--- config.orig ++++ config +@@ -205,6 +205,16 @@ + + ngx_addon_name=ngx_postgres + ++if [ -f auto/module ] ; then ++ ngx_module_type=HTTP ++ ngx_module_name=ngx_postgres_module ++ ngx_module_incs=$ngx_feature_path ++ ngx_module_libs=$ngx_feature_libs ++ ngx_module_srcs="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_postgres_escape.c $ngx_addon_dir/src/ngx_postgres_handler.c $ngx_addon_dir/src/ngx_postgres_keepalive.c $ngx_addon_dir/src/ngx_postgres_module.c $ngx_addon_dir/src/ngx_postgres_output.c $ngx_addon_dir/src/ngx_postgres_processor.c $ngx_addon_dir/src/ngx_postgres_rewrite.c $ngx_addon_dir/src/ngx_postgres_upstream.c $ngx_addon_dir/src/ngx_postgres_util.c $ngx_addon_dir/src/ngx_postgres_variable.c" ++ . auto/module ++ ++else ++ + HTTP_MODULES="$HTTP_MODULES ngx_postgres_module" + + CORE_INCS="$CORE_INCS $ngx_feature_path" +@@ -213,4 +223,6 @@ + NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_postgres_escape.c $ngx_addon_dir/src/ngx_postgres_handler.c $ngx_addon_dir/src/ngx_postgres_keepalive.c $ngx_addon_dir/src/ngx_postgres_module.c $ngx_addon_dir/src/ngx_postgres_output.c $ngx_addon_dir/src/ngx_postgres_processor.c $ngx_addon_dir/src/ngx_postgres_rewrite.c $ngx_addon_dir/src/ngx_postgres_upstream.c $ngx_addon_dir/src/ngx_postgres_util.c $ngx_addon_dir/src/ngx_postgres_variable.c" + NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/ngx_postgres_escape.h $ngx_addon_dir/src/ngx_postgres_handler.h $ngx_addon_dir/src/ngx_postgres_keepalive.h $ngx_addon_dir/src/ngx_postgres_module.h $ngx_addon_dir/src/ngx_postgres_output.h $ngx_addon_dir/src/ngx_postgres_processor.h $ngx_addon_dir/src/ngx_postgres_rewrite.h $ngx_addon_dir/src/ngx_postgres_upstream.h $ngx_addon_dir/src/ngx_postgres_util.h $ngx_addon_dir/src/ngx_postgres_variable.h $ngx_addon_dir/src/ngx_postgres_ddebug.h $ngx_addon_dir/src/resty_dbd_stream.h" + ++fi ++ + have=NGX_POSTGRES_MODULE . auto/have diff --git a/SOURCES/ngx_postgres-subrequest_in_memory.patch b/SOURCES/ngx_postgres-subrequest_in_memory.patch new file mode 100644 index 0000000..620d659 --- /dev/null +++ b/SOURCES/ngx_postgres-subrequest_in_memory.patch @@ -0,0 +1,18 @@ +--- src/ngx_postgres_handler.c.orig ++++ src/ngx_postgres_handler.c +@@ -52,6 +52,7 @@ + + dd("entering"); + ++#if defined(nginx_version) && (nginx_version < 13010) + if (r->subrequest_in_memory) { + /* TODO: add support for subrequest in memory by + * emitting output into u->buffer instead */ +@@ -63,6 +64,7 @@ + dd("returning NGX_HTTP_INTERNAL_SERVER_ERROR"); + return NGX_HTTP_INTERNAL_SERVER_ERROR; + } ++#endif + + pglcf = ngx_http_get_module_loc_conf(r, ngx_postgres_module); + diff --git a/SOURCES/opentracing-cpp-fix-ftbfs-glibc-2.34.patch b/SOURCES/opentracing-cpp-fix-ftbfs-glibc-2.34.patch new file mode 100644 index 0000000..9279afa --- /dev/null +++ b/SOURCES/opentracing-cpp-fix-ftbfs-glibc-2.34.patch @@ -0,0 +1,42 @@ +Author: Sergio Durigan Junior +Forwarded: yes, https://github.com/opentracing/opentracing-cpp/pull/142 +Last-Update: 2021-11-19 + +Index: opentracing-cpp-1.6.0/3rd_party/include/opentracing/catch2/catch.hpp +=================================================================== +--- 3rd_party/include/opentracing/catch2/catch.hpp.orig 2021-11-19 20:01:32.336577631 -0500 ++++ 3rd_party/include/opentracing/catch2/catch.hpp 2021-11-19 20:12:17.853232501 -0500 +@@ -6462,7 +6462,7 @@ + static bool isSet; + static struct sigaction oldSigActions[];// [sizeof(signalDefs) / sizeof(SignalDefs)]; + static stack_t oldSigStack; +- static char altStackMem[]; ++ static char *altStackMem; + + static void handleSignal( int sig ); + +@@ -6594,6 +6594,7 @@ + } + + FatalConditionHandler::FatalConditionHandler() { ++ altStackMem = new(char[SIGSTKSZ]); + isSet = true; + stack_t sigStack; + sigStack.ss_sp = altStackMem; +@@ -6610,6 +6611,7 @@ + } + + FatalConditionHandler::~FatalConditionHandler() { ++ delete[] altStackMem; + reset(); + } + +@@ -6628,7 +6630,7 @@ + bool FatalConditionHandler::isSet = false; + struct sigaction FatalConditionHandler::oldSigActions[sizeof(signalDefs)/sizeof(SignalDefs)] = {}; + stack_t FatalConditionHandler::oldSigStack = {}; +- char FatalConditionHandler::altStackMem[SIGSTKSZ] = {}; ++ char *FatalConditionHandler::altStackMem; + + } // namespace Catch + diff --git a/SOURCES/stream-lua-config.patch b/SOURCES/stream-lua-config.patch new file mode 100644 index 0000000..6178a38 --- /dev/null +++ b/SOURCES/stream-lua-config.patch @@ -0,0 +1,26 @@ +--- config.orig ++++ config +@@ -45,9 +45,9 @@ + NGX_TEST_LD_OPT="$ngx_lua_opt_L $NGX_TEST_LD_OPT" + + if [ $NGX_RPATH = YES ]; then +- ngx_feature_libs="-R$LUAJIT_LIB $ngx_lua_opt_L -lluajit-5.1 $luajit_ld_opt" ++ ngx_feature_libs="-R$LUAJIT_LIB $ngx_lua_opt_L -l:libluajit-5.1.a -lpcre $luajit_ld_opt" + else +- ngx_feature_libs="$ngx_lua_opt_L -lluajit-5.1 $luajit_ld_opt" ++ ngx_feature_libs="$ngx_lua_opt_L -l:libluajit-5.1.a -lpcre $luajit_ld_opt" + fi + + . auto/feature +@@ -71,9 +71,9 @@ + NGX_TEST_LD_OPT="$ngx_lua_opt_L $NGX_TEST_LD_OPT" + + if [ $NGX_RPATH = YES ]; then +- ngx_feature_libs="-R$LUAJIT_LIB $ngx_lua_opt_L -lluajit-5.1 $luajit_ld_opt" ++ ngx_feature_libs="-R$LUAJIT_LIB $ngx_lua_opt_L -l:libluajit-5.1.a -lpcre $luajit_ld_opt" + else +- ngx_feature_libs="$ngx_lua_opt_L -lluajit-5.1 $luajit_ld_opt" ++ ngx_feature_libs="$ngx_lua_opt_L -l:libluajit-5.1.a -lpcre $luajit_ld_opt" + fi + + . auto/feature diff --git a/SOURCES/zstd-nginx-module.nostatic.patch b/SOURCES/zstd-nginx-module.nostatic.patch new file mode 100644 index 0000000..a1e0125 --- /dev/null +++ b/SOURCES/zstd-nginx-module.nostatic.patch @@ -0,0 +1,24 @@ +--- filter/config ++++ filter/config +@@ -60,7 +60,8 @@ + SAVED_NGX_TEST_LD_OPT=$NGX_TEST_LD_OPT + NGX_TEST_LD_OPT="$ngx_zstd_opt_L $NGX_TEST_LD_OPT" + +- . auto/feature ++ #. auto/feature ++ ngx_found=no + + # restore + CC_TEST_FLAGS=$SAVED_CC_TAST_FLAGS +--- static/config ++++ static/config +@@ -60,7 +60,8 @@ + SAVED_NGX_TEST_LD_OPT=$NGX_TEST_LD_OPT + NGX_TEST_LD_OPT="$ngx_zstd_opt_L $NGX_TEST_LD_OPT" + +- . auto/feature ++ #. auto/feature ++ ngx_found=no + + # restore + CC_TEST_FLAGS=$SAVED_CC_TAST_FLAGS diff --git a/SPECS/angie.spec b/SPECS/angie.spec new file mode 100644 index 0000000..c678b20 --- /dev/null +++ b/SPECS/angie.spec @@ -0,0 +1,2406 @@ +Name: angie +Version: 1.6.2 +Release: 1%{?dist} +Summary: Efficient, powerful and scalable reverse proxy and web server +License: BSD-2-Clause +URL: https://angie.software +Source0: https://download.angie.software/files/%{name}-%{version}.tar.gz +Source1: angie.conf +Source2: default.conf +Source3: example.conf +Source4: angie.logrotate +Source5: angie.service +Source6: angie.upgrade +Source30: nginx-auth-jwt-0.7.0.tar.gz +Source39: README-module-auth-jwt +Source74: nginx-auth-ldap-241200eac8e4acae74d353291bd27f79e5ca3dc4.tar.gz +Source73: README-module-auth-ldap +Source7: spnego-http-auth-nginx-module-v1.1.1.tar.gz +Source40: README-module-auth-spnego +Source8: ngx_brotli-v1.0.0rc.tar.gz +Source41: README-module-brotli +Source27: ngx_cache_purge-2.5.3.tar.gz +Source42: README-module-cache-purge +Source9: nginx-dav-ext-module-v3.0.0.tar.gz +Source43: README-module-dav-ext +Source77: ngx_dynamic_limit_req_module-1.9.3.tar.gz +Source78: README-module-dynamic-limit-req +Source28: echo-nginx-module-v0.63.tar.gz +Source44: README-module-echo +Source32: ngx_http_enhanced_memcached_module-v0.3.tar.gz +Source45: README-module-enhanced-memcached +Source31: nginx-eval-module-2016.06.10.tar.gz +Source46: README-module-eval +Source10: ngx_http_geoip2_module-3.4.tar.gz +Source47: README-module-geoip2 +Source11: headers-more-nginx-module-v0.37.tar.gz +Source48: README-module-headers-more +Source49: README-module-image-filter +Source19: nginx-jwt-module-v3.4.1.tar.gz +Source50: README-module-jwt +Source26: nginx-keyval-0.3.0.tar.gz +Source51: README-module-keyval +Source21: lua-resty-core-v0.1.28.tar.gz +Source22: lua-resty-lrucache-v0.13.tar.gz +Source23: luajit2-v2.1-20240626.tar.gz +Source24: lua-nginx-module-v0.10.26.tar.gz +Source25: stream-lua-nginx-module-bea8a0c0de94cede71554f53818ac0267d675d63.tar.gz +Source94: chronos-v0.2-4.tar.gz +Source95: lua-cjson-2.1.0.tar.gz +Source96: lua-dumper-v0.1.1.tar.gz +Source97: inspect.lua-v3.1.3.tar.gz +Source98: lua-resty-hmac-5f60e1a28b9fdd7939f0e1738171f0ca5fe22978.tar.gz +Source99: lua-resty-http-v0.17.2.tar.gz +Source100: lua-resty-jwt-v0.2.3.tar.gz +Source101: lua-resty-openidc-v1.7.6.tar.gz +Source102: lua-resty-openssl-1.4.0.tar.gz +Source103: lua-resty-session-v3.10.tar.gz +Source104: lua-resty-string-v0.15.tar.gz +Source52: README-module-lua +Source67: libinjection-b9fcaaf9e50e9492807b23ffcc6af46ee1f203b9.tar.gz +Source68: ModSecurity-v3.0.12.tar.gz +Source69: ModSecurity-nginx-v1.0.3.tar.gz +Source70: ssdeep-release-2.14.1.tar.gz +Source71: angie-module-modsecurity.logrotate +Source72: modsecurity.rules.conf +Source53: README-module-modsecurity +Source12: ngx_devel_kit-v0.3.3.tar.gz +Source54: README-module-ndk +Source13: njs-0.8.5.tar.gz +Source55: README-module-njs +Source34: dd-opentracing-cpp-v1.3.7.tar.gz +Source35: nginx-opentracing-v0.35.3.tar.gz +Source36: opentracing-cpp-v1.6.0.tar.gz +Source37: zipkin-cpp-opentracing-966416e4d6aec23f572730aede6c087ccce6d194.tar.gz +Source56: README-module-opentracing +Source79: abseil-cpp-20211102.0.tar.gz +Source80: c-ares-cares-1_27_0.tar.gz +Source81: grpc-v1.46.7.tar.gz +Source82: nginx-otel-v0.1.1.tar.gz +Source83: opentelemetry-cpp-v1.11.0.tar.gz +Source84: opentelemetry-proto-v1.0.0.tar.gz +Source85: protobuf-v3.19.5.tar.gz +Source86: re2-2024-03-01.tar.gz +Source87: README-module-otel +Source57: README-module-perl +Source29: ngx_postgres-1.0rc7.tar.gz +Source58: README-module-postgres +Source20: redis2-nginx-module-v0.15.tar.gz +Source59: README-module-redis2 +Source14: nginx-rtmp-module-v1.2.2.tar.gz +Source60: README-module-rtmp +Source15: set-misc-nginx-module-v0.33.tar.gz +Source61: README-module-set-misc +Source16: ngx_http_substitutions_filter_module-e12e965ac1837ca709709f9a26f572a54d83430e.tar.gz +Source62: README-module-subs +Source38: testcookie-nginx-module-64137c2f7e66e8866f56fdecaaf09ac10a034da9.tar.gz +Source63: README-module-testcookie +Source17: nginx-upload-module-2.3.0.tar.gz +Source64: README-module-upload +Source18: nginx-vod-module-1.33.tar.gz +Source65: README-module-vod +Source90: nginx-module-stream-sts-v0.1.1.tar.gz +Source91: nginx-module-sts-v0.1.1.tar.gz +Source92: nginx-module-vts-v0.2.2.tar.gz +Source93: README-module-vts +Source66: README-module-xslt +Source75: mod_zip-1.3.0.tar.gz +Source76: README-module-zip +Source88: zstd-nginx-module-f4ba115e0b0eaecde545e5f37db6aa18917d8f4b.tar.gz +Source89: README-module-zstd + + +Patch0: luajit2-luaconf.h.patch +Patch1: luajit2-Makefile.patch +Patch2: lua-config.patch +Patch3: stream-lua-config.patch +Patch18: lua-cjson.patch +Patch12: libinjection-version.patch +Patch10: modsecurity-ssdeep.patch +Patch11: modsecurity-libmaxminddb.patch +Patch8: dd-opentracing-cpp-cmakelists.patch +Patch9: opentracing-cpp-fix-ftbfs-glibc-2.34.patch +Patch14: abseil-off_t.patch +Patch15: abseil-str_format.patch +Patch4: ngx_postgres-default_port.patch +Patch5: ngx_postgres-dynamic.patch +Patch6: ngx_postgres-subrequest_in_memory.patch + +Patch16: zstd-nginx-module.nostatic.patch +Patch13: configure-accelerator.patch + +BuildRequires: gcc +BuildRequires: make +BuildRequires: openssl-devel +BuildRequires: pcre2-devel +BuildRequires: zlib-devel + +Requires: systemd + +%description +Actively developing fork of nginx aiming to keep it great +with brand new extra functionality. + +%prep +rm -Rf %{_builddir}/* +%setup -q +%patch13 -p1 +tar -xpzf %{_sourcedir}/nginx-auth-jwt-0.7.0.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/nginx-auth-ldap-241200eac8e4acae74d353291bd27f79e5ca3dc4.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/spnego-http-auth-nginx-module-v1.1.1.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/ngx_brotli-v1.0.0rc.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/ngx_cache_purge-2.5.3.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/nginx-dav-ext-module-v3.0.0.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/ngx_dynamic_limit_req_module-1.9.3.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/echo-nginx-module-v0.63.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/ngx_http_enhanced_memcached_module-v0.3.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/nginx-eval-module-2016.06.10.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/ngx_http_geoip2_module-3.4.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/headers-more-nginx-module-v0.37.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/nginx-jwt-module-v3.4.1.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/nginx-keyval-0.3.0.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/chronos-v0.2-4.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/lua-cjson-2.1.0.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/lua-dumper-v0.1.1.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/inspect.lua-v3.1.3.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/lua-resty-core-v0.1.28.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/lua-resty-hmac-5f60e1a28b9fdd7939f0e1738171f0ca5fe22978.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/lua-resty-http-v0.17.2.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/lua-resty-jwt-v0.2.3.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/lua-resty-lrucache-v0.13.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/lua-resty-openidc-v1.7.6.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/lua-resty-openssl-1.4.0.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/lua-resty-session-v3.10.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/lua-resty-string-v0.15.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/luajit2-v2.1-20240626.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/lua-nginx-module-v0.10.26.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/stream-lua-nginx-module-bea8a0c0de94cede71554f53818ac0267d675d63.tar.gz -C %{_builddir} +%patch0 -d %{_builddir}/luajit2-2.1-20240626 -p0 +%patch1 -d %{_builddir}/luajit2-2.1-20240626 -p0 +%patch2 -d %{_builddir}/lua-nginx-module-0.10.26 -p0 +%patch3 -d %{_builddir}/stream-lua-nginx-module-bea8a0c0de94cede71554f53818ac0267d675d63 -p0 +%patch18 -d %{_builddir}/lua-cjson-2.1.0 -p0 +tar -xpzf %{_sourcedir}/ModSecurity-v3.0.12.tar.gz -C %{_builddir} +rmdir %{_builddir}/ModSecurity-3.0.12/others/libinjection +tar -xpzf %{_sourcedir}/libinjection-b9fcaaf9e50e9492807b23ffcc6af46ee1f203b9.tar.gz -C %{_builddir} +%patch12 -d %{_builddir}/libinjection-b9fcaaf9e50e9492807b23ffcc6af46ee1f203b9 -p0 +mv %{_builddir}/libinjection-b9fcaaf9e50e9492807b23ffcc6af46ee1f203b9 %{_builddir}/ModSecurity-3.0.12/others/libinjection +tar -xpzf %{_sourcedir}/ModSecurity-nginx-v1.0.3.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/ssdeep-release-2.14.1.tar.gz -C %{_builddir} +%patch10 -d %{_builddir}/ModSecurity-3.0.12 -p0 +%patch11 -d %{_builddir}/ModSecurity-3.0.12 -p0 +tar -xpzf %{_sourcedir}/ngx_devel_kit-v0.3.3.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/njs-0.8.5.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/dd-opentracing-cpp-v1.3.7.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/nginx-opentracing-v0.35.3.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/opentracing-cpp-v1.6.0.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/zipkin-cpp-opentracing-966416e4d6aec23f572730aede6c087ccce6d194.tar.gz -C %{_builddir} +%patch8 -d %{_builddir}/dd-opentracing-cpp-1.3.7 -p0 +%patch9 -d %{_builddir}/opentracing-cpp-1.6.0 -p0 +tar -xpzf %{_sourcedir}/abseil-cpp-20211102.0.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/c-ares-cares-1_27_0.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/grpc-v1.46.7.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/nginx-otel-v0.1.1.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/opentelemetry-cpp-v1.11.0.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/opentelemetry-proto-v1.0.0.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/protobuf-v3.19.5.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/re2-2024-03-01.tar.gz -C %{_builddir} +%patch14 -d %{_builddir}/abseil-cpp-20211102.0 -p0 +%patch15 -d %{_builddir}/abseil-cpp-20211102.0 -p0 +tar -xpzf %{_sourcedir}/ngx_postgres-1.0rc7.tar.gz -C %{_builddir} +%patch4 -d %{_builddir}/ngx_postgres-1.0rc7 -p0 +%patch5 -d %{_builddir}/ngx_postgres-1.0rc7 -p0 +%patch6 -d %{_builddir}/ngx_postgres-1.0rc7 -p0 +tar -xpzf %{_sourcedir}/redis2-nginx-module-v0.15.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/nginx-rtmp-module-v1.2.2.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/set-misc-nginx-module-v0.33.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/ngx_http_substitutions_filter_module-e12e965ac1837ca709709f9a26f572a54d83430e.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/testcookie-nginx-module-64137c2f7e66e8866f56fdecaaf09ac10a034da9.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/nginx-upload-module-2.3.0.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/nginx-vod-module-1.33.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/nginx-module-stream-sts-v0.1.1.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/nginx-module-sts-v0.1.1.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/nginx-module-vts-v0.2.2.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/mod_zip-1.3.0.tar.gz -C %{_builddir} +tar -xpzf %{_sourcedir}/zstd-nginx-module-f4ba115e0b0eaecde545e5f37db6aa18917d8f4b.tar.gz -C %{_builddir} +%patch16 -d %{_builddir}/zstd-nginx-module-f4ba115e0b0eaecde545e5f37db6aa18917d8f4b -p0 + +cp -Rp %{_builddir}/angie-%{version} %{_builddir}/angie-debug + +%build +set -e +export CFLAGS="$RPM_OPT_FLAGS" + +_build() { + local configure_add configure_env cc_opt ld_opt make_target=modules objs_dir + + local arg; for arg in "$@"; do + case "$arg" in + cc_opt=*) + cc_opt="${arg#cc_opt=}" + ;; + configure_add=*) + configure_add="${arg#configure_add=}" + ;; + configure_env=*) + configure_env=${arg#configure_env=} + ;; + objs_dir=*) + objs_dir="${arg#objs_dir=}" + ;; + ld_opt=*) + ld_opt="${arg#ld_opt=}" + ;; + make_target=*) + make_target=${arg#make_target=} + ;; + esac + done + + local configure_args=" + --prefix=/etc/angie + --conf-path=/etc/angie/angie.conf + --error-log-path=%{_var}/log/angie/error.log + --http-log-path=%{_var}/log/angie/access.log + --lock-path=/run/angie.lock + --modules-path=/usr/lib/angie/modules + --pid-path=/run/angie.pid + --sbin-path=/usr/sbin/angie + --http-acme-client-path=%{_var}/lib/angie/acme + --http-client-body-temp-path=%{_var}/cache/angie/client_temp + --http-fastcgi-temp-path=%{_var}/cache/angie/fastcgi_temp + --http-proxy-temp-path=%{_var}/cache/angie/proxy_temp + --http-scgi-temp-path=%{_var}/cache/angie/scgi_temp + --http-uwsgi-temp-path=%{_var}/cache/angie/uwsgi_temp + --user=angie + --group=angie + --with-file-aio + --with-http_acme_module + --with-http_addition_module + --with-http_auth_request_module + --with-http_dav_module + --with-http_flv_module + --with-http_gunzip_module + --with-http_gzip_static_module + --with-http_mp4_module + --with-http_random_index_module + --with-http_realip_module + --with-http_secure_link_module + --with-http_slice_module + --with-http_ssl_module + --with-http_stub_status_module + --with-http_sub_module + --with-http_v2_module + --with-http_v3_module + --with-mail + --with-mail_ssl_module + --with-stream + --with-stream_mqtt_preread_module + --with-stream_rdp_preread_module + --with-stream_realip_module + --with-stream_ssl_module + --with-stream_ssl_preread_module + --with-threads + $configure_add + --feature-cache=../angie-feature-cache + " + + [ -n "$cc_opt" ] && configure_args="$configure_args --with-cc-opt=\"$cc_opt\"" + + # always prepend LDFLAGS (if set) to --with-ld-opt + if [ -n "$RPM_LD_FLAGS" ]; then + [ -n "$ld_opt" ] && ld_opt="$RPM_LD_FLAGS $ld_opt" || ld_opt="$RPM_LD_FLAGS" + fi + [ -n "$ld_opt" ] && configure_args="$configure_args --with-ld-opt=\"$ld_opt\"" + + ( + [ -f Makefile ] && make clean + eval env $configure_env ./configure $configure_args + [ -n "$objs_dir" ] && mkdir "$objs_dir" + if [ $make_target != none ]; then + make %{?_smp_mflags} $make_target + if [ -n "$objs_dir" ]; then + cp -p objs/*.so "$objs_dir" + fi + fi + ) + + ( + cd ../angie-debug + [ -f Makefile ] && make clean + eval env $configure_env ./configure $configure_args --with-debug + if [ $make_target != none ]; then + make %{?_smp_mflags} $make_target + if [ -n "$objs_dir" ]; then + for so in $(cd objs && ls *.so); do + cp -p objs/$so ../%{name}-%{version}/"$objs_dir"/${so%%.so}-debug.so + done + fi + fi + ) +} + +_build configure_add=--add-dynamic-module=../nginx-auth-jwt-0.7.0 \ + objs_dir=module-auth-jwt +cp %{_sourcedir}/README-module-auth-jwt module-auth-jwt/README +cp ../nginx-auth-jwt-0.7.0/LICENSE module-auth-jwt/LICENSE + +_build configure_add=--add-dynamic-module=../nginx-auth-ldap-241200eac8e4acae74d353291bd27f79e5ca3dc4 \ + objs_dir=module-auth-ldap +cp %{_sourcedir}/README-module-auth-ldap module-auth-ldap/README +cp ../nginx-auth-ldap-241200eac8e4acae74d353291bd27f79e5ca3dc4/LICENSE module-auth-ldap/LICENSE + +_build configure_add=--add-dynamic-module=../spnego-http-auth-nginx-module-1.1.1 \ + objs_dir=module-auth-spnego +cp %{_sourcedir}/README-module-auth-spnego module-auth-spnego/README +cp ../spnego-http-auth-nginx-module-1.1.1/LICENSE module-auth-spnego/LICENSE + +_build configure_add=--add-dynamic-module=../ngx_brotli-1.0.0rc \ + objs_dir=module-brotli +cp %{_sourcedir}/README-module-brotli module-brotli/README +cp ../ngx_brotli-1.0.0rc/LICENSE module-brotli/LICENSE + +_build configure_add=--add-dynamic-module=../ngx_cache_purge-2.5.3 \ + objs_dir=module-cache-purge +cp %{_sourcedir}/README-module-cache-purge module-cache-purge/README +cp ../ngx_cache_purge-2.5.3/LICENSE module-cache-purge/LICENSE + +_build configure_add=--add-dynamic-module=../nginx-dav-ext-module-3.0.0 \ + objs_dir=module-dav-ext +cp %{_sourcedir}/README-module-dav-ext module-dav-ext/README +cp ../nginx-dav-ext-module-3.0.0/LICENSE module-dav-ext/LICENSE + +_build configure_add=--add-dynamic-module=../ngx_dynamic_limit_req_module-1.9.3 \ + objs_dir=module-dynamic-limit-req +cp %{_sourcedir}/README-module-dynamic-limit-req module-dynamic-limit-req/README +cp ../ngx_dynamic_limit_req_module-1.9.3/LICENSE module-dynamic-limit-req/LICENSE + +_build configure_add=--add-dynamic-module=../echo-nginx-module-0.63 \ + objs_dir=module-echo +cp %{_sourcedir}/README-module-echo module-echo/README +cp ../echo-nginx-module-0.63/LICENSE module-echo/LICENSE + +_build configure_add=--add-dynamic-module=../ngx_http_enhanced_memcached_module-0.3 \ + objs_dir=module-enhanced-memcached +cp %{_sourcedir}/README-module-enhanced-memcached module-enhanced-memcached/README +cp ../ngx_http_enhanced_memcached_module-0.3/README.markdown module-enhanced-memcached/LICENSE + +_build configure_add=--add-dynamic-module=../nginx-eval-module-2016.06.10 \ + objs_dir=module-eval +cp %{_sourcedir}/README-module-eval module-eval/README +cp ../nginx-eval-module-2016.06.10/LICENCE module-eval/LICENSE + +_build configure_add=--add-dynamic-module=../ngx_http_geoip2_module-3.4 \ + objs_dir=module-geoip2 +cp %{_sourcedir}/README-module-geoip2 module-geoip2/README +cp ../ngx_http_geoip2_module-3.4/LICENSE module-geoip2/LICENSE + +_build configure_add=--add-dynamic-module=../headers-more-nginx-module-0.37 \ + objs_dir=module-headers-more +cp %{_sourcedir}/README-module-headers-more module-headers-more/README +cp ../headers-more-nginx-module-0.37/README.markdown module-headers-more/LICENSE + +_build configure_add=--with-http_image_filter_module=dynamic \ + objs_dir=module-image-filter +cp %{_sourcedir}/README-module-image-filter module-image-filter/README + +_build configure_add=--add-dynamic-module=../nginx-jwt-module-3.4.1 \ + objs_dir=module-jwt +cp %{_sourcedir}/README-module-jwt module-jwt/README +cp ../nginx-jwt-module-3.4.1/LICENSE module-jwt/LICENSE + +_build configure_add=--add-dynamic-module=../nginx-keyval-0.3.0 \ + objs_dir=module-keyval +cp %{_sourcedir}/README-module-keyval module-keyval/README +cp ../nginx-keyval-0.3.0/LICENSE module-keyval/LICENSE + +( + cd ../luajit2-2.1-20240626 + make %{?_smp_mflags} CFLAGS="$CFLAGS -fPIC" DESTDIR=$(pwd) install +) +_build configure_add="--add-dynamic-module=../lua-nginx-module-0.10.26 + --add-dynamic-module=../stream-lua-nginx-module-bea8a0c0de94cede71554f53818ac0267d675d63 + --add-dynamic-module=../ngx_devel_kit-0.3.3" \ + configure_env="LUAJIT_INC=../luajit2-2.1-20240626/usr/include/luajit-2.1 + LUAJIT_LIB=../luajit2-2.1-20240626/usr/lib" \ + objs_dir=module-lua + +mkdir module-lua/lua-clibs + +cc -O2 -fPIC -I../luajit2-2.1-20240626/src -c ../chronos-0.2-4/src/chronos.c \ + -o ../chronos-0.2-4/src/chronos.o +cc -shared -o module-lua/lua-clibs/chronos.so ../chronos-0.2-4/src/chronos.o -lrt + +make %{?_smp_mflags} -C ../lua-cjson-2.1.0 install \ + LUA_CMODULE_DIR=$(pwd)/module-lua/lua-clibs LUA_INCLUDE_DIR=../luajit2-2.1-20240626/src +make %{?_smp_mflags} -C ../lua-resty-core-0.1.28 install \ + DESTDIR=$(pwd)/module-lua/lua-libs LUA_LIB_DIR= +make %{?_smp_mflags} -C ../lua-resty-lrucache-0.13 install \ + DESTDIR=$(pwd)/module-lua/lua-libs LUA_LIB_DIR= +cp ../lua-dumper-0.1.1/dumper.lua \ + module-lua/lua-libs +cp ../inspect.lua-3.1.3/inspect.lua \ + module-lua/lua-libs +cp -Rp ../lua-resty-hmac-5f60e1a28b9fdd7939f0e1738171f0ca5fe22978/lib/resty/* \ + module-lua/lua-libs/resty +make %{?_smp_mflags} -C ../lua-resty-http-0.17.2 install \ + DESTDIR=$(pwd)/module-lua/lua-libs LUA_LIB_DIR= +cp -Rp ../lua-resty-jwt-0.2.3/lib/resty/* \ + module-lua/lua-libs/resty +cp -Rp ../lua-resty-openidc-1.7.6/lib/resty/* \ + module-lua/lua-libs/resty +make %{?_smp_mflags} -C ../lua-resty-openssl-1.4.0 install \ + DESTDIR=$(pwd)/module-lua/lua-libs LUA_LIB_DIR= +cp -Rp ../lua-resty-session-3.10/lib/resty/* \ + module-lua/lua-libs/resty +make %{?_smp_mflags} -C ../lua-resty-string-0.15 install \ + DESTDIR=$(pwd)/module-lua/lua-libs LUA_LIB_DIR= + +cp %{_sourcedir}/README-module-lua module-lua/README +cp ../lua-nginx-module-0.10.26/README.markdown module-lua/LICENSE + +( + cd ../ssdeep-release-2.14.1 + ./bootstrap + ./configure --prefix=%{_builddir}/sandbox \ + --libdir=%{_builddir}/sandbox/lib \ + --enable-shared=no \ + --with-pic + make && make install +) +( + cd ../ModSecurity-3.0.12 + ./build.sh + ./configure --prefix=%{_builddir}/sandbox \ + --libdir=%{_builddir}/sandbox/lib \ + --enable-shared=no \ + --with-geoip=no \ + --with-lmdb \ + --with-maxmind \ + --with-lua \ + --with-pcre2 \ + --with-pic \ + --with-ssdeep=%{_builddir}/sandbox + make && make install +) +_build configure_add=--add-dynamic-module=%{_builddir}/ModSecurity-nginx-1.0.3 \ + cc_opt="-I%{_builddir}/sandbox/include" \ + ld_opt="-L%{_builddir}/sandbox/lib \ + $(pkg-config --libs --static \ + %{_builddir}/sandbox/lib/pkgconfig/modsecurity.pc) \ + -lstdc++" \ + objs_dir=module-modsecurity + +cp %{_sourcedir}/README-module-modsecurity module-modsecurity/README +cp ../ModSecurity-nginx-1.0.3/LICENSE module-modsecurity/LICENSE +sed -E -e 's,\b(SecAuditLog)\b.*,\1 /var/log/angie/modsecurity/audit.log,' \ + -e 's,\b(SecDebugLog)\b.*,\1 /var/log/angie/modsecurity/debug.log,' \ + -e 's,\b(SecAuditLogStorageDir)\b.*,\1 /var/log/angie/modsecurity/concurrent,' \ + ../ModSecurity-3.0.12/modsecurity.conf-recommended > \ + module-modsecurity/modsecurity.conf +cp ../ModSecurity-3.0.12/unicode.mapping module-modsecurity/unicode.mapping + +_build configure_add=--add-dynamic-module=../ngx_devel_kit-0.3.3 \ + cc_opt="-DNDK_SET_VAR -DNDK_UPSTREAM_LIST" \ + objs_dir=module-ndk +cp %{_sourcedir}/README-module-ndk module-ndk/README +cp ../ngx_devel_kit-0.3.3/LICENSE module-ndk/LICENSE + +_build configure_add=--add-dynamic-module=../njs-0.8.5/nginx \ + objs_dir=module-njs +( + cd ../njs-0.8.5 + [ -f Makefile ] && make clean + ./configure --ld-opt="$LDFLAGS" + make %{?_smp_mflags} +) + +cp %{_sourcedir}/README-module-njs module-njs/README +cp ../njs-0.8.5/LICENSE module-njs/LICENSE + +( + cd ../opentracing-cpp-1.6.0 + mkdir .build && cd .build + cmake -DCMAKE_INSTALL_PREFIX=%{_builddir}/sandbox \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DCMAKE_PREFIX_PATH=%{_builddir}/sandbox \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DBUILD_DYNAMIC_LOADING=ON \ + -DBUILD_MOCKTRACER=OFF \ + -DBUILD_SHARED_LIBS=OFF \ + -DBUILD_STATIC_LIBS=ON \ + .. + make -j2 install +) +( + cd ../dd-opentracing-cpp-1.3.7 + mkdir .build && cd .build + cmake -DCMAKE_INSTALL_PREFIX=%{_builddir}/sandbox \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DCMAKE_PREFIX_PATH=%{_builddir}/sandbox \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DBUILD_SHARED=OFF \ + -DBUILD_PLUGIN=ON \ + .. + make -j2 +) +( + cd ../zipkin-cpp-opentracing-966416e4d6aec23f572730aede6c087ccce6d194 + mkdir .build && cd .build + cmake -DCMAKE_INSTALL_PREFIX=%{_builddir}/sandbox \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DCMAKE_PREFIX_PATH=%{_builddir}/sandbox \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DBUILD_SHARED_LIBS=OFF \ + -DBUILD_STATIC_LIBS=OFF \ + -DBUILD_PLUGIN=ON \ + .. + make -j2 +) + +_build configure_add=--add-dynamic-module=../nginx-opentracing-0.35.3/opentracing \ + cc_opt="-I%{_builddir}/sandbox/include" \ + ld_opt="-L%{_builddir}/sandbox/lib" \ + objs_dir=module-opentracing + +cp %{_sourcedir}/README-module-opentracing module-opentracing/README +cp ../nginx-opentracing-0.35.3/LICENSE module-opentracing/LICENSE + +( + cd ../c-ares-cares-1_27_0 + mkdir .build && cd .build + cmake -DCMAKE_INSTALL_PREFIX=%{_builddir}/sandbox \ + -DCMAKE_PREFIX_PATH=%{_builddir}/sandbox \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DCARES_STATIC=ON \ + -DCARES_SHARED=OFF \ + -DCARES_STATIC_PIC=ON \ + .. + make -j2 install +) +( + cd ../abseil-cpp-20211102.0 + mkdir .build && cd .build + cmake -DCMAKE_CXX_STANDARD=11 \ + -DCMAKE_INSTALL_PREFIX=%{_builddir}/sandbox \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DCMAKE_PREFIX_PATH=${_builddir}/sandbox \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DABSL_PROPAGATE_CXX_STD=ON \ + .. + make -j2 install +) +( + cd ../re2-2024-03-01 + mkdir .build && cd .build + cmake -DCMAKE_CXX_STANDARD=11 \ + -DCMAKE_INSTALL_PREFIX=%{_builddir}/sandbox \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DCMAKE_PREFIX_PATH=%{_builddir}/sandbox \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + .. + make -j2 install +) +( + cd ../protobuf-3.19.5 + mkdir .build && cd .build + cmake -DCMAKE_CXX_STANDARD=11 \ + -DCMAKE_INSTALL_PREFIX=%{_builddir}/sandbox \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DCMAKE_PREFIX_PATH=%{_builddir}/sandbox \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -Dprotobuf_BUILD_TESTS=OFF \ + ../cmake + make -j2 install +) +( + cd ../grpc-1.46.7 + # prevent fetching opencensus-proto + touch third_party/opencensus-proto/src + mkdir .build && cd .build + cmake -DCMAKE_CXX_STANDARD=11 \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX=%{_builddir}/sandbox \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DCMAKE_PREFIX_PATH=%{_builddir}/sandbox \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DgRPC_BUILD_CSHARP_EXT=OFF \ + -DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF \ + -DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF \ + -DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF \ + -DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF \ + -DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF \ + -DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF \ + -DgRPC_ABSL_PROVIDER=package \ + -DgRPC_CARES_PROVIDER=package \ + -DgRPC_PROTOBUF_PROVIDER=package \ + -DgRPC_RE2_PROVIDER=package \ + -DgRPC_SSL_PROVIDER=package \ + -DgRPC_ZLIB_PROVIDER=package \ + .. + make -j2 install +) +( + cd ../opentelemetry-cpp-1.11.0 + mkdir .build && cd .build + cmake -DCMAKE_CXX_STANDARD=11 \ + -DCMAKE_INSTALL_PREFIX=%{_builddir}/sandbox \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DCMAKE_PREFIX_PATH=%{_builddir}/sandbox \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DBUILD_TESTING=OFF \ + -DOTELCPP_PROTO_PATH=%{_builddir}/opentelemetry-proto-1.0.0 \ + -DWITH_ABSEIL=ON \ + -DWITH_BENCHMARK=OFF \ + -DWITH_EXAMPLES=OFF \ + -DWITH_FUNC_TESTS=OFF \ + .. + make -j2 install +) + +_build make_target=none objs_dir=module-otel +( + cd ../nginx-otel-0.1.1 + mkdir .build && cd .build + cmake -DCMAKE_PREFIX_PATH=%{_builddir}/sandbox \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DNGX_OTEL_FETCH_DEPS=OFF \ + -DNGX_OTEL_NGINX_BUILD_DIR=%{_builddir}/%{buildsubdir}/objs \ + -DNGX_OTEL_PROTO_DIR=%{_builddir}/opentelemetry-proto-1.0.0 \ + .. + make -j2 + cp ngx_otel_module.so %{_builddir}/%{buildsubdir}/module-otel +) + +cp %{_sourcedir}/README-module-otel module-otel/README +cp ../nginx-otel-0.1.1/LICENSE module-otel/LICENSE + +_build configure_add=--with-http_perl_module=dynamic \ + objs_dir=module-perl +( + make %{?_smp_mflags} -f objs/Makefile install_perl_modules \ + DESTDIR=$(pwd)/module-perl/pm INSTALLDIRS=vendor + find module-perl/pm -not -name 'nginx.*' -type f -delete + find module-perl/pm -depth -type d -empty -delete +) +cp %{_sourcedir}/README-module-perl module-perl/README + +_build configure_add=--add-dynamic-module=../ngx_postgres-1.0rc7 \ + objs_dir=module-postgres + +cp %{_sourcedir}/README-module-postgres module-postgres/README +cp ../ngx_postgres-1.0rc7/LICENSE module-postgres/LICENSE + +_build configure_add=--add-dynamic-module=../redis2-nginx-module-0.15 \ + objs_dir=module-redis2 +cp %{_sourcedir}/README-module-redis2 module-redis2/README +cp ../redis2-nginx-module-0.15/README.markdown module-redis2/LICENSE + +_build configure_add=--add-dynamic-module=../nginx-rtmp-module-1.2.2 \ + objs_dir=module-rtmp +cp %{_sourcedir}/README-module-rtmp module-rtmp/README +cp ../nginx-rtmp-module-1.2.2/LICENSE module-rtmp/LICENSE + +_build configure_add="--add-dynamic-module=../ngx_devel_kit-0.3.3 + --add-dynamic-module=../set-misc-nginx-module-0.33" \ + objs_dir=module-set-misc +cp %{_sourcedir}/README-module-set-misc module-set-misc/README +cp ../set-misc-nginx-module-0.33/README.markdown module-set-misc/LICENSE + +_build configure_add=--add-dynamic-module=../ngx_http_substitutions_filter_module-e12e965ac1837ca709709f9a26f572a54d83430e \ + objs_dir=module-subs +cp %{_sourcedir}/README-module-subs module-subs/README +cp ../ngx_http_substitutions_filter_module-e12e965ac1837ca709709f9a26f572a54d83430e/README module-subs/LICENSE + +_build configure_add=--add-dynamic-module=../testcookie-nginx-module-64137c2f7e66e8866f56fdecaaf09ac10a034da9 \ + objs_dir=module-testcookie +cp %{_sourcedir}/README-module-testcookie module-testcookie/README +cp ../testcookie-nginx-module-64137c2f7e66e8866f56fdecaaf09ac10a034da9/README.markdown module-testcookie/LICENSE + +_build configure_add=--add-dynamic-module=../nginx-upload-module-2.3.0 \ + objs_dir=module-upload +cp %{_sourcedir}/README-module-upload module-upload/README +cp ../nginx-upload-module-2.3.0/LICENCE module-upload/LICENSE + +_build configure_add=--add-dynamic-module=../nginx-vod-module-1.33 \ + cc_opt="-I/usr/include/ffmpeg" \ + objs_dir=module-vod +cp %{_sourcedir}/README-module-vod module-vod/README +cp ../nginx-vod-module-1.33/LICENSE module-vod/LICENSE + +_build configure_add="--add-dynamic-module=../nginx-module-stream-sts-0.1.1 + --add-dynamic-module=../nginx-module-sts-0.1.1 + --add-dynamic-module=../nginx-module-vts-0.2.2" \ + objs_dir=module-vts +cp %{_sourcedir}/README-module-vts module-vts/README +cp ../nginx-module-vts-0.2.2/LICENSE module-vts/LICENSE + +_build configure_add=--with-http_xslt_module=dynamic \ + objs_dir=module-xslt +cp %{_sourcedir}/README-module-xslt module-xslt/README + +_build configure_add=--add-dynamic-module=../mod_zip-1.3.0 \ + objs_dir=module-zip +cp %{_sourcedir}/README-module-zip module-zip/README +cp ../mod_zip-1.3.0/LICENSE module-zip/LICENSE + +_build configure_add=--add-dynamic-module=../zstd-nginx-module-f4ba115e0b0eaecde545e5f37db6aa18917d8f4b \ + objs_dir=module-zstd +cp %{_sourcedir}/README-module-zstd module-zstd/README +cp ../zstd-nginx-module-f4ba115e0b0eaecde545e5f37db6aa18917d8f4b/LICENSE module-zstd/LICENSE + +_build \ + make_target=build + +%install +rm -Rf %{buildroot} +mkdir -p %{buildroot} + +install -dm 755 \ + %{buildroot}%{_sysconfdir}/angie \ + %{buildroot}%{_var}/cache/angie \ + %{buildroot}%{_var}/lib/angie \ + %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 objs/angie %{buildroot}%{_sbindir}/angie-nodebug +install -Dm 755 ../angie-debug/objs/angie %{buildroot}%{_sbindir}/angie-debug +ln -fs angie-nodebug %{buildroot}%{_sbindir}/angie + +install -Dm 644 objs/angie.8 %{buildroot}%{_mandir}/man8/angie.8 + +install -dm 755 %{buildroot}%{_datadir}/angie/html +install -Dm 644 html/* -t %{buildroot}%{_datadir}/angie/html + +install -Dm 644 conf/fastcgi.conf -t %{buildroot}%{_sysconfdir}/angie +install -Dm 644 conf/fastcgi_params -t %{buildroot}%{_sysconfdir}/angie +install -Dm 644 conf/mime.types -t %{buildroot}%{_sysconfdir}/angie +install -Dm 644 conf/prometheus_all.conf -t %{buildroot}%{_sysconfdir}/angie +install -Dm 644 conf/scgi_params -t %{buildroot}%{_sysconfdir}/angie +install -Dm 644 conf/uwsgi_params -t %{buildroot}%{_sysconfdir}/angie + +install -Dm 644 %{_sourcedir}/angie.conf %{buildroot}%{_sysconfdir}/angie/angie.conf +install -Dm 644 %{_sourcedir}/default.conf %{buildroot}%{_sysconfdir}/angie/http.d/default.conf +install -Dm 644 %{_sourcedir}/example.conf %{buildroot}%{_sysconfdir}/angie/stream.d/example.conf +install -Dm 644 %{_sourcedir}/angie.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/angie +install -Dm 644 %{_sourcedir}/angie.service %{buildroot}%{_unitdir}/angie.service +install -Dm 755 %{_sourcedir}/angie.upgrade %{buildroot}%{_libexecdir}/initscripts/legacy-actions/angie/upgrade + +ln -fs ../../usr/lib64/angie/modules %{buildroot}%{_sysconfdir}/angie/modules + +install -Dm 755 module-auth-jwt/ngx_http_auth_jwt_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-auth-ldap/ngx_http_auth_ldap_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-auth-spnego/ngx_http_auth_spnego_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-brotli/ngx_http_brotli_filter_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules +install -Dm 755 module-brotli/ngx_http_brotli_static_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-cache-purge/ngx_http_cache_purge_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-dav-ext/ngx_http_dav_ext_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-dynamic-limit-req/ngx_http_dynamic_limit_req_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-echo/ngx_http_echo_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-enhanced-memcached/ngx_http_enhanced_memcached_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-eval/ngx_http_eval_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-geoip2/ngx_http_geoip2_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules +install -Dm 755 module-geoip2/ngx_stream_geoip2_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-headers-more/ngx_http_headers_more_filter_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-image-filter/ngx_http_image_filter_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -dm 755 %{buildroot}%{_libdir}/angie/modules/max-lt +install -Dm 755 module-jwt/ngx_http_auth_jwt_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules/max-lt + +install -Dm 755 module-keyval/ngx_http_keyval_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-lua/ngx_http_lua_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules +install -Dm 755 module-lua/ngx_stream_lua_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-lua/lua-clibs/chronos.so \ + %{buildroot}%{_libdir}/angie/luajit/chronos.so +install -Dm 755 module-lua/lua-clibs/cjson.so \ + %{buildroot}%{_libdir}/angie/luajit/cjson.so + +for file in $(cd module-lua/lua-libs && find . -type f); do + install -Dm 644 module-lua/lua-libs/$file \ + %{buildroot}%{_datadir}/angie/luajit/$file +done + +install -Dm 644 %{_sourcedir}/angie-module-modsecurity.logrotate \ + %{buildroot}%{_sysconfdir}/logrotate.d/angie-module-modsecurity + +install -Dm 755 module-modsecurity/ngx_http_modsecurity_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -dm 755 %{buildroot}%{_sysconfdir}/angie/modsecurity + +install -Dm 644 module-modsecurity/modsecurity.conf \ + -t %{buildroot}%{_sysconfdir}/angie/modsecurity +install -Dm 644 module-modsecurity/unicode.mapping \ + -t %{buildroot}%{_sysconfdir}/angie/modsecurity +install -Dm 644 %{_sourcedir}/modsecurity.rules.conf \ + %{buildroot}%{_sysconfdir}/angie/modsecurity/rules.conf + +install -dm 755 %{buildroot}%{_var}/lib/angie/modsecurity + +install -Dm 755 module-ndk/ndk_http_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-njs/ngx_http_js_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules +install -Dm 755 module-njs/ngx_stream_js_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 ../njs-0.8.5/build/njs \ + %{buildroot}%{_bindir}/njs + +install -Dm 755 module-opentracing/ngx_http_opentracing_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules +install -Dm 755 %{_builddir}/dd-opentracing-cpp-1.3.7/.build/libdd_opentracing_plugin.so \ + -t %{buildroot}%{_libdir}/angie/modules +install -Dm 755 %{_builddir}/zipkin-cpp-opentracing-966416e4d6aec23f572730aede6c087ccce6d194/.build/zipkin_opentracing/libzipkin_opentracing_plugin.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-otel/ngx_otel_module.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-perl/ngx_http_perl_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +for file in $(cd module-perl/pm && find . -type f -name nginx.so); do + install -Dm 755 module-perl/pm/$file %{buildroot}/$file +done +for file in $(cd module-perl/pm && find . -type f -not -name nginx.so); do + install -Dm 644 module-perl/pm/$file %{buildroot}/$file +done + +install -Dm 755 module-postgres/ngx_postgres_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-redis2/ngx_http_redis2_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-rtmp/ngx_rtmp_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-set-misc/ngx_http_set_misc_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-subs/ngx_http_subs_filter_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-testcookie/ngx_http_testcookie_access_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-upload/ngx_http_upload_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-vod/ngx_http_vod_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-vts/ngx_*_traffic_status_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -dm 755 %{buildroot}%{_datadir}/angie-module-vts/stream + +install -Dm 644 %{_builddir}/nginx-module-vts-0.2.2/share/*.html \ + -t %{buildroot}%{_datadir}/angie-module-vts +install -Dm 644 %{_builddir}/nginx-module-sts-0.1.1/share/*.html \ + -t %{buildroot}%{_datadir}/angie-module-vts/stream + +install -Dm 755 module-xslt/ngx_http_xslt_filter_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-zip/ngx_http_zip_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +install -Dm 755 module-zstd/ngx_http_zstd_filter_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules +install -Dm 755 module-zstd/ngx_http_zstd_static_module*.so \ + -t %{buildroot}%{_libdir}/angie/modules + +%clean +rm -Rf %{buildroot} + +%files +%{_sbindir}/angie +%{_sbindir}/angie-debug +%{_sbindir}/angie-nodebug + +%dir %{_sysconfdir}/angie +%dir %{_sysconfdir}/angie/http.d +%dir %{_sysconfdir}/angie/stream.d + +%config(noreplace) %{_sysconfdir}/angie/angie.conf +%config(noreplace) %{_sysconfdir}/angie/http.d/default.conf +%config(noreplace) %{_sysconfdir}/angie/stream.d/example.conf +%config(noreplace) %{_sysconfdir}/angie/fastcgi.conf +%config(noreplace) %{_sysconfdir}/angie/fastcgi_params +%config(noreplace) %{_sysconfdir}/angie/mime.types +%config(noreplace) %{_sysconfdir}/angie/prometheus_all.conf +%config(noreplace) %{_sysconfdir}/angie/scgi_params +%config(noreplace) %{_sysconfdir}/angie/uwsgi_params +%config(noreplace) %{_sysconfdir}/logrotate.d/angie + +%{_sysconfdir}/angie/modules + +%dir %{_datadir}/angie +%{_datadir}/angie/html + +%doc CHANGES CHANGES.ru README +%license LICENSE + +%dir %{_libdir}/angie +%dir %{_libdir}/angie/modules +%dir %{_libexecdir}/initscripts/legacy-actions/angie +%{_libexecdir}/initscripts/legacy-actions/angie/upgrade + +%{_mandir}/man8/angie.8* + +%{_unitdir}/angie.service + +%dir %{_var}/cache/angie +%dir %{_var}/lib/angie + +%pre +# install:1, upgrade:2 +if [ $1 -eq 1 ]; then + if ! getent group angie >/dev/null; then + groupadd -r angie + fi + + if ! getent passwd angie >/dev/null; then + useradd -c Angie -d %{_var}/cache/angie -g angie -r -s /sbin/nologin angie + fi +fi + +%post +# install:1, upgrade:2 +%systemd_post angie.service + +if [ ! -e %{_var}/log/angie ]; then + install -d -m 755 -o root -g root %{_var}/log/angie || : +fi +if [ ! -e %{_var}/lib/angie/acme ]; then + install -d -m 700 -o root -g root %{_var}/lib/angie/acme || : +fi + +if [ $1 -eq 1 ]; then + cat </dev/null || : + fi + if [ -d %{_var}/log/angie ]; then + rmdir %{_var}/log/angie 2>/dev/null || : + fi +fi + +%postun +# uninstall:0, upgrade:1 +%systemd_postun angie.service + +if [ $1 -eq 1 ]; then + if systemctl is-active angie >/dev/null 2>&1; then + service angie upgrade >/dev/null 2>&1 || \ + echo "Binary upgrade failed, please check error.log" + fi +fi +%package module-auth-jwt +Summary: Angie auth-jwt dynamic module +BuildRequires: jansson-devel +Requires: angie = %{version}-%{release} +Conflicts: angie-module-jwt + +%description module-auth-jwt +Module adds SPNEGO support to Angie. + +%files module-auth-jwt +%{_libdir}/angie/modules/ngx_http_auth_jwt_module.so +%{_libdir}/angie/modules/ngx_http_auth_jwt_module-debug.so + +%doc module-auth-jwt/README +%license module-auth-jwt/LICENSE + +%post module-auth-jwt +if [ $1 -eq 1 ]; then + cat </dev/null || : + fi + if [ -d %{_var}/log/angie/modsecurity ]; then + rmdir %{_var}/log/angie/modsecurity 2>/dev/null || : + fi +fi +%package module-ndk +Summary: Angie NDK dynamic module +Requires: angie = %{version}-%{release} + +%description module-ndk +Module is designed to extend the Angie core functionality. + +%files module-ndk +%{_libdir}/angie/modules/ndk_http_module.so +%{_libdir}/angie/modules/ndk_http_module-debug.so + +%doc module-ndk/README +%license module-ndk/LICENSE + +%post module-ndk +if [ $1 -eq 1 ]; then + cat < - 1.6.2-1 +- Rebuilt for MSVSphere 9.4 + +* Fri Aug 16 2024 Release Engineering Team - angie-1.6.2-1 +- Release 1.6.2 + +* Wed Aug 07 2024 Release Engineering Team - angie-1.6.1-1 +- Release 1.6.1 +- Updated angie-module-opentracing to v0.35.3 +- Updated angie-module-zstd to f4ba115e0b0eaecde545e5f37db6aa18917d8f4b + +* Thu Jun 27 2024 Release Engineering Team - angie-1.6.0-1 +- Release 1.6.0 +- Updated angie-module-auth-jwt to 0.7.0 +- Updated angie-module-auth-ldap to 241200eac8e4acae74d353291bd27f79e5ca3dc4 +- Updated angie-module-jwt to 3.4.1 +- Updated angie-module-keyval to 0.3.0 +- Updated angie-module-njs to 0.8.5 + +* Mon Jun 03 2024 Release Engineering Team - angie-1.5.2-1 +- Release 1.5.2 +- Updated angie-module-opentracing to 0.35.2 + +* Wed May 15 2024 Release Engineering Team - angie-1.5.1-1 +- Release 1.5.1 + +* Wed Apr 24 2024 Release Engineering Team - angie-1.5.0-3 +- Added angie-module-vts + +* Tue Apr 16 2024 Release Engineering Team - angie-1.5.0-2 +- Added angie-module-zstd +- Updated angie-module-njs to 0.8.4 + +* Mon Mar 25 2024 Release Engineering Team - angie-1.5.0-1 +- Release 1.5.0 +- Added angie-module-otel +- Updated angie-module-jwt to v3.4.0 + +* Thu Feb 15 2024 Release Engineering Team - angie-1.4.1-1 +- Release 1.4.1 +- Added angie-module-dynamic-limit-req +- Updated angie-module-njs to 0.8.3 +- Updated angie-module-vod to 1.33 + +* Mon Jan 22 2024 Release Engineering Team - angie-1.4.0-3 +- Added angie-module-zip ver. 1.3.0 +- Updated angie-module-auth-jwt to 0.6.0 +- Updated angie-module-headers-more to 0.37 +- Updated angie-module-lua to 0.10.26 +- Updated angie-module-modsecurity to 3.0.11 + +* Tue Dec 12 2023 Release Engineering Team - angie-1.4.0-2 +- Added missed distribution file for angie-module-auth-ldap into SRPM + +* Mon Dec 11 2023 Release Engineering Team - angie-1.4.0-1 +- Release 1.4.0 +- Added angie-module-auth-ldap +- Updated angie-module-auth-jwt to 0.4.0 +- Updated angie-module-headers-more to 0.36 +- Updated angie-module-ndk to 0.3.3 +- Updated angie-module-opentracing to 0.33.0 + +* Fri Dec 1 2023 Release Engineering Team - angie-1.3.2-2 +- Added angie-module-modsecurity + +* Wed Nov 22 2023 Release Engineering Team - angie-1.3.2-1 +- Release 1.3.2 + +* Mon Nov 13 2023 Release Engineering Team - angie-1.3.1-3 +- Added angie-module-testcookie +- Updated angie-module-headers-more to 0.35 +- Updated angie-module-njs to 0.8.2 +- Updated angie-module-vod to 1.32 + +* Thu Oct 26 2023 Release Engineering Team - angie-1.3.1-2 +- Added angie-module-opentracing + +* Tue Oct 17 2023 Release Engineering Team - angie-1.3.1-1 +- Release 1.3.1 + +* Thu Sep 21 2023 Release Engineering Team - angie-1.3.0-2 +- Moved angie/http.d/prometheus.conf.sample to angie/prometheus_all.conf + +* Tue Sep 19 2023 Release Engineering Team - angie-1.3.0-1 +- Release 1.3.0 +- Updated angie-module-keyval to 0.2.0 +- Updated angie-module-lua to 0.10.25 +- Updated angie-module-njs to 0.8.1 + +* Wed Aug 30 2023 Release Engineering Team - angie-1.2.0-5 +- Added filetrigger for ALT Linux + +* Thu Aug 17 2023 Release Engineering Team - angie-1.2.0-4 +- Added angie-module-enhanced-memcached +- Added angie-module-eval + +* Thu Jul 27 2023 Release Engineering Team - angie-1.2.0-3 +- Added angie-module-auth-jwt +- Updated angie-module-jwt to 3.2.2 + +* Mon Jul 17 2023 Release Engineering Team - angie-1.2.0-2 +- Added angie-module-cache-purge +- Added angie-module-echo +- Added angie-module-keyval +- Added angie-module-postgresql +- Updated angie-module-njs to 0.8.0 +- Updated angie-module-njs-cli to 0.8.0 + +* Tue May 30 2023 Release Engineering Team - angie-1.2.0-1 +- Release 1.2.0 +- Added angie-module-lua +- Added angie-module-redis2 + +* Wed May 10 2023 Release Engineering Team - angie-1.1.0-3 +- Added angie-module-jwt +- Added angie-module-subs +- Added angie-module-upload +- Added angie-module-vod +- Updated angie-module-njs to 0.7.12 +- Updated angie-module-njs-cli to 0.7.12 + +* Fri Mar 10 2023 Release Engineering Team - angie-1.1.0-2 +- Added angie-module-auth-spnego +- Added angie-module-brotli +- Added angie-module-dav-ext +- Added angie-module-headers-more +- Added angie-module-ndk +- Added angie-module-rtmp +- Added angie-module-set-misc +- Updated angie-module-njs to 0.7.11 +- Separate angie-module-njs-cli package + +* Wed Jan 25 2023 Release Engineering Team - angie-1.1.0-1 +- Release 1.1.0 + +* Fri Jan 13 2023 Release Engineering Team - angie-1.0.0-1 +- new version 1.0.0