%define nginx_home %{_localstatedir}/cache/nginx %define nginx_user nginx %define nginx_group nginx %define nginx_loggroup adm %define ngx_openssl_version 1.1.1t %define echo_nginx_module_commit 766acd521a2756e356d3e286cc185de18b094e7c %define headers_more_nginx_module_commit 33b646d69f39604d71342ee241633975aa122b35 %define lua_nginx_module_commit 39941d4c9a8f94191084800471f6433c757a90df %define lua_upstream_nginx_module_commit 79528d9b0ba32aa75e0c0a490f84255756ffa47a %define memc_nginx_module_commit c507601211b971fc8b22ed2ce642c80b154791f6 %define redis2_nginx_module_commit 96d6638183b502ce7a55f83972c26b911795c4ea %define set_misc_nginx_module_commit 3ea21393340a22a6a4dc3f9c1e07b3aac26a5c56 %define srcache_nginx_module_commit be22ac0dcd9245aadcaca3220da96a0c1a0285a7 %define stream_lua_nginx_module_commit 309198abf26266f1a3e53c71388ed7bb9d1e5ea2 %define lua_resty_balancer_commit a7a8b625c6d79d203702709983b736137be2a9bd %define lua_resty_core_commit 407000a9856d3a5aab34e8c73f6ab0f049f8b8d7 %define lua_resty_dns_commit ada80c8712090a52e5180ac2b41d707890cf9106 %define lua_resty_lock_commit f9ef58fdc4fe16c987ac64c6ee803906f716a4f6 %define lua_resty_lrucache_commit 274244e0d7e94f7ad3407dbf358d9886a9d56b3b %define lua_resty_limit_traffic_commit fcce9ca9ee125c02e79acac186a4647e7ee5bafd %define lua_resty_memcached_commit f1fda93e049d98611bd367e6268f062415ed95d6 %define lua_resty_memcached_shdict_commit 32374a1a286506cf4cf9c18a8c1bf01bd1554c21 %define lua_resty_mysql_commit 7024a66589d47c1ed64c08a1aeb4cf95d4ab2301 %define lua_resty_redis_commit 6d1d36c700b99b3f93f2fec9a677ae0aeb700286 %define lua_resty_shdict_simple_commit 4d27246b16f86de49e6da8b8a6136cddfe7550b4 %define lua_resty_shell_commit f874c0d97b376692c45f29bc61d3c43ff2bcffe2 %define lua_resty_signal_commit ee4f0f355508a8e071d0d7c1333d559b91a6428e %define lua_resty_string_commit 775576d0e54fc562e4475ed6246c74c7faa04381 %define lua_resty_upload_commit 03704aee42f7135e7782688d8a9af63a16015edc %define lua_resty_upstream_healthcheck_commit 6ade2a860a0bc23c471c7c70751682263451eef5 %define lua_resty_websocket_commit eba3e979620f847fc6bdb3f64e9adf86b59a0251 %define lua_resty_cookie_commit 99be1005e38ce19ace54515272a2be1b9fdc5da2 %define lua_resty_openidc_commit 734a3f4dba0faf037abe993c678e43b1bab3025a %define lua_resty_session_commit 4f1afcd923cf9e73fdf1ed4ffd2eff241b2a4782 %define lua_resty_jwt_commit b8b1f6e00be74565111e0cbbc40bc7d26367a646 %define lua_resty_hmac_commit eb4e8399b7f610bdb1b79dcbbd218e2cd9b84ad5 %define lua_resty_http_commit 4ab4269cf442ba52507aa2c718f606054452fcad %define ngx_cache_purge_commit 331fe43e8d9a3d1fa5e0c9fec7d3201d431a9177 %define nginx_rtmp_module_commit 23e1873aa62acb58b7881eed2a501f5bf35b82e9 %define nginx_dav_ext_module_commit f5e30888a256136d9c550bf1ada77d6ea78a48af %define ngx_http_enhanced_memcached_module_commit b58a4500db3c4ee274be54a18abc767219dcfd36 %define ngx_http_secure_download_commit f379a1acf2a76f63431a12fa483d9e22e718400b %define ngx_devel_kit_commit b4642d6ca01011bd8cd30b253f5c3872b384fd21 %define nginx_sorted_querystring_module_commit 24d74510a8c1876aa40700a412f1e163605a7790 %define ngx_http_pipelog_module_commit c11246e7b7e182e1f794e49eff72ce663f5e7996 %define nginx_http_shibboleth_commit be12df59edb087143c4bc828dfec9fbee910ceda %define nginx_lua_saml_service_provider_commit ae2c02dc4c56b11d7536d8f7b7d25ef152edf7c7 %define nginx_lua_session_commit 9c5053a7c9d2e8748f1153193d598dcea16417f4 %define lua_ffi_zlib_commit 1fb69ca505444097c82d2b72e87904f3ed923ae9 %define SLAXML_commit 756ffad03d2a06271170a0ba82d6eac02cc2a5ca %define ngx_http_geoip2_module_commit cbaa35461c62a99d2577e6bae3273492502d8769 %define ngx_upstream_jdomain_commit a5a8e07f76cbe82b0792f8e3091e011c0c12f230 %define lua_resty_woothee_commit 256e7ccbcc22d037936cd813e5964f41e5a5a885 %define lua_resty_jump_consistent_hash_commit a01d2683bfe34cc4edaab7ecac7906d51dfbd125 %define ngx_fancyindex_commit cbc0d3fca4f06414612de441399393d4b3bbb315 %define nginx_module_vts_commit a98a4b86a274bddad47021e8b5223264fd1cdca3 %define ngx_brotli_commit 6e975bcb015f62e1f303054897783355e2a877dc %define ModSecurity_nginx_version 1.0.3 %define luajit_inc /usr/include/luajit-2.1 %define luajit_lib /usr/lib64 # distribution specific definitions %define use_systemd (0%{?fedora} && 0%{?fedora} >= 18) || (0%{?rhel} && 0%{?rhel} >= 7) || (0%{?suse_version} == 1315) %if 0%{?rhel} == 5 Group: System Environment/Daemons Requires(pre): shadow-utils Requires: initscripts >= 8.36 Requires(post): chkconfig %endif %if 0%{?rhel} == 6 Group: System Environment/Daemons Requires(pre): shadow-utils Requires: initscripts >= 8.36 Requires(post): chkconfig %define with_http2 1 %endif %if 0%{?rhel} >= 7 Group: System Environment/Daemons Requires(pre): shadow-utils Requires: systemd BuildRequires: systemd Epoch: 1 %define tcp_fast_open 1 %define with_http2 1 %endif %if 0%{?suse_version} == 1315 Group: Productivity/Networking/Web/Servers BuildRequires: systemd Requires(pre): shadow Requires: systemd %define with_http2 1 %define nginx_loggroup trusted %endif # end of distribution specific definitions Summary: High performance web server Name: nginx Version: 1.22.1 Release: 5%{?dist}.ngx Vendor: nginx inc. URL: http://nginx.org/ Source0: http://nginx.org/download/%{name}-%{version}.tar.gz Source1: https://raw.githubusercontent.com/hnakamur/nginx-rpm/main/SOURCES/logrotate Source2: https://raw.githubusercontent.com/hnakamur/nginx-rpm/main/SOURCES/nginx.init.in Source3: https://raw.githubusercontent.com/hnakamur/nginx-rpm/main/SOURCES/nginx.sysconf Source4: https://raw.githubusercontent.com/hnakamur/nginx-rpm/main/SOURCES/nginx.conf Source5: https://raw.githubusercontent.com/hnakamur/nginx-rpm/main/SOURCES/nginx.vh.default.conf Source7: https://raw.githubusercontent.com/hnakamur/nginx-rpm/main/SOURCES/nginx-debug.sysconf Source8: https://raw.githubusercontent.com/hnakamur/nginx-rpm/main/SOURCES/nginx.service Source9: https://raw.githubusercontent.com/hnakamur/nginx-rpm/main/SOURCES/nginx.upgrade.sh Source10: https://raw.githubusercontent.com/hnakamur/nginx-rpm/main/SOURCES/nginx.suse.logrotate Source11: https://raw.githubusercontent.com/hnakamur/nginx-rpm/main/SOURCES/nginx-debug.service Source12: https://raw.githubusercontent.com/hnakamur/nginx-rpm/main/SOURCES/COPYRIGHT Source100: https://github.com/openresty/lua-nginx-module/archive/%{lua_nginx_module_commit}.tar.gz#/lua-nginx-module.tar.gz Source101: https://github.com/openresty/headers-more-nginx-module/archive/%{headers_more_nginx_module_commit}.tar.gz#/headers-more-nginx-module.tar.gz Source102: https://github.com/openresty/stream-lua-nginx-module/archive/%{stream_lua_nginx_module_commit}.tar.gz#/stream-lua-nginx-module.tar.gz Source103: https://github.com/nginx-shib/nginx-http-shibboleth/archive/%{nginx_http_shibboleth_commit}.tar.gz#/nginx-http-shibboleth.tar.gz Source104: https://github.com/wandenberg/nginx-sorted-querystring-module/archive/%{nginx_sorted_querystring_module_commit}.tar.gz#/nginx-sorted-querystring-module.tar.gz Source105: https://github.com/arut/nginx-rtmp-module/archive/%{nginx_rtmp_module_commit}.tar.gz#/nginx-rtmp-module.tar.gz Source106: https://github.com/FRiCKLE/ngx_cache_purge/archive/%{ngx_cache_purge_commit}.tar.gz#/ngx_cache_purge.tar.gz Source107: https://github.com/replay/ngx_http_secure_download/archive/%{ngx_http_secure_download_commit}.tar.gz#/ngx_http_secure_download.tar.gz Source108: https://github.com/cloudflare/lua-resty-cookie/archive/%{lua_resty_cookie_commit}.tar.gz#/lua-resty-cookie.tar.gz Source109: https://github.com/openresty/srcache-nginx-module/archive/%{srcache_nginx_module_commit}.tar.gz#/srcache-nginx-module.tar.gz Source110: https://github.com/openresty/redis2-nginx-module/archive/%{redis2_nginx_module_commit}.tar.gz#/redis2-nginx-module.tar.gz Source111: https://github.com/openresty/memc-nginx-module/archive/%{memc_nginx_module_commit}.tar.gz#/memc-nginx-module.tar.gz Source112: https://github.com/openresty/lua-upstream-nginx-module/archive/%{lua_upstream_nginx_module_commit}.tar.gz#/lua-upstream-nginx-module.tar.gz Source113: https://github.com/openresty/echo-nginx-module/archive/%{echo_nginx_module_commit}.tar.gz#/echo-nginx-module.tar.gz Source114: https://github.com/bpaquet/ngx_http_enhanced_memcached_module/archive/%{ngx_http_enhanced_memcached_module_commit}.tar.gz#/ngx_http_enhanced_memcached_module.tar.gz Source115: https://github.com/arut/nginx-dav-ext-module/archive/%{nginx_dav_ext_module_commit}.tar.gz#/nginx-dav-ext-module.tar.gz Source116: https://github.com/simplresty/ngx_devel_kit/archive/%{ngx_devel_kit_commit}.tar.gz#/ngx_devel_kit.tar.gz Source117: https://github.com/openresty/set-misc-nginx-module/archive/%{set_misc_nginx_module_commit}.tar.gz#/set-misc-nginx-module.tar.gz Source118: https://github.com/pandax381/ngx_http_pipelog_module/archive/%{ngx_http_pipelog_module_commit}.tar.gz#/ngx_http_pipelog_module.tar.gz Source119: https://github.com/openresty/lua-resty-core/archive/%{lua_resty_core_commit}.tar.gz#/lua-resty-core.tar.gz Source120: https://openssl.org/source/openssl-%{ngx_openssl_version}.tar.gz Source121: https://github.com/pintsized/lua-resty-http/archive/%{lua_resty_http_commit}.tar.gz#/lua-resty-http.tar.gz Source122: https://github.com/openresty/lua-resty-string/archive/%{lua_resty_string_commit}.tar.gz#/lua-resty-string.tar.gz Source123: https://github.com/hnakamur/nginx-lua-saml-service-provider/archive/%{nginx_lua_saml_service_provider_commit}.tar.gz#/nginx-lua-saml-service-provider.tar.gz Source124: https://github.com/hnakamur/nginx-lua-session/archive/%{nginx_lua_session_commit}.tar.gz#/nginx-lua-session.tar.gz Source125: https://github.com/hamishforbes/lua-ffi-zlib/archive/%{lua_ffi_zlib_commit}.tar.gz#/lua-ffi-zlib.tar.gz Source126: https://github.com/Phrogz/SLAXML/archive/%{SLAXML_commit}.tar.gz#/SLAXML.tar.gz Source127: https://github.com/openresty/lua-resty-lrucache/archive/%{lua_resty_lrucache_commit}.tar.gz#/lua-resty-lrucache.tar.gz Source128: https://github.com/zmartzone/lua-resty-openidc/archive/%{lua_resty_openidc_commit}.tar.gz#/lua-resty-openidc.tar.gz Source129: https://github.com/bungle/lua-resty-session/archive/%{lua_resty_session_commit}.tar.gz#/lua-resty-session.tar.gz Source130: https://github.com/cdbattags/lua-resty-jwt/archive/%{lua_resty_jwt_commit}.tar.gz#/lua-resty-jwt.tar.gz Source131: https://github.com/jkeys089/lua-resty-hmac/archive/%{lua_resty_hmac_commit}.tar.gz#/lua-resty-hmac.tar.gz Source132: https://github.com/openresty/lua-resty-balancer/archive/%{lua_resty_balancer_commit}.tar.gz#/lua-resty-balancer.tar.gz Source133: https://github.com/openresty/lua-resty-dns/archive/%{lua_resty_dns_commit}.tar.gz#/lua-resty-dns.tar.gz Source134: https://github.com/openresty/lua-resty-lock/archive/%{lua_resty_lock_commit}.tar.gz#/lua-resty-lock.tar.gz Source135: https://github.com/openresty/lua-resty-limit-traffic/archive/%{lua_resty_limit_traffic_commit}.tar.gz#/lua-resty-limit-traffic.tar.gz Source136: https://github.com/openresty/lua-resty-memcached/archive/%{lua_resty_memcached_commit}.tar.gz#/lua-resty-memcached.tar.gz Source137: https://github.com/openresty/lua-resty-memcached-shdict/archive/%{lua_resty_memcached_shdict_commit}.tar.gz#/lua-resty-memcached-shdict.tar.gz Source138: https://github.com/openresty/lua-resty-mysql/archive/%{lua_resty_mysql_commit}.tar.gz#/lua-resty-mysql.tar.gz Source139: https://github.com/openresty/lua-resty-redis/archive/%{lua_resty_redis_commit}.tar.gz#/lua-resty-redis.tar.gz Source140: https://github.com/openresty/lua-resty-shdict-simple/archive/%{lua_resty_shdict_simple_commit}.tar.gz#/lua-resty-shdict-simple.tar.gz Source141: https://github.com/openresty/lua-resty-shell/archive/%{lua_resty_shell_commit}.tar.gz#/lua-resty-shell.tar.gz Source142: https://github.com/openresty/lua-resty-signal/archive/%{lua_resty_signal_commit}.tar.gz#/lua-resty-signal.tar.gz Source143: https://github.com/openresty/lua-resty-upload/archive/%{lua_resty_upload_commit}.tar.gz#/lua-resty-upload.tar.gz Source144: https://github.com/openresty/lua-resty-upstream-healthcheck/archive/%{lua_resty_upstream_healthcheck_commit}.tar.gz#/lua-resty-upstream-healthcheck.tar.gz Source145: https://github.com/openresty/lua-resty-websocket/archive/%{lua_resty_websocket_commit}.tar.gz#/lua-resty-websocket.tar.gz Source146: https://github.com/leev/ngx_http_geoip2_module/archive/%{ngx_http_geoip2_module_commit}.tar.gz#/ngx_http_geoip2_module.tar.gz Source147: https://github.com/e98cuenc/ngx_upstream_jdomain/archive/%{ngx_upstream_jdomain_commit}.tar.gz#/ngx_upstream_jdomain.tar.gz Source148: https://github.com/woothee/lua-resty-woothee/archive/%{lua_resty_woothee_commit}.tar.gz#/lua-resty-woothee.tar.gz Source149: https://github.com/ruoshan/lua-resty-jump-consistent-hash/archive/%{lua_resty_jump_consistent_hash_commit}.tar.gz#/lua-resty-jump-consistent-hash.tar.gz Source150: https://github.com/aperezdc/ngx-fancyindex/archive/%{ngx_fancyindex_commit}.tar.gz#/ngx-fancyindex.tar.gz Source151: https://github.com/vozlt/nginx-module-vts/archive/%{nginx_module_vts_commit}.tar.gz#/nginx-module-vts.tar.gz Source152: https://github.com/google/ngx_brotli/archive/%{ngx_brotli_commit}.tar.gz#/ngx_brotli.tar.gz Source153: https://github.com/SpiderLabs/ModSecurity-nginx/archive/v%{ModSecurity_nginx_version}/modsecurity-nginx-v%{ModSecurity_nginx_version}.tar.gz Patch14: https://raw.githubusercontent.com/hnakamur/nginx-rpm/main/SOURCES/ngx_http_secure_download-dynamic_module.patch Patch15: https://raw.githubusercontent.com/hnakamur/nginx-rpm/main/SOURCES/ngx_cache_purge-dynamic_module.patch Patch16: https://raw.githubusercontent.com/hnakamur/nginx-rpm/main/SOURCES/ngx_cache_purge-fix_compatibility_with_nginx_1.11.6.patch Patch17: https://raw.githubusercontent.com/hnakamur/nginx-rpm/main/SOURCES/ngx_cache_purge-feat_purge_all.patch Patch18: https://raw.githubusercontent.com/hnakamur/nginx-rpm/main/SOURCES/ngx_cache_purge-feat_purge_partial_keys.patch Patch19: https://raw.githubusercontent.com/hnakamur/nginx-rpm/main/SOURCES/ngx_cache_purge-select_response_type.patch Patch20: https://raw.githubusercontent.com/hnakamur/nginx-rpm/main/SOURCES/nginx-1.11.2-ssl_cert_cb_yield.patch Patch21: https://raw.githubusercontent.com/hnakamur/nginx-rpm/main/SOURCES/ngx_upstream_jdomain-dynamic_module.patch Patch23: https://raw.githubusercontent.com/hnakamur/nginx-rpm/main/SOURCES/nginx-1.19.4-cache_manager.patch License: 2-clause BSD-like license BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: perl autoconf automake cmake gcc-c++ BuildRequires: zlib-devel BuildRequires: pcre-devel BuildRequires: libxml2-devel BuildRequires: libxslt-devel BuildRequires: gd-devel BuildRequires: expat-devel BuildRequires: libmaxminddb-devel # epel %if %{?rhel} < 9 # BuildRequires: pkgconfig(geoip) BuildRequires: GeoIP-devel %endif BuildRequires: pcre2-devel BuildRequires: luajit-devel BuildRequires: mhash-devel # ngx_brotli Requires: brotli BuildRequires: brotli-devel # Modsecurity Requires: libmodsecurity BuildRequires: libmodsecurity-devel # BuildRequires: pkgconfig(lmdb) # BuildRequires: pkgconfig(yajl) # BuildRequires: pkgconfig(libcurl) # BuildRequires: pkgconfig(ssdeep) # # BuildRequires: pkgconfig(libpcre) # # BuildRequires: pkgconfig(libxml2) # # BuildRequires: pkgconfig(apr) # # BuildRequires: pkgconfig(apr-util) Provides: webserver %description nginx [engine x] is an HTTP and reverse proxy server, as well as a mail proxy server. %if 0%{?suse_version} == 1315 %debug_package %endif %prep %if %{?rhel} < 9 %setup -q -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106 -a 107 -a 108 -a 109 -a 110 -a 111 -a 112 -a 113 -a 114 -a 115 -a 116 -a 117 -a 118 -a 119 -a 120 -a 121 -a 122 -a 123 -a 124 -a 125 -a 126 -a 127 -a 128 -a 129 -a 130 -a 131 -a 132 -a 133 -a 134 -a 135 -a 136 -a 137 -a 138 -a 139 -a 140 -a 141 -a 142 -a 143 -a 144 -a 145 -a 146 -a 147 -a 148 -a 149 -a 150 -a 151 -a 152 -a 153 %else %setup -q -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106 -a 107 -a 108 -a 109 -a 110 -a 111 -a 112 -a 113 -a 114 -a 115 -a 116 -a 117 -a 118 -a 119 -a 120 -a 121 -a 122 -a 123 -a 124 -a 125 -a 126 -a 127 -a 128 -a 129 -a 130 -a 131 -a 132 -a 133 -a 134 -a 135 -a 136 -a 137 -a 138 -a 139 -a 140 -a 141 -a 142 -a 143 -a 144 -a 145 -a 147 -a 148 -a 149 -a 150 -a 151 -a 152 -a 153 %endif ls -t1Q find . -mindepth 1 -maxdepth 1 -type d -regex './[A-Za-z0-9\-\_\.]+-[-0-9a-z]*$' for d in $(find . -mindepth 1 -maxdepth 1 -type d -regex './[A-Za-z0-9\-\_\.]+-[-0-9a-z]*$') do d_no_commit="$(echo $d|sed -r 's/-[0-9a-z]+$//g')" echo "mv -v $d $d_no_commit" mv -v $d $d_no_commit done # %setup -T -D -a 1 -n "NAME" %patch14 -p1 %patch15 -p1 %patch16 -p1 %patch17 -p1 %patch18 -p1 %patch19 -p1 %patch20 -p1 %patch21 -p1 %patch23 -p1 cp -v %{SOURCE2} . sed -e 's|%%DEFAULTSTART%%|2 3 4 5|g' -e 's|%%DEFAULTSTOP%%|0 1 6|g' \ -e 's|%%PROVIDES%%|nginx|g' < %{SOURCE2} > nginx.init sed -e 's|%%DEFAULTSTART%%||g' -e 's|%%DEFAULTSTOP%%|0 1 2 3 4 5 6|g' \ -e 's|%%PROVIDES%%|nginx-debug|g' < %{SOURCE2} > nginx-debug.init %build ls -t1Q %{_builddir} LUAJIT_INC=%{luajit_inc} LUAJIT_LIB=%{luajit_lib} \ ./configure \ --prefix=%{_sysconfdir}/nginx \ --sbin-path=%{_sbindir}/nginx \ --modules-path=%{_libdir}/nginx/modules-debug \ --conf-path=%{_sysconfdir}/nginx/nginx.conf \ --error-log-path=%{_localstatedir}/log/nginx/error.log \ --http-log-path=%{_localstatedir}/log/nginx/access.log \ --pid-path=%{_localstatedir}/run/nginx.pid \ --lock-path=%{_localstatedir}/run/nginx.lock \ --http-client-body-temp-path=%{_localstatedir}/cache/nginx/client_temp \ --http-proxy-temp-path=%{_localstatedir}/cache/nginx/proxy_temp \ --http-fastcgi-temp-path=%{_localstatedir}/cache/nginx/fastcgi_temp \ --http-uwsgi-temp-path=%{_localstatedir}/cache/nginx/uwsgi_temp \ --http-scgi-temp-path=%{_localstatedir}/cache/nginx/scgi_temp \ --user=%{nginx_user} \ --group=%{nginx_group} \ --with-http_ssl_module \ --with-openssl=./openssl-%{ngx_openssl_version} \ --with-openssl-opt='enable-tls1_3' \ --with-http_realip_module \ --with-http_addition_module \ --with-http_sub_module \ --with-http_dav_module \ --with-http_flv_module \ --with-http_mp4_module \ --with-http_gunzip_module \ --with-http_gzip_static_module \ --with-http_random_index_module \ --with-http_secure_link_module \ --with-http_stub_status_module \ --with-http_auth_request_module \ --with-http_xslt_module=dynamic \ --with-http_image_filter_module=dynamic \ %if %{?rhel} < 9 --with-http_geoip_module=dynamic \ %endif --with-threads \ --with-stream \ --with-stream_ssl_module \ --with-stream_ssl_preread_module \ --with-http_slice_module \ --with-mail=dynamic \ --with-mail_ssl_module \ --with-file-aio \ --add-dynamic-module=./lua-nginx-module \ --add-dynamic-module=./stream-lua-nginx-module \ --add-dynamic-module=./headers-more-nginx-module \ --add-dynamic-module=./nginx-sorted-querystring-module \ --add-dynamic-module=./nginx-rtmp-module \ --add-dynamic-module=./ngx_cache_purge \ --add-dynamic-module=./ngx_http_secure_download \ --add-dynamic-module=./redis2-nginx-module \ --add-dynamic-module=./srcache-nginx-module \ --add-dynamic-module=./memc-nginx-module \ --add-dynamic-module=./lua-upstream-nginx-module \ --add-dynamic-module=./echo-nginx-module \ --add-dynamic-module=./ngx_http_enhanced_memcached_module \ --add-dynamic-module=./nginx-dav-ext-module \ --add-module=./ngx_devel_kit \ --add-dynamic-module=./set-misc-nginx-module \ --add-dynamic-module=./ngx_http_pipelog_module \ --add-dynamic-module=./nginx-http-shibboleth \ %if %{?rhel} < 9 --add-dynamic-module=./ngx_http_geoip2_module \ %endif --add-dynamic-module=./ngx_upstream_jdomain \ --add-dynamic-module=./ngx-fancyindex \ --add-dynamic-module=./nginx-module-vts \ --add-dynamic-module=./ngx_brotli \ --add-dynamic-module=./ModSecurity-nginx-%{ModSecurity_nginx_version} \ --with-debug \ %{?with_http2:--with-http_v2_module} \ --without-pcre2 \ --with-cc-opt="%{optflags} $(pcre-config --cflags)%{?tcp_fast_open: -DTCP_FASTOPEN=23} -Wno-uninitialized -Wno-unused-variable" \ $* make %{?_smp_mflags} %{__mv} %{_builddir}/%{name}-%{version}/objs/nginx \ %{_builddir}/%{name}-%{version}/objs/nginx-debug %{__mkdir} %{_builddir}/%{name}-%{version}/objs-debug %{__mv} %{_builddir}/%{name}-%{version}/objs/*.so \ %{_builddir}/%{name}-%{version}/objs-debug LUAJIT_INC=%{luajit_inc} LUAJIT_LIB=%{luajit_lib} \ ./configure \ --prefix=%{_sysconfdir}/nginx \ --sbin-path=%{_sbindir}/nginx \ --modules-path=%{_libdir}/nginx/modules \ --conf-path=%{_sysconfdir}/nginx/nginx.conf \ --error-log-path=%{_localstatedir}/log/nginx/error.log \ --http-log-path=%{_localstatedir}/log/nginx/access.log \ --pid-path=%{_localstatedir}/run/nginx.pid \ --lock-path=%{_localstatedir}/run/nginx.lock \ --http-client-body-temp-path=%{_localstatedir}/cache/nginx/client_temp \ --http-proxy-temp-path=%{_localstatedir}/cache/nginx/proxy_temp \ --http-fastcgi-temp-path=%{_localstatedir}/cache/nginx/fastcgi_temp \ --http-uwsgi-temp-path=%{_localstatedir}/cache/nginx/uwsgi_temp \ --http-scgi-temp-path=%{_localstatedir}/cache/nginx/scgi_temp \ --user=%{nginx_user} \ --group=%{nginx_group} \ --with-http_ssl_module \ --with-openssl=./openssl-%{ngx_openssl_version} \ --with-http_realip_module \ --with-http_addition_module \ --with-http_sub_module \ --with-http_dav_module \ --with-http_flv_module \ --with-http_mp4_module \ --with-http_gunzip_module \ --with-http_gzip_static_module \ --with-http_random_index_module \ --with-http_secure_link_module \ --with-http_stub_status_module \ --with-http_auth_request_module \ --with-http_xslt_module=dynamic \ --with-http_image_filter_module=dynamic \ %if %{?rhel} < 9 --with-http_geoip_module=dynamic \ %endif --with-threads \ --with-stream \ --with-stream_ssl_module \ --with-stream_ssl_preread_module \ --with-http_slice_module \ --with-mail=dynamic \ --with-mail_ssl_module \ --with-file-aio \ --add-dynamic-module=./lua-nginx-module \ --add-dynamic-module=./stream-lua-nginx-module \ --add-dynamic-module=./headers-more-nginx-module \ --add-dynamic-module=./nginx-sorted-querystring-module \ --add-dynamic-module=./nginx-rtmp-module \ --add-dynamic-module=./ngx_cache_purge \ --add-dynamic-module=./ngx_http_secure_download \ --add-dynamic-module=./redis2-nginx-module \ --add-dynamic-module=./srcache-nginx-module \ --add-dynamic-module=./memc-nginx-module \ --add-dynamic-module=./lua-upstream-nginx-module \ --add-dynamic-module=./echo-nginx-module \ --add-dynamic-module=./ngx_http_enhanced_memcached_module \ --add-dynamic-module=./nginx-dav-ext-module \ --add-module=./ngx_devel_kit \ --add-dynamic-module=./set-misc-nginx-module \ --add-dynamic-module=./ngx_http_pipelog_module \ --add-dynamic-module=./nginx-http-shibboleth \ %if %{?rhel} < 9 --add-dynamic-module=./ngx_http_geoip2_module \ %endif --add-dynamic-module=./ngx_upstream_jdomain \ --add-dynamic-module=./ngx-fancyindex \ --add-dynamic-module=./nginx-module-vts \ --add-dynamic-module=./ngx_brotli \ --add-dynamic-module=./ModSecurity-nginx-%{ModSecurity_nginx_version} \ %{?with_http2:--with-http_v2_module} \ --without-pcre2 \ --with-cc-opt="%{optflags} $(pcre-config --cflags) %{?tcp_fast_open: -DTCP_FASTOPEN=23} -Wno-uninitialized -Wno-unused-variable" \ $* make %{?_smp_mflags} (cd lua-resty-jump-consistent-hash \ && make libjchash.so) %install %{__rm} -rf $RPM_BUILD_ROOT %{__make} DESTDIR=$RPM_BUILD_ROOT install %{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/nginx %{__mv} $RPM_BUILD_ROOT%{_sysconfdir}/nginx/html $RPM_BUILD_ROOT%{_datadir}/nginx/ %{__rm} -f $RPM_BUILD_ROOT%{_sysconfdir}/nginx/*.default %{__rm} -f $RPM_BUILD_ROOT%{_sysconfdir}/nginx/fastcgi.conf %{__mkdir} -p $RPM_BUILD_ROOT%{_localstatedir}/log/nginx %{__mkdir} -p $RPM_BUILD_ROOT%{_localstatedir}/run/nginx %{__mkdir} -p $RPM_BUILD_ROOT%{_localstatedir}/cache/nginx %{__mkdir} -p $RPM_BUILD_ROOT%{_libdir}/nginx/modules cd $RPM_BUILD_ROOT%{_sysconfdir}/nginx && \ %{__ln_s} ../..%{_libdir}/nginx/modules modules && cd - %{__mkdir} -p $RPM_BUILD_ROOT%{_libdir}/nginx/modules-debug cd $RPM_BUILD_ROOT%{_sysconfdir}/nginx && \ %{__ln_s} ../..%{_libdir}/nginx/modules-debug modules-debug && cd - %{__mkdir} -p $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-core/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-cookie/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-http/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-string/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-lrucache/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-openidc/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-session/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-jwt/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-hmac/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-balancer/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-dns/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-lock/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-limit-traffic/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-memcached/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-memcached-shdict/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-mysql/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-redis/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-shdict-simple/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-shell/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-signal/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-upload/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-upstream-healthcheck/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-websocket/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/nginx-lua-saml-service-provider/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/nginx-lua-session/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-ffi-zlib/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/SLAXML/*.lua $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-woothee/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__cp} -pr %{_builddir}/%{name}-%{version}/lua-resty-jump-consistent-hash/lib/* $RPM_BUILD_ROOT%{_prefix}/lib/nginx/lua %{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/doc/%{name}-%{version} %{__install} -m 644 -p %{SOURCE12} \ $RPM_BUILD_ROOT%{_datadir}/doc/%{name}-%{version}/ %{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/nginx/conf.d %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/nginx/nginx.conf %{__install} -m 644 -p %{SOURCE4} \ $RPM_BUILD_ROOT%{_sysconfdir}/nginx/nginx.conf %{__install} -m 644 -p %{SOURCE5} \ $RPM_BUILD_ROOT%{_sysconfdir}/nginx/conf.d/default.conf %{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig %{__install} -m 644 -p %{SOURCE3} \ $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/nginx %{__install} -m 644 -p %{SOURCE7} \ $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/nginx-debug %if %{use_systemd} # install systemd-specific files %{__mkdir} -p $RPM_BUILD_ROOT%{_unitdir} %{__install} -m644 %SOURCE8 \ $RPM_BUILD_ROOT%{_unitdir}/nginx.service %{__install} -m644 %SOURCE11 \ $RPM_BUILD_ROOT%{_unitdir}/nginx-debug.service %{__mkdir} -p $RPM_BUILD_ROOT%{_libexecdir}/initscripts/legacy-actions/nginx %{__install} -m755 %SOURCE9 \ $RPM_BUILD_ROOT%{_libexecdir}/initscripts/legacy-actions/nginx/upgrade %else # install SYSV init stuff %{__mkdir} -p $RPM_BUILD_ROOT%{_initrddir} %{__install} -m755 nginx.init $RPM_BUILD_ROOT%{_initrddir}/nginx %{__install} -m755 nginx-debug.init $RPM_BUILD_ROOT%{_initrddir}/nginx-debug %endif # install log rotation stuff %{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d %if 0%{?suse_version} %{__install} -m 644 -p %{SOURCE10} \ $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/nginx %else %{__install} -m 644 -p %{SOURCE1} \ $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/nginx %endif %{__install} -m755 %{_builddir}/%{name}-%{version}/objs/nginx-debug \ $RPM_BUILD_ROOT%{_sbindir}/nginx-debug %{__install} -m755 %{_builddir}/%{name}-%{version}/objs-debug/*.so \ $RPM_BUILD_ROOT%{_libdir}/nginx/modules-debug/ %{__install} -m644 \ %{_builddir}/%{name}-%{version}/nginx-http-shibboleth/includes/shib_clear_headers \ %{_builddir}/%{name}-%{version}/nginx-http-shibboleth/includes/shib_fastcgi_params \ $RPM_BUILD_ROOT%{_sysconfdir}/nginx/ %{__install} -m755 -d $RPM_BUILD_ROOT%{_libdir}/lua/5.1 %{__install} -m644 \ %{_builddir}/%{name}-%{version}/lua-resty-jump-consistent-hash/libjchash.so \ $RPM_BUILD_ROOT%{_libdir}/lua/5.1/ %clean %{__rm} -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %{_sbindir}/nginx %{_sbindir}/nginx-debug %dir %{_sysconfdir}/nginx %dir %{_sysconfdir}/nginx/conf.d %{_sysconfdir}/nginx/modules %{_sysconfdir}/nginx/modules-debug %config(noreplace) %{_sysconfdir}/nginx/nginx.conf %config(noreplace) %{_sysconfdir}/nginx/conf.d/default.conf %config(noreplace) %{_sysconfdir}/nginx/mime.types %config(noreplace) %{_sysconfdir}/nginx/fastcgi_params %config(noreplace) %{_sysconfdir}/nginx/scgi_params %config(noreplace) %{_sysconfdir}/nginx/uwsgi_params %config(noreplace) %{_sysconfdir}/nginx/shib_clear_headers %config(noreplace) %{_sysconfdir}/nginx/shib_fastcgi_params %config(noreplace) %{_sysconfdir}/nginx/koi-utf %config(noreplace) %{_sysconfdir}/nginx/koi-win %config(noreplace) %{_sysconfdir}/nginx/win-utf %config(noreplace) %{_sysconfdir}/logrotate.d/nginx %config(noreplace) %{_sysconfdir}/sysconfig/nginx %config(noreplace) %{_sysconfdir}/sysconfig/nginx-debug %if %{use_systemd} %{_unitdir}/nginx.service %{_unitdir}/nginx-debug.service %dir %{_libexecdir}/initscripts/legacy-actions/nginx %{_libexecdir}/initscripts/legacy-actions/nginx/* %else %{_initrddir}/nginx %{_initrddir}/nginx-debug %endif %attr(0755,root,root) %dir %{_libdir}/nginx %attr(0755,root,root) %dir %{_libdir}/nginx/modules %attr(0755,root,root) %{_libdir}/nginx/modules/*.so %attr(0644,root,root) %{_libdir}/lua/5.1/libjchash.so %attr(0755,root,root) %dir %{_libdir}/nginx/modules-debug %attr(0755,root,root) %{_libdir}/nginx/modules-debug/*.so %attr(0755,root,root) %dir %{_prefix}/lib/nginx/lua %{_prefix}/lib/nginx/lua/* %dir %{_datadir}/nginx %dir %{_datadir}/nginx/html %{_datadir}/nginx/html/* %attr(0755,root,root) %dir %{_localstatedir}/cache/nginx %attr(0755,root,root) %dir %{_localstatedir}/log/nginx %doc %{_datadir}/doc/%{name}-%{version} %doc %{_datadir}/doc/%{name}-%{version}/COPYRIGHT %pre # Add the "nginx" user getent group %{nginx_group} >/dev/null || groupadd -r %{nginx_group} getent passwd %{nginx_user} >/dev/null || \ useradd -r -g %{nginx_group} -s /sbin/nologin \ -d %{nginx_home} -c "nginx user" %{nginx_user} exit 0 %post # Register the nginx service if [ $1 -eq 1 ]; then %if %{use_systemd} /usr/bin/systemctl preset nginx.service >/dev/null 2>&1 ||: /usr/bin/systemctl preset nginx-debug.service >/dev/null 2>&1 ||: %else /sbin/chkconfig --add nginx /sbin/chkconfig --add nginx-debug %endif # print site info cat </dev/null 2>&1 ||: /usr/bin/systemctl stop nginx.service >/dev/null 2>&1 ||: %else /sbin/service nginx stop > /dev/null 2>&1 /sbin/chkconfig --del nginx /sbin/chkconfig --del nginx-debug %endif fi %postun %if %use_systemd /usr/bin/systemctl daemon-reload >/dev/null 2>&1 ||: %endif if [ $1 -ge 1 ]; then /sbin/service nginx status >/dev/null 2>&1 || exit 0 /sbin/service nginx upgrade >/dev/null 2>&1 || echo \ "Binary upgrade failed, please check nginx's error.log" fi