@@ -6,7 +6,7 @@ Name: nginx
66# Currently on "stable" version of nginx from https://nginx.org/en/download.html.
77# Note: Stable versions are even (1.20), mainline versions are odd (1.21)
88Version: 1.25.4
9- Release: 3 %{?dist }
9+ Release: 4 %{?dist }
1010License: BSD-2-Clause
1111Vendor: Microsoft Corporation
1212Distribution: Azure Linux
@@ -15,11 +15,24 @@ URL: https://nginx.org/
1515Source0: https://nginx.org/download/%{name }-%{version }.tar.gz
1616Source1: nginx.service
1717Source2: https://github.com/nginx/njs/archive/refs/tags/%{njs_version }.tar.gz#/%{name}-njs-%{njs_version}.tar.gz
18+
19+ %if 0%{?with_check }
20+ Source3: nginx-tests.tgz
21+ %endif
22+
1823Patch0: CVE-2024-7347.patch
1924Patch1: CVE-2025-23419.patch
2025BuildRequires: libxml2-devel
2126BuildRequires: libxslt-devel
2227BuildRequires: openssl-devel
28+
29+ %if 0%{?with_check }
30+ BuildRequires: perl-FindBin
31+ BuildRequires: perl-Test-Harness
32+ BuildRequires: perl-lib
33+ BuildRequires: perl-App-cpanminus
34+ %endif
35+
2336BuildRequires: pcre2-devel
2437BuildRequires: readline-devel
2538BuildRequires: which
@@ -54,7 +67,7 @@ The OpenTelemetry module for Nginx
5467%prep
5568%autosetup -p1
5669pushd ../
57- mkdir nginx-njs
70+ mkdir -p nginx-njs
5871tar -C nginx-njs -xf %{SOURCE2 }
5972
6073%build
@@ -71,6 +84,7 @@ sh configure \
7184 --user=%{nginx_user } \
7285 --with-stream_ssl_module \
7386 --with-http_auth_request_module \
87+ --with-http_dav_module \
7488 --with-http_gunzip_module \
7589 --with-http_gzip_static_module \
7690 --with-http_realip_module \
@@ -102,6 +116,26 @@ getent passwd %{nginx_user} > /dev/null || \
102116 -s /sbin/nologin -c " Nginx web server" %{nginx_user }
103117exit 0
104118
119+ %if 0%{?with_check }
120+ %check
121+ cpanm Test::Simple@1.302199 --force
122+ cpanm Time::HiRes
123+ cd %{buildroot }
124+ cp -r usr/sbin/* /usr/sbin/
125+ cp -r var/opt/* /var/opt/
126+ cp -r var/log/* /var/log/
127+ cp -r usr/lib/debug/usr/sbin/* /usr/lib/debug/sbin/
128+ cp -r usr/lib/systemd/* /usr/lib/systemd/
129+ cp -r etc/* /etc/
130+ cp /etc/nginx/mime.types.default /etc/nginx/mime.types
131+ useradd -s /usr/bin/sh %{nginx_user }
132+ tar -xvf %{SOURCE3 }
133+ cd nginx-tests
134+ su nginx -s /bin/sh -c ' TEST_NGINX_BINARY=%{_sbindir}/nginx prove ./*.t'
135+ cd ..
136+ rm -rf nginx-tests
137+ %endif
138+
105139%files
106140%defattr(-,root,root)
107141%license LICENSE
@@ -129,6 +163,10 @@ exit 0
129163%dir %{_sysconfdir }/%{name }
130164
131165%changelog
166+ * Tue Mar 11 2025 Sandeep Karambelkar <skarambelkar@microsoft.com> - 1.25.4-4
167+ - Enable webdav module
168+ - Added tests to verify nginx server and its supported modules
169+
132170* Tue Feb 10 2025 Mitch Zhu <mitchzhu@microsoft.com> - 1.25.4-3
133171- Fix CVE-2025-234419
134172
0 commit comments