diff --git a/nginx-1.6.1-default_config.patch b/nginx-conf.patch similarity index 81% rename from nginx-1.6.1-default_config.patch rename to nginx-conf.patch index 5b3ef73..543858f 100644 --- a/nginx-1.6.1-default_config.patch +++ b/nginx-conf.patch @@ -1,25 +1,27 @@ -Index: conf/nginx.conf -=================================================================== ---- conf/nginx.conf.orig -+++ conf/nginx.conf -@@ -1,16 +1,26 @@ +diff -Pdpru nginx-1.27.1.orig/conf/nginx.conf nginx-1.27.1/conf/nginx.conf +--- nginx-1.27.1.orig/conf/nginx.conf 2024-08-12 17:21:01.000000000 +0300 ++++ nginx-1.27.1/conf/nginx.conf 2024-08-16 02:08:46.680107766 +0300 +@@ -1,16 +1,28 @@ ++#user nginx nginx; ++#worker_processes 1; ++#pcre_jit off; -#user nobody; -+#user nginx; - worker_processes 1; - --#error_log logs/error.log; --#error_log logs/error.log notice; --#error_log logs/error.log info; +-worker_processes 1; +# load_module #LIBDIR#/nginx/modules/ngx_http_echo_module.so; +# load_module #LIBDIR#/nginx/modules/ngx_http_fancyindex_module.so; ++# load_module #LIBDIR#/nginx/modules/ngx_http_geoip2_module.so; +# load_module #LIBDIR#/nginx/modules/ngx_http_image_filter_module.so; +# load_module #LIBDIR#/nginx/modules/ngx_http_lua_module.so; +# load_module #LIBDIR#/nginx/modules/ngx_http_perl_module.so; +# load_module #LIBDIR#/nginx/modules/ngx_http_xslt_filter_module.so; +# load_module #LIBDIR#/nginx/modules/ngx_mail_module.so; ++# load_module #LIBDIR#/nginx/modules/ngx_stream_geoip2_module.so; +# load_module #LIBDIR#/nginx/modules/ngx_stream_module.so; -+ + +-#error_log logs/error.log; +-#error_log logs/error.log notice; +-#error_log logs/error.log info; +#error_log /var/log/nginx/error.log; +#error_log /var/log/nginx/error.log notice; +#error_log /var/log/nginx/error.log info; @@ -34,7 +36,7 @@ Index: conf/nginx.conf } -@@ -22,7 +32,7 @@ http { +@@ -22,7 +34,7 @@ http { # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; @@ -43,7 +45,7 @@ Index: conf/nginx.conf sendfile on; #tcp_nopush on; -@@ -32,16 +42,18 @@ http { +@@ -32,16 +44,18 @@ http { #gzip on; @@ -64,7 +66,7 @@ Index: conf/nginx.conf index index.html index.htm; } -@@ -51,7 +63,7 @@ http { +@@ -51,7 +65,7 @@ http { # error_page 500 502 503 504 /50x.html; location = /50x.html { @@ -73,16 +75,16 @@ Index: conf/nginx.conf } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 -@@ -63,7 +75,7 @@ http { +@@ -63,7 +77,7 @@ http { # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { - # root html; -+ # root /srv/www/htdocs/; ++ # root /srv/www/htdocs/; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; -@@ -87,7 +99,7 @@ http { +@@ -87,7 +101,7 @@ http { # server_name somename alias another.alias; # location / { @@ -91,7 +93,7 @@ Index: conf/nginx.conf # index index.html index.htm; # } #} -@@ -102,6 +114,10 @@ http { +@@ -102,6 +116,10 @@ http { # ssl_certificate cert.pem; # ssl_certificate_key cert.key; @@ -102,7 +104,7 @@ Index: conf/nginx.conf # ssl_session_cache shared:SSL:1m; # ssl_session_timeout 5m; -@@ -109,9 +125,11 @@ http { +@@ -109,9 +127,11 @@ http { # ssl_prefer_server_ciphers on; # location / { diff --git a/nginx-1.2.4-perl_vendor_install.patch b/nginx-perl.patch similarity index 53% rename from nginx-1.2.4-perl_vendor_install.patch rename to nginx-perl.patch index a47016f..bb05467 100644 --- a/nginx-1.2.4-perl_vendor_install.patch +++ b/nginx-perl.patch @@ -1,8 +1,7 @@ -Index: auto/install -=================================================================== ---- auto/install.orig -+++ auto/install -@@ -8,7 +8,7 @@ if [ $USE_PERL = YES ]; then +diff -Pdpru nginx-1.27.1.orig/auto/install nginx-1.27.1/auto/install +--- nginx-1.27.1.orig/auto/install 2024-08-12 17:21:01.000000000 +0300 ++++ nginx-1.27.1/auto/install 2024-08-16 01:34:07.040688796 +0300 +@@ -8,7 +8,7 @@ if [ $USE_PERL != NO ]; then cat << END >> $NGX_MAKEFILE install_perl_modules: diff --git a/nginx.changes b/nginx.changes index 7bd14d3..f25ede7 100644 --- a/nginx.changes +++ b/nginx.changes @@ -1,7 +1,9 @@ ------------------------------------------------------------------- -Thu Aug 15 21:10:25 UTC 2024 - Илья Индиго +Fri Aug 16 00:03:37 UTC 2024 - Илья Индиго -- Changed nginx-1.6.1-default_config.patch file (added ngx_http_fancyindex_module.so). +- Renamed nginx-1.6.1-default_config.patch to nginx-conf.patch. +- Renamed nginx-1.2.4-perl_vendor_install.patch to nginx-perl.patch. +- Used atosetup -p1 macro and replaced editor from perl to sed. - Updated to 1.27.1 * https://nginx.org/en/CHANGES * Fixed crash in ngx_http_mp4_module via specially crafted mp4 file (CVE-2024-7347). diff --git a/nginx.spec b/nginx.spec index 4c35429..3d14c62 100644 --- a/nginx.spec +++ b/nginx.spec @@ -41,9 +41,9 @@ Patch0: %{name}-1.11.2-no_Werror.patch # PATCH-FIX-OPENSUSE nginx-1.11.2-html.patch Patch1: %{name}-1.11.2-html.patch # PATCH-FIX-UPSTREAM nginx-1.2.4-perl_vendor_install.patch -Patch2: %{name}-1.2.4-perl_vendor_install.patch +Patch2: %{name}-perl.patch # PATCH-FIX-UPSTREAM fix /etc/nginx/nginx.conf to suit Linux env -Patch3: %{name}-1.6.1-default_config.patch +Patch3: %{name}-conf.patch # PATCH-FIX-UPSTREAM nginx-aio.patch fix support for Linux AIO Patch4: %{name}-aio.patch BuildRequires: %{name}-macros @@ -96,19 +96,13 @@ BuildArch: noarch The source of %{name} [engine x] HTTP server and IMAP/POP3 proxy server. %prep -%setup -q -%patch -P 0 -p1 -%patch -P 1 -p1 -%patch -P 2 -%patch -P 3 -%patch -P 4 -p1 +%autosetup -p1 -perl -pi -e 's|\r\n|\n|g' contrib/geo2nginx.pl -# we just use lib here because nginx loads them relative to _prefix -perl -pi -e 's|#LIBDIR#|%{_lib}|g' conf/nginx.conf +sed -i 's/\r//g' contrib/geo2nginx.pl +sed -i 's|#LIBDIR#|%{_libdir}|g' conf/nginx.conf %if %{with systemd} -sed -i "s/\/var\/run/\/run/" conf/nginx.conf +sed -i 's/\/var\/run/\/run/' conf/nginx.conf %endif sed -i 's/^\(#define NGX_LISTEN_BACKLOG \).*/\1-1/' src/os/unix/ngx_linux_config.h @@ -127,7 +121,6 @@ install -dpm0750 %{buildroot}%{ngx_home}/{,tmp,proxy,fastcgi,scgi,uwsgi} install -Dpm0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} install -Dpm0644 %{SOURCE5} %{buildroot}%{_unitdir}/%{name}.service install -Dpm0644 %{SOURCE6} %{buildroot}%{_sysusersdir}/%{name}.conf -ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name} rm %{buildroot}/srv/www/htdocs/index.html @@ -198,7 +191,6 @@ copydocs() { %{ngx_module_dir}/ngx_stream_module.so %{_mandir}/man3/%{name}.3pm* /srv/www/htdocs/50x.html -%{_sbindir}/rc%{name} %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %dir %attr(750,%{ngx_user_group},%{ngx_user_group}) %{_localstatedir}/log/nginx/ %dir %attr(750,%{ngx_user_group},%{ngx_user_group}) %{ngx_home}/