From 59fb3e782eefd9190e4dbc80ff5c76fa056293b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Wed, 8 Nov 2017 08:51:56 +0000 Subject: [PATCH 1/7] use global instead of define --- firefox.spec | 54 ++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/firefox.spec b/firefox.spec index 2ce4939..6ce8d5b 100644 --- a/firefox.spec +++ b/firefox.spec @@ -3,59 +3,59 @@ ExcludeArch: armv7hl %endif # Use system nspr/nss? -%define system_nss 1 +%global system_nss 1 # Use system hunspell? %if 0%{?fedora} > 25 -%define system_hunspell 1 +%global system_hunspell 1 %else -%define system_hunspell 0 +%global system_hunspell 0 %endif # Use system sqlite? %if 0%{?fedora} > 27 -%define system_sqlite 1 +%global system_sqlite 1 %else -%define system_sqlite 0 +%global system_sqlite 0 %endif -%define system_ffi 1 +%global system_ffi 1 # Use system cairo? -%define system_cairo 0 +%global system_cairo 0 # Use system libvpx? -%define system_libvpx 1 +%global system_libvpx 1 # Use system libicu? %if 0%{?fedora} > 27 -%define system_libicu 0 +%global system_libicu 0 %else -%define system_libicu 0 +%global system_libicu 0 %endif # Big endian platforms %ifarch ppc64 s390x # Javascript Intl API is not supported on big endian platforms right now: # https://bugzilla.mozilla.org/show_bug.cgi?id=1322212 -%define big_endian 1 +%global big_endian 1 %endif # Hardened build? -%define hardened_build 1 +%global hardened_build 1 -%define system_jpeg 1 +%global system_jpeg 1 %ifarch %{ix86} x86_64 -%define run_tests 0 +%global run_tests 0 %else -%define run_tests 0 +%global run_tests 0 %endif # Build as a debug package? -%define debug_build 0 +%global debug_build 0 -%define default_bookmarks_file %{_datadir}/bookmarks/default-bookmarks.html -%define firefox_app_id \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\} +%global default_bookmarks_file %{_datadir}/bookmarks/default-bookmarks.html +%global firefox_app_id \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\} # Minimal required versions %global cairo_version 1.13.1 %global freetype_version 2.1.9 @@ -81,21 +81,21 @@ ExcludeArch: armv7hl %global sqlite_build_version %(pkg-config --silence-errors --modversion sqlite3 2>/dev/null || echo 65536) %endif -%define pre_version b14 +%global pre_version b14 %global mozappdir %{_libdir}/%{name} %global mozappdirdev %{_libdir}/%{name}-devel-%{version} %global langpackdir %{mozappdir}/langpacks %global tarballdir %{name}-%{version}%{?pre_version} -%define official_branding 1 -%define build_langpacks 1 +%global official_branding 1 +%global build_langpacks 1 -%define enable_mozilla_crashreporter 0 +%global enable_mozilla_crashreporter 0 %if !%{debug_build} %ifarch %{ix86} x86_64 %if 0%{?fedora} < 27 -%define enable_mozilla_crashreporter 1 +%global enable_mozilla_crashreporter 1 %endif %endif %endif @@ -402,19 +402,19 @@ echo "ac_add_options --disable-system-hunspell" >> .mozconfig echo "ac_add_options --enable-debug" >> .mozconfig echo "ac_add_options --disable-optimize" >> .mozconfig %else -%define optimize_flags "none" +%global optimize_flags "none" # Fedora 26 (gcc7) needs to disable default build flags (mozbz#1342344) %if 0%{?fedora} > 25 %ifnarch s390 s390x -%define optimize_flags "-g -O2" +%global optimize_flags "-g -O2" %endif %endif %ifarch armv7hl # ARMv7 need that (rhbz#1426850) -%define optimize_flags "-g -O2 -fno-schedule-insns" +%global optimize_flags "-g -O2 -fno-schedule-insns" %endif %ifarch ppc64le aarch64 -%define optimize_flags "-g -O2" +%global optimize_flags "-g -O2" %endif %if %{optimize_flags} != "none" echo 'ac_add_options --enable-optimize=%{?optimize_flags}' >> .mozconfig From 64d07f925f9314a77ec06273bc5e1326953d3bcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Wed, 8 Nov 2017 08:59:41 +0000 Subject: [PATCH 2/7] remove Group it is nowdays recommended to not use it --- firefox.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/firefox.spec b/firefox.spec index 6ce8d5b..fe7d8cc 100644 --- a/firefox.spec +++ b/firefox.spec @@ -106,7 +106,6 @@ Version: 57.0 Release: 0.9%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ -Group: Applications/Internet Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{build_langpacks} Source1: firefox-langpacks-%{version}%{?pre_version}-20171106.tar.xz @@ -274,7 +273,6 @@ compliance, performance and portability. %global crashreporter_pkg_name mozilla-crashreporter-%{name}-debuginfo %package -n %{crashreporter_pkg_name} Summary: Debugging symbols used by Mozilla's crash reporter servers -Group: Development/Debug %description -n %{crashreporter_pkg_name} This package provides debug information for Firefox, for use by Mozilla's crash reporter servers. If you are trying to locally @@ -287,7 +285,6 @@ debug %{name}, you want to install %{name}-debuginfo instead. %global testsuite_pkg_name mozilla-%{name}-testresults %package -n %{testsuite_pkg_name} Summary: Results of testsuite -Group: Development/Debug %description -n %{testsuite_pkg_name} This package contains results of tests executed during build. %files -n %{testsuite_pkg_name} From 7a6ed0983be755f9c1016e2dffca32eeaf13c837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Wed, 8 Nov 2017 09:29:41 +0000 Subject: [PATCH 3/7] remove defattr this is system default, no need to duplicate it --- firefox.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/firefox.spec b/firefox.spec index fe7d8cc..775527c 100644 --- a/firefox.spec +++ b/firefox.spec @@ -278,7 +278,6 @@ This package provides debug information for Firefox, for use by Mozilla's crash reporter servers. If you are trying to locally debug %{name}, you want to install %{name}-debuginfo instead. %files -n %{crashreporter_pkg_name} -f debugcrashreporter.list -%defattr(-,root,root) %endif %if %{run_tests} @@ -289,7 +288,6 @@ Summary: Results of testsuite This package contains results of tests executed during build. %files -n %{testsuite_pkg_name} /test_results -%defattr(-,root,root) %endif #--------------------------------------------------------------------- @@ -794,7 +792,6 @@ fi gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %files -f %{name}.lang -%defattr(-,root,root,-) %{_bindir}/firefox %{mozappdir}/firefox %{mozappdir}/firefox-bin From 151cfe2392549460ec843cc5ba770e6e32f24f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Wed, 8 Nov 2017 09:31:15 +0000 Subject: [PATCH 4/7] use modern macro optflags --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 775527c..c2050d3 100644 --- a/firefox.spec +++ b/firefox.spec @@ -492,7 +492,7 @@ find ./ -name config.guess -exec cp /usr/lib/rpm/config.guess {} ';' # # Disable C++ exceptions since Mozilla code is not exception-safe # -MOZ_OPT_FLAGS=$(echo "$RPM_OPT_FLAGS" | %{__sed} -e 's/-Wall//') +MOZ_OPT_FLAGS=$(echo "%{optflags}" | %{__sed} -e 's/-Wall//') #rhbz#1037063 # -Werror=format-security causes build failures when -Wno-format is explicitly given # for some sources From b74872660ed7b15c2d8ab8661e8a9c7668dd049a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Wed, 8 Nov 2017 09:35:53 +0000 Subject: [PATCH 5/7] use modern macro buildroot --- firefox.spec | 72 ++++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/firefox.spec b/firefox.spec index c2050d3..2fa7047 100644 --- a/firefox.spec +++ b/firefox.spec @@ -588,32 +588,32 @@ rm -f objdir/dist/bin/pk12util pref("general.useragent.locale", "chrome://global/locale/intl.properties"); EOF -DESTDIR=$RPM_BUILD_ROOT make -C objdir install +DESTDIR=%{buildroot} make -C objdir install -%{__mkdir_p} $RPM_BUILD_ROOT{%{_libdir},%{_bindir},%{_datadir}/applications} +%{__mkdir_p} %{buildroot}{%{_libdir},%{_bindir},%{_datadir}/applications} -desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications %{SOURCE20} +desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE20} # set up the firefox start script -%{__rm} -rf $RPM_BUILD_ROOT%{_bindir}/firefox -%{__cat} %{SOURCE21} > $RPM_BUILD_ROOT%{_bindir}/firefox -%{__chmod} 755 $RPM_BUILD_ROOT%{_bindir}/firefox +%{__rm} -rf %{buildroot}%{_bindir}/firefox +%{__cat} %{SOURCE21} > %{buildroot}%{_bindir}/firefox +%{__chmod} 755 %{buildroot}%{_bindir}/firefox -%{__install} -p -D -m 644 %{SOURCE23} $RPM_BUILD_ROOT%{_mandir}/man1/firefox.1 +%{__install} -p -D -m 644 %{SOURCE23} %{buildroot}%{_mandir}/man1/firefox.1 -%{__rm} -f $RPM_BUILD_ROOT/%{mozappdir}/firefox-config -%{__rm} -f $RPM_BUILD_ROOT/%{mozappdir}/update-settings.ini +%{__rm} -f %{buildroot}/%{mozappdir}/firefox-config +%{__rm} -f %{buildroot}/%{mozappdir}/update-settings.ini for s in 16 22 24 32 48 256; do - %{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${s}x${s}/apps + %{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps %{__cp} -p browser/branding/official/default${s}.png \ - $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${s}x${s}/apps/firefox.png + %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps/firefox.png done # Install hight contrast icon -%{__mkdir_p} $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/symbolic/apps +%{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps %{__cp} -p %{SOURCE25} \ - $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/symbolic/apps + %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps # Register as an application to be visible in the software center # @@ -622,8 +622,8 @@ done # # See http://www.freedesktop.org/software/appstream/docs/ for more details. # -mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata -cat > $RPM_BUILD_ROOT%{_datadir}/appdata/%{name}.appdata.xml < %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml <