MozillaFirefox/MozillaFirefox.spec
branchfirefox71
changeset 1117 d6a688186de0
parent 1116 52b1745787cf
child 1118 27c3f029180a
equal deleted inserted replaced
1116:52b1745787cf 1117:d6a688186de0
     1 #
     1 #
     2 # spec file for package MozillaFirefox
     2 # spec file for package MozillaFirefox
     3 #
     3 #
     4 # Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
     4 # Copyright (c) 2019 SUSE LLC
     5 #               2006-2019 Wolfgang Rosenauer <wr@rosenauer.org>
     5 #               2006-2019 Wolfgang Rosenauer <wr@rosenauer.org>
     6 #
     6 #
     7 # All modifications and additions to the file contributed by third parties
     7 # All modifications and additions to the file contributed by third parties
     8 # remain the property of their copyright owners, unless otherwise agreed
     8 # remain the property of their copyright owners, unless otherwise agreed
     9 # upon. The license for this file, and modifications and additions to the
     9 # upon. The license for this file, and modifications and additions to the
    16 # Please submit bugfixes or comments via https://bugs.opensuse.org/
    16 # Please submit bugfixes or comments via https://bugs.opensuse.org/
    17 #
    17 #
    18 
    18 
    19 
    19 
    20 # changed with every update
    20 # changed with every update
    21 %define major          70
    21 %define major          71
    22 %define mainver        %major.99
    22 %define mainver        %major.0
    23 %define orig_version   71.0
    23 %define orig_version   71.0
    24 %define orig_suffix    b11
    24 %define orig_suffix    %{nil}
    25 %define update_channel beta
    25 %define update_channel release
    26 %define branding       1
    26 %define branding       1
    27 %define devpkg         1
    27 %define devpkg         1
    28 
    28 
    29 # always build with GCC as SUSE Security Team requires that
    29 # always build with GCC as SUSE Security Team requires that
    30 %define clang_build 0
    30 %define clang_build 1
    31 
    31 
    32 # PIE, full relro
    32 # PIE, full relro
    33 %define build_hardened 1
    33 %define build_hardened 1
    34 
    34 
    35 %bcond_with only_print_mozconfig
    35 %bcond_with only_print_mozconfig
   135 %define kde_helper_version 6
   135 %define kde_helper_version 6
   136 Provides:       mozilla-kde4-version = %{kde_helper_version}
   136 Provides:       mozilla-kde4-version = %{kde_helper_version}
   137 Summary:        Mozilla %{appname} Web Browser
   137 Summary:        Mozilla %{appname} Web Browser
   138 License:        MPL-2.0
   138 License:        MPL-2.0
   139 Group:          Productivity/Networking/Web/Browsers
   139 Group:          Productivity/Networking/Web/Browsers
   140 Url:            http://www.mozilla.org/
   140 URL:            http://www.mozilla.org/
   141 %if !%{with only_print_mozconfig}
   141 %if !%{with only_print_mozconfig}
   142 Source:         http://ftp.mozilla.org/pub/%{srcname}/releases/%{version}%{orig_suffix}/source/%{srcname}-%{orig_version}%{orig_suffix}.source.tar.xz
   142 Source:         http://ftp.mozilla.org/pub/%{srcname}/releases/%{version}%{orig_suffix}/source/%{srcname}-%{orig_version}%{orig_suffix}.source.tar.xz
   143 Source1:        MozillaFirefox.desktop
   143 Source1:        MozillaFirefox.desktop
   144 Source2:        MozillaFirefox-rpmlintrc
   144 Source2:        MozillaFirefox-rpmlintrc
   145 Source3:        mozilla.sh.in
   145 Source3:        mozilla.sh.in
   146 Source4:        tar_stamps
   146 Source4:        tar_stamps
   147 Source7:        l10n-%{orig_version}%{orig_suffix}.tar.xz
   147 Source7:        l10n-%{orig_version}%{orig_suffix}.tar.xz
   148 Source8:        firefox-mimeinfo.xml
   148 Source8:        firefox-mimeinfo.xml
   149 Source9:        firefox.js
   149 Source9:        firefox.js
   150 Source10:       compare-locales.tar.xz
       
   151 Source11:       firefox.1
   150 Source11:       firefox.1
   152 Source12:       mozilla-get-app-id
   151 Source12:       mozilla-get-app-id
   153 Source13:       spellcheck.js
   152 Source13:       spellcheck.js
   154 Source14:       https://github.com/openSUSE/firefox-scripts/raw/04d38e104a6ecdea33442755282688e8090ffa66/create-tar.sh
   153 Source14:       https://github.com/openSUSE/firefox-scripts/raw/d414e38/create-tar.sh
   155 Source15:       firefox-appdata.xml
   154 Source15:       firefox-appdata.xml
   156 Source16:       %{name}.changes
   155 Source16:       %{name}.changes
   157 # Set up API keys, see http://www.chromium.org/developers/how-tos/api-keys
   156 # Set up API keys, see http://www.chromium.org/developers/how-tos/api-keys
   158 # Note: these are for the openSUSE Firefox builds ONLY. For your own distribution,
   157 # Note: these are for the openSUSE Firefox builds ONLY. For your own distribution,
   159 # please get your own set of keys.
   158 # please get your own set of keys.
   182 Patch18:        mozilla-bmo1554971.patch
   181 Patch18:        mozilla-bmo1554971.patch
   183 Patch19:        mozilla-bmo1512162.patch
   182 Patch19:        mozilla-bmo1512162.patch
   184 Patch20:        mozilla-fix-top-level-asm.patch
   183 Patch20:        mozilla-fix-top-level-asm.patch
   185 Patch21:        mozilla-bmo1504834-part4.patch
   184 Patch21:        mozilla-bmo1504834-part4.patch
   186 Patch22:        mozilla-bmo849632.patch
   185 Patch22:        mozilla-bmo849632.patch
       
   186 Patch23:        mozilla-gcc9-lto.patch
   187 # Firefox/browser
   187 # Firefox/browser
   188 Patch101:       firefox-kde.patch
   188 Patch101:       firefox-kde.patch
   189 Patch102:       firefox-branded-icons.patch
   189 Patch102:       firefox-branded-icons.patch
   190 %endif # only_print_mozconfig
   190 %endif # only_print_mozconfig
   191 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
   191 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
   288 if (( $(stat -Lc%s "%{SOURCE7}") < MINSIZE)); then
   288 if (( $(stat -Lc%s "%{SOURCE7}") < MINSIZE)); then
   289     echo "Translations tarball %{SOURCE7} not generated properly."
   289     echo "Translations tarball %{SOURCE7} not generated properly."
   290     exit 1
   290     exit 1
   291 fi
   291 fi
   292 
   292 
   293 %setup -q -n %{srcname}-%{orig_version} -b 7 -b 10
   293 %setup -q -n %{srcname}-%{orig_version} -b 7
   294 %else
   294 %else
   295 %setup -q -n %{srcname}-%{orig_version}
   295 %setup -q -n %{srcname}-%{orig_version}
   296 %endif
   296 %endif
   297 cd $RPM_BUILD_DIR/%{srcname}-%{orig_version}
   297 cd $RPM_BUILD_DIR/%{srcname}-%{orig_version}
   298 %patch1 -p1
   298 %patch1 -p1
   317 %patch18 -p1
   317 %patch18 -p1
   318 %patch19 -p1
   318 %patch19 -p1
   319 %patch20 -p1
   319 %patch20 -p1
   320 %patch21 -p1
   320 %patch21 -p1
   321 %patch22 -p1
   321 %patch22 -p1
       
   322 %patch23 -p1
   322 # Firefox
   323 # Firefox
   323 %patch101 -p1
   324 %patch101 -p1
   324 %patch102 -p1
   325 %patch102 -p1
   325 %endif # only_print_mozconfig
   326 %endif # only_print_mozconfig
   326 
   327 
   469 %endif
   470 %endif
   470 %if 0%{?do_profiling}
   471 %if 0%{?do_profiling}
   471 xvfb-run --server-args="-screen 0 1920x1080x24" \
   472 xvfb-run --server-args="-screen 0 1920x1080x24" \
   472 %endif
   473 %endif
   473 ./mach build -v
   474 ./mach build -v
       
   475 
       
   476 # build additional locales
       
   477 %if %localize
       
   478 mkdir -p %{buildroot}%{progdir}/browser/extensions
       
   479 truncate -s 0 %{_tmppath}/translations.{common,other}
       
   480 sed -r '/^(ja-JP-mac|en-US|)$/d;s/ .*$//' $RPM_BUILD_DIR/%{srcname}-%{orig_version}/browser/locales/shipped-locales \
       
   481     | xargs -n 1 -I {} /bin/sh -c '
       
   482         locale=$1
       
   483         ./mach build langpack-$locale
       
   484         cp -rL ../obj/dist/xpi-stage/locale-$locale \
       
   485             %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org
       
   486         # remove prefs, profile defaults, and hyphenation from langpack
       
   487         rm -rf %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org/defaults
       
   488         rm -rf %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org/hyphenation
       
   489         # check against the fixed common list and sort into the right filelist
       
   490         _matched=0
       
   491         for _match in ar ca cs da de el en-GB es-AR es-CL es-ES fi fr hu it ja ko nb-NO nl pl pt-BR pt-PT ru sv-SE zh-CN zh-TW; do
       
   492             [ "$_match" = "$locale" ] && _matched=1
       
   493         done
       
   494         [ $_matched -eq 1 ] && _l10ntarget=common || _l10ntarget=other
       
   495         echo %{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org \
       
   496             >> %{_tmppath}/translations.$_l10ntarget
       
   497 ' -- {}
       
   498 %endif
       
   499 
   474 %endif # only_print_mozconfig
   500 %endif # only_print_mozconfig
   475 
   501 
   476 %install
   502 %install
   477 cd $RPM_BUILD_DIR/obj
   503 cd $RPM_BUILD_DIR/obj
   478 source %{SOURCE4}
   504 source %{SOURCE4}
   497 %endif
   523 %endif
   498 # install gre prefs
   524 # install gre prefs
   499 install -m 644 %{SOURCE13} %{buildroot}%{progdir}/defaults/pref/
   525 install -m 644 %{SOURCE13} %{buildroot}%{progdir}/defaults/pref/
   500 # install browser prefs
   526 # install browser prefs
   501 install -m 644 %{SOURCE9} %{buildroot}%{progdir}/browser/defaults/preferences/firefox.js
   527 install -m 644 %{SOURCE9} %{buildroot}%{progdir}/browser/defaults/preferences/firefox.js
   502 # build additional locales
   528 
   503 %if %localize
       
   504 mkdir -p %{buildroot}%{progdir}/browser/extensions
       
   505 truncate -s 0 %{_tmppath}/translations.{common,other}
       
   506 sed -r '/^(ja-JP-mac|en-US|)$/d;s/ .*$//' $RPM_BUILD_DIR/%{srcname}-%{orig_version}/browser/locales/shipped-locales \
       
   507     | xargs -n 1 -I {} /bin/sh -c '
       
   508         locale=$1
       
   509         pushd $RPM_BUILD_DIR/compare-locales
       
   510         PYTHONPATH=lib \
       
   511             scripts/compare-locales -m ../l10n-merged/$locale \
       
   512             ../%{srcname}-%{orig_version}/browser/locales/l10n.ini ../l10n $locale
       
   513         popd
       
   514         LOCALE_MERGEDIR=$RPM_BUILD_DIR/l10n-merged/$locale \
       
   515             make -C browser/locales langpack-$locale
       
   516         cp -rL dist/xpi-stage/locale-$locale \
       
   517             %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org
       
   518         # remove prefs, profile defaults, and hyphenation from langpack
       
   519         rm -rf %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org/defaults
       
   520         rm -rf %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org/hyphenation
       
   521         # check against the fixed common list and sort into the right filelist
       
   522         _matched=0
       
   523         for _match in ar ca cs da de el en-GB es-AR es-CL es-ES fi fr hu it ja ko nb-NO nl pl pt-BR pt-PT ru sv-SE zh-CN zh-TW; do
       
   524             [ "$_match" = "$locale" ] && _matched=1
       
   525         done
       
   526         [ $_matched -eq 1 ] && _l10ntarget=common || _l10ntarget=other
       
   527         echo %{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org \
       
   528             >> %{_tmppath}/translations.$_l10ntarget
       
   529 ' -- {}
       
   530 %endif
       
   531 # remove some executable permissions
   529 # remove some executable permissions
   532 find %{buildroot}%{progdir} \
   530 find %{buildroot}%{progdir} \
   533      -name "*.js" -o \
   531      -name "*.js" -o \
   534      -name "*.jsm" -o \
   532      -name "*.jsm" -o \
   535      -name "*.rdf" -o \
   533      -name "*.rdf" -o \