From 0646bec5033293f24ac8875e7c59ef9ebc42bbd9 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Fri, 11 Dec 2020 00:13:26 -0500 Subject: [PATCH] Related: #1979490 Handle module-build-service tags when detecting minor version Instead of a hard-coded list of .el8_N => N, use a bit of lua to pattern match both .el8_N and also something like .module+el8.Y.Z+2+3b9e7ff5 x-Related: RHELPLAN-44129 (cherry picked from commit 6108038596daf9c370968afbc125582661bb112f) Conflicts: thunderbird.spec Adapted from rhel-8.4.0 (cherry picked from commit a68c1a0a8a566d5993fe7235404e287ceb5630d4) Conflicts: thunderbird.spec --- thunderbird.spec | 49 +++++++++++++++++++----------------------------- 1 file changed, 19 insertions(+), 30 deletions(-) diff --git a/thunderbird.spec b/thunderbird.spec index cf4a051..e80bfa1 100644 --- a/thunderbird.spec +++ b/thunderbird.spec @@ -6,37 +6,26 @@ %global debug_package %{nil} %endif -%global rhel_minor_version -1 -%if 0%{?flatpak:1} -%global rhel_minor_version 4 -%endif -%if "%{?dist}" == ".el8" -%global rhel_minor_version 5 -%endif -%if "%{?dist}" == ".el8_4" -%global rhel_minor_version 4 -%endif -%if "%{?dist}" == ".el8_3" -%global rhel_minor_version 3 -%endif -%if "%{?dist}" == ".el8_2" -%global rhel_minor_version 2 -%endif -%if "%{?dist}" == ".el8_1" -%global rhel_minor_version 1 -%endif -%if "%{?dist}" == ".el8_0" -%global rhel_minor_version 0 -%endif -%if "%{?dist}" == ".el9" -%global rhel_minor_version 4 -%endif +%{lua: +function dist_to_rhel_minor(str, start) + match = string.match(str, ".module%+el8.%d+") + if match then + return string.sub(match, 13) + end + match = string.match(str, ".el8_%d+") + if match then + return string.sub(match, 6) + end + return -1 +end} + +%global rhel_minor_version %{lua:print(dist_to_rhel_minor(rpm.expand("%dist")))} %global system_nss 1 %global bundle_nss 0 %if 0%{?rhel} >= 8 - %if 0%{?rhel_minor_version} < 2 + %if %{rhel_minor_version} < 2 %global bundle_nss 1 %endif %endif @@ -151,7 +140,7 @@ %define use_bundled_yasm 0 %if 0%{?rhel} >= 8 - %if 0%{?rhel_minor_version} <= 2 + %if %{rhel_minor_version} <= 2 %define use_bundled_nodejs 1 %endif %endif @@ -361,7 +350,7 @@ BuildRequires: openssl-devel %endif %if 0%{?rhel} >= 8 - %if 0%{?rhel_minor_version} >= 3 + %if %{rhel_minor_version} >= 3 BuildRequires: pkgconfig(libpipewire-0.3) %else BuildRequires: pipewire-devel @@ -496,7 +485,7 @@ Mozilla Thunderbird is a standalone mail and newsgroup client. %prep echo "Build environment" echo "dist %{?dist}" -echo "RHEL 8 minor version: %{?rhel_minor_version}" +echo "RHEL 8 minor version: %{rhel_minor_version}" echo "use_bundled_ffi %{?use_bundled_ffi}" echo "use_bundled_python_2 %{?use_bundled_python_2}" echo "use_bundled_python_3 %{?use_bundled_python_3}" @@ -532,7 +521,7 @@ echo "use_bundled_yasm %{?use_bundled_yasm}" %patch219 -p1 -b .rhbz-1173156 %patch224 -p1 -b .1170092 %if 0%{?rhel} >= 8 - %if 0%{?rhel_minor_version} >= 3 + %if %{rhel_minor_version} >= 3 %patch235 -p1 -b .pipewire-0-3 %else %patch231 -p1 -b .pipewire