diff --git a/firefox.spec b/firefox.spec index cce344e..7f57caf 100644 --- a/firefox.spec +++ b/firefox.spec @@ -7,37 +7,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 @@ -160,7 +149,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 @@ -383,7 +372,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 @@ -608,7 +597,7 @@ https://extensions.gnome.org. %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}" @@ -651,7 +640,7 @@ sed -ie 's|/usr/include|/app/include|' %_sourcedir/firefox-pipewire-0-3.patch %endif %if 0%{?rhel} >= 8 - %if 0%{?rhel_minor_version} >= 3 + %if %{rhel_minor_version} >= 3 %patch235 -p1 -b .pipewire-0-3 %else