From 0ba086218d4af7f44938604494a88f193baae5a7 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Mon, 30 Sep 2024 20:38:21 +0200 Subject: [PATCH] restore and fix nginx.conf patch with sites-enabled support and fix missing .conf extension in sites-available/default [release 1.27.1-2mamba;Mon Sep 30 2024] --- nginx-1.25.1-sites-modules-enabled.patch | 17 ------- nginx-1.27.1-sites-modules-enabled.patch | 65 ++++++++++++++++++++++++ nginx.spec | 27 +++++++--- 3 files changed, 85 insertions(+), 24 deletions(-) delete mode 100644 nginx-1.25.1-sites-modules-enabled.patch create mode 100644 nginx-1.27.1-sites-modules-enabled.patch diff --git a/nginx-1.25.1-sites-modules-enabled.patch b/nginx-1.25.1-sites-modules-enabled.patch deleted file mode 100644 index f8ccb3b..0000000 --- a/nginx-1.25.1-sites-modules-enabled.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- nginx-1.25.1/conf/nginx.conf.orig 2023-07-18 19:01:57.658604388 +0200 -+++ nginx-1.25.1/conf/nginx.conf 2023-07-18 19:04:02.998927347 +0200 -@@ -8,6 +8,7 @@ - - #pid logs/nginx.pid; - -+include modules-enabled/*.conf; - - events { - worker_connections 1024; -@@ -114,4 +115,6 @@ - # } - #} - -+ include sites-enabled/*; -+ - } diff --git a/nginx-1.27.1-sites-modules-enabled.patch b/nginx-1.27.1-sites-modules-enabled.patch new file mode 100644 index 0000000..06ef3b4 --- /dev/null +++ b/nginx-1.27.1-sites-modules-enabled.patch @@ -0,0 +1,65 @@ +--- nginx-1.27.1/conf/nginx.conf.orig 2024-09-30 16:49:15.157424362 +0200 ++++ nginx-1.27.1/conf/nginx.conf 2024-09-30 16:50:33.939591668 +0200 +@@ -8,6 +8,7 @@ + + #pid logs/nginx.pid; + ++include modules-enabled/*.conf; + + events { + worker_connections 1024; +@@ -32,27 +33,27 @@ + + #gzip on; + +- server { +- listen 80; +- server_name localhost; ++ #server { ++ #listen 80; ++ #server_name localhost; + + #charset koi8-r; + + #access_log logs/host.access.log main; + +- location / { +- root html; +- index index.html index.htm; +- } ++ #location / { ++ # root html; ++ # index index.html index.htm; ++ #} + + #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 html; +- } ++ #error_page 500 502 503 504 /50x.html; ++ #location = /50x.html { ++ # root html; ++ #} + + # proxy the PHP scripts to Apache listening on 127.0.0.1:80 + # +@@ -76,7 +77,7 @@ + #location ~ /\.ht { + # deny all; + #} +- } ++ #} + + + # another virtual host using mix of IP-, name-, and port-based configuration +@@ -114,4 +115,6 @@ + # } + #} + ++ include sites-enabled/*; ++ + } diff --git a/nginx.spec b/nginx.spec index b56839e..a873834 100644 --- a/nginx.spec +++ b/nginx.spec @@ -1,6 +1,6 @@ Name: nginx Version: 1.27.1 -Release: 1mamba +Release: 2mamba Summary: High Performance Load Balancer, Web Server and Reverse Proxy Group: System/Servers Vendor: openmamba @@ -11,7 +11,7 @@ Source: https://github.com/nginx/nginx.git/release-%{version}/nginx-%{ver Source1: nginx.service Source2: nginx-fastcgi-php.conf Source3: nginx-sites-available-default -Patch0: nginx-1.25.1-sites-modules-enabled.patch +Patch0: nginx-1.27.1-sites-modules-enabled.patch License: BSD ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel @@ -37,7 +37,8 @@ High Performance Load Balancer, Web Server and Reverse Proxy. %prep %setup -q #-D -T -#%patch0 -p1 +#:<< _EOF +%patch0 -p1 %build #:<< _EOF @@ -91,7 +92,7 @@ auto/configure \ install -D -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/nginx.service install -D -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/nginx/snippets/fastcgi-php.conf -install -D -m0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/nginx/sites-available/default +install -D -m0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/nginx/sites-available/default.conf install -d -m0755 %{buildroot}%{_sysconfdir}/nginx/sites-{available,enabled} install -d -m0755 %{buildroot}%{_sysconfdir}/nginx/modules-{available,enabled} @@ -107,7 +108,15 @@ find %{buildroot} -type f -name perllocal.pod -exec rm -f {} ';' [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %post -[ $1 -eq 1 ] && ln -s ../sites-available/default %{_sysconfdir}/nginx/sites-enabled/default +if [ $1 -eq 1 ]; then + # First install + ln -s ../sites-available/default.conf %{_sysconfdir}/nginx/sites-enabled/default.conf +fi +if [ $1 -gt 1 -a -L %{_sysconfdir}/nginx/sites-enabled/default ]; then + # Clean broken symlink from previous releases + rm %{_sysconfdir}/nginx/sites-enabled/default + ln -s ../sites-available/default.conf %{_sysconfdir}/nginx/sites-enabled/default.conf +fi %systemd_post nginx : @@ -116,7 +125,7 @@ find %{buildroot} -type f -name perllocal.pod -exec rm -f {} ';' : %postun -%systemd_postun nginx +%systemd_postun_with_restart nginx : %files @@ -134,7 +143,7 @@ find %{buildroot} -type f -name perllocal.pod -exec rm -f {} ';' %dir %{_sysconfdir}/nginx/snippets %{_sysconfdir}/nginx/snippets/fastcgi-php.conf %dir %{_sysconfdir}/nginx/sites-available -%config(noreplace) %{_sysconfdir}/nginx/sites-available/default +%config(noreplace) %{_sysconfdir}/nginx/sites-available/default.conf %dir %{_sysconfdir}/nginx/sites-enabled %dir %{_sysconfdir}/nginx/modules-available %dir %{_sysconfdir}/nginx/modules-enabled @@ -158,6 +167,10 @@ find %{buildroot} -type f -name perllocal.pod -exec rm -f {} ';' %{_mandir}/man3/nginx.3pm* %changelog +* Mon Sep 30 2024 Silvan Calarco 1.27.1-2mamba +- restore and fix nginx.conf patch with sites-enabled support +- and fix missing .conf extension in sites-available/default + * Thu Aug 15 2024 Automatic Build System 1.27.1-1mamba - automatic version update by autodist