1+ %define majmin %(echo %{version } | cut -d. -f1-2)
2+
13Summary: MySQL.
24Name: mysql
35Version: 8.0.40
4- Release: 1 %{?dist }
6+ Release: 2 %{?dist }
57License: GPLv2 with exceptions AND LGPLv2 AND BSD
68Vendor: Microsoft Corporation
79Distribution: Azure Linux
810Group: Applications/Databases
911URL: https://www.mysql.com
10- Source0: https://dev.mysql.com/get/Downloads/MySQL-8.0 /%{name }-boost-%{version }.tar.gz
12+ Source0: https://dev.mysql.com/get/Downloads/MySQL-%{ majmin } /%{name }-boost-%{version }.tar.gz
1113Patch0: CVE-2012-5627.nopatch
14+ # AZL's OpenSSL builds with the "no-chacha" option making all ChaCha
15+ # ciphers unavailable.
16+ Patch1: fix-tests-for-unsupported-chacha-ciphers.patch
1217BuildRequires: cmake
1318BuildRequires: libtirpc-devel
1419BuildRequires: openssl-devel
20+ BuildRequires: protobuf-devel
1521BuildRequires: rpcsvc-proto-devel
1622BuildRequires: zlib-devel
23+ %if 0%{?with_check }
24+ BuildRequires: shadow-utils
25+ BuildRequires: sudo
26+ %endif
1727
1828%description
1929MySQL is a free, widely used SQL engine. It can be used as a fast database as well as a rock-solid DBMS using a modular engine architecture.
@@ -28,10 +38,15 @@ Development headers for developing applications linking to maridb
2838%prep
2939%autosetup -p1
3040
41+ # Remove unused, bundled version of protobuf.
42+ # We're building with the '-DWITH_PROTOBUF=system' option.
43+ rm -r extra/protobuf
44+
3145%build
3246cmake . \
3347 -DCMAKE_INSTALL_PREFIX=%{_prefix } \
3448 -DWITH_BOOST=boost/boost_1_77_0 \
49+ -DWITH_PROTOBUF=system \
3550 -DINSTALL_MANDIR=share/man \
3651 -DINSTALL_DOCDIR=share/doc \
3752 -DINSTALL_DOCREADMEDIR=share/doc \
@@ -48,7 +63,13 @@ make %{?_smp_mflags}
4863make DESTDIR=%{buildroot } install
4964
5065%check
51- make test
66+ # Tests expect to be run as a non-root user.
67+ groupadd test
68+ useradd test -g test -m
69+ chown -R test:test .
70+
71+ # In case of failure, print the test log.
72+ sudo -u test make test || { cat Testing/Temporary/LastTest.log; false; }
5273
5374%files
5475%defattr(-,root,root)
@@ -58,7 +79,6 @@ make test
5879%{_libdir }/* .so.*
5980%{_libdir }/mysqlrouter/* .so*
6081%{_libdir }/mysqlrouter/private/* .so*
61- %{_libdir }/private/* .so*
6282%{_bindir }/*
6383%{_mandir }/man1/*
6484%{_mandir }/man8/*
@@ -83,6 +103,9 @@ make test
83103%{_libdir }/pkgconfig/mysqlclient.pc
84104
85105%changelog
106+ * Mon Oct 28 2024 Pawel Winogrodzki <pawelwi@microsoft.com> - 8.0.40-2
107+ - Switch to ALZ version of protobuf instead of using the bundled one.
108+
86109* Fri Oct 18 2024 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 8.0.40-1
87110- Auto-upgrade to 8.0.40 - Fix multiple CVEs -- CVE-2024-21193, CVE-2024-21194, CVE-2024-21162, CVE-2024-21157, CVE-2024-21130,
88111 CVE-2024-20996, CVE-2024-21129, CVE-2024-21159, CVE-2024-21135, CVE-2024-21173, CVE-2024-21160, CVE-2024-21125, CVE-2024-21134,
0 commit comments