MozillaFirefox/MozillaFirefox.spec
branchfirefox92
changeset 1163 849d6343405b
parent 1162 af5e283c2e5d
child 1164 bb219fd0d646
equal deleted inserted replaced
1162:af5e283c2e5d 1163:849d6343405b
       
     1 #
       
     2 # spec file
       
     3 #
       
     4 # Copyright (c) 2021 SUSE LLC
       
     5 #               2006-2021 Wolfgang Rosenauer <wr@rosenauer.org>
       
     6 #
       
     7 # All modifications and additions to the file contributed by third parties
       
     8 # remain the property of their copyright owners, unless otherwise agreed
       
     9 # upon. The license for this file, and modifications and additions to the
       
    10 # file, is the same license as for the pristine package itself (unless the
       
    11 # license for the pristine package is not an Open Source License, in which
       
    12 # case the license is the MIT License). An "Open Source License" is a
       
    13 # license that conforms to the Open Source Definition (Version 1.9)
       
    14 # published by the Open Source Initiative.
       
    15 
       
    16 # Please submit bugfixes or comments via https://bugs.opensuse.org/
       
    17 #
       
    18 
       
    19 
       
    20 %define _dwz_low_mem_die_limit  40000000
       
    21 %define _dwz_max_die_limit     200000000
       
    22 
       
    23 # changed with every update
       
    24 # orig_version vs. mainver: To have beta-builds
       
    25 # FF70beta3 would be released as FF69.99
       
    26 # orig_version would be the upstream tar ball
       
    27 # orig_version 70.0
       
    28 # orig_suffix b3
       
    29 # major 69
       
    30 # mainver %major.99
       
    31 %define major          92
       
    32 %define mainver        %major.0.1
       
    33 %define orig_version   92.0.1
       
    34 %define orig_suffix    %{nil}
       
    35 %define update_channel release
       
    36 %define branding       1
       
    37 %define devpkg         1
       
    38 
       
    39 # PGO builds do not work in TW currently (bmo#1680306)
       
    40 %define do_profiling   0
       
    41 
       
    42 # upstream default is clang (to use gcc for large parts set to 0)
       
    43 %define clang_build    0
       
    44 
       
    45 # PIE, full relro
       
    46 %define build_hardened 1
       
    47 
       
    48 %bcond_with only_print_mozconfig
       
    49 
       
    50 # define if ccache should be used or not
       
    51 %define useccache     1
       
    52 
       
    53 # SLE-12 doesn't have this macro
       
    54 %{!?_rpmmacrodir: %global _rpmmacrodir %{_rpmconfigdir}/macros.d}
       
    55 
       
    56 # Firefox only supports i686
       
    57 %ifarch %ix86
       
    58 ExclusiveArch:  i586 i686
       
    59 BuildArch:      i686
       
    60 %{expand:%%global optflags %(echo "%optflags"|sed -e s/i586/i686/) -march=i686 -mtune=generic}
       
    61 %endif
       
    62 
       
    63 # general build definitions
       
    64 %define progname firefox
       
    65 %define appname  Firefox
       
    66 %define pkgname  MozillaFirefox
       
    67 %define srcname  firefox
       
    68 %define progdir %{_prefix}/%_lib/%{progname}
       
    69 %define gnome_dir     %{_prefix}
       
    70 %define desktop_file_name %{progname}
       
    71 %define firefox_appid \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
       
    72 %define __provides_exclude ^lib.*\\.so.*$
       
    73 %define __requires_exclude ^(libmoz.*|liblgpllibs.*|libxul.*)$
       
    74 %define localize 1
       
    75 %ifarch %ix86 x86_64
       
    76 %define crashreporter 1
       
    77 %else
       
    78 %define crashreporter 0
       
    79 %endif
       
    80 %define with_pipewire0_3  1
       
    81 %define wayland_supported 1
       
    82 %if 0%{?sle_version} > 0 && 0%{?sle_version} < 150200
       
    83 # pipewire is too old on Leap <=15.1
       
    84 %define with_pipewire0_3 0
       
    85 # Wayland is too old on Leap <=15.1 as well
       
    86 %define wayland_supported 0
       
    87 %endif
       
    88 
       
    89 Name:           %{pkgname}
       
    90 BuildRequires:  Mesa-devel
       
    91 BuildRequires:  alsa-devel
       
    92 BuildRequires:  autoconf213
       
    93 BuildRequires:  dbus-1-glib-devel
       
    94 BuildRequires:  dejavu-fonts
       
    95 BuildRequires:  fdupes
       
    96 BuildRequires:  memory-constraints
       
    97 %if 0%{?suse_version} <= 1320
       
    98 BuildRequires:  gcc9-c++
       
    99 %else
       
   100 BuildRequires:  gcc-c++
       
   101 %endif
       
   102 %if 0%{?suse_version} < 1550 && 0%{?sle_version} < 150300
       
   103 BuildRequires:  cargo >= 1.51
       
   104 BuildRequires:  rust >= 1.51
       
   105 %else
       
   106 # Newer sle/leap/tw use parallel versioned rust releases which have
       
   107 # a different method for provides that we can use to request a
       
   108 # specific version
       
   109 BuildRequires:  rust+cargo >= 1.51
       
   110 %endif
       
   111 %if 0%{useccache} != 0
       
   112 BuildRequires:  ccache
       
   113 %endif
       
   114 BuildRequires:  libXcomposite-devel
       
   115 BuildRequires:  libcurl-devel
       
   116 BuildRequires:  libidl-devel
       
   117 BuildRequires:  libiw-devel
       
   118 BuildRequires:  libproxy-devel
       
   119 BuildRequires:  makeinfo
       
   120 BuildRequires:  mozilla-nspr-devel >= 4.32
       
   121 BuildRequires:  mozilla-nss-devel >= 3.69.1
       
   122 BuildRequires:  nasm >= 2.14
       
   123 BuildRequires:  nodejs >= 10.22.1
       
   124 %if 0%{?sle_version} >= 120000 && 0%{?sle_version} < 150000
       
   125 BuildRequires:  python-libxml2
       
   126 BuildRequires:  python36
       
   127 %else
       
   128 BuildRequires:  python3 >= 3.5
       
   129 BuildRequires:  python3-devel
       
   130 %endif
       
   131 BuildRequires:  rust-cbindgen >= 0.19.0
       
   132 BuildRequires:  unzip
       
   133 BuildRequires:  update-desktop-files
       
   134 BuildRequires:  xorg-x11-libXt-devel
       
   135 %if 0%{?do_profiling}
       
   136 BuildRequires:  xvfb-run
       
   137 %endif
       
   138 BuildRequires:  yasm
       
   139 BuildRequires:  zip
       
   140 %if 0%{?suse_version} < 1550
       
   141 BuildRequires:  pkgconfig(gconf-2.0) >= 1.2.1
       
   142 %endif
       
   143 %if (0%{?sle_version} >= 120000 && 0%{?sle_version} < 150000)
       
   144 BuildRequires:  clang6-devel
       
   145 %else
       
   146 BuildRequires:  clang-devel >= 5
       
   147 %endif
       
   148 BuildRequires:  pkgconfig(gdk-x11-2.0)
       
   149 BuildRequires:  pkgconfig(glib-2.0) >= 2.22
       
   150 BuildRequires:  pkgconfig(gobject-2.0)
       
   151 BuildRequires:  pkgconfig(gtk+-3.0) >= 3.14.0
       
   152 BuildRequires:  pkgconfig(gtk+-unix-print-3.0)
       
   153 BuildRequires:  pkgconfig(libffi)
       
   154 BuildRequires:  pkgconfig(libpulse)
       
   155 %if %{with_pipewire0_3}
       
   156 BuildRequires:  pkgconfig(libpipewire-0.3)
       
   157 %endif
       
   158 # libavcodec is required for H.264 support but the
       
   159 # openSUSE version is currently not able to play H.264
       
   160 # therefore the Packman version is required
       
   161 # minimum version of libavcodec is 53
       
   162 Recommends:     libavcodec-full >= 0.10.16
       
   163 Version:        %{mainver}
       
   164 Release:        0
       
   165 %if "%{name}" == "MozillaFirefox"
       
   166 Provides:       firefox = %{mainver}
       
   167 Provides:       firefox = %{version}-%{release}
       
   168 %endif
       
   169 Provides:       web_browser
       
   170 Provides:       appdata()
       
   171 Provides:       appdata(firefox.appdata.xml)
       
   172 # this is needed to match this package with the kde4 helper package without the main package
       
   173 # having a hard requirement on the kde4 package
       
   174 %define kde_helper_version 6
       
   175 Provides:       mozilla-kde4-version = %{kde_helper_version}
       
   176 Summary:        Mozilla %{appname} Web Browser
       
   177 License:        MPL-2.0
       
   178 Group:          Productivity/Networking/Web/Browsers
       
   179 URL:            http://www.mozilla.org/
       
   180 %if !%{with only_print_mozconfig}
       
   181 Source:         http://ftp.mozilla.org/pub/%{srcname}/releases/%{version}%{orig_suffix}/source/%{srcname}-%{orig_version}%{orig_suffix}.source.tar.xz
       
   182 Source1:        MozillaFirefox.desktop
       
   183 Source2:        MozillaFirefox-rpmlintrc
       
   184 Source3:        mozilla.sh.in
       
   185 Source4:        tar_stamps
       
   186 Source7:        l10n-%{orig_version}%{orig_suffix}.tar.xz
       
   187 Source8:        firefox-mimeinfo.xml
       
   188 Source9:        firefox.js
       
   189 Source11:       firefox.1
       
   190 Source12:       mozilla-get-app-id
       
   191 Source13:       spellcheck.js
       
   192 Source14:       https://github.com/openSUSE/firefox-scripts/raw/4503820/create-tar.sh
       
   193 Source15:       firefox-appdata.xml
       
   194 Source16:       %{name}.changes
       
   195 Source17:       firefox-search-provider.ini
       
   196 # Set up API keys, see http://www.chromium.org/developers/how-tos/api-keys
       
   197 # Note: these are for the openSUSE Firefox builds ONLY. For your own distribution,
       
   198 # please get your own set of keys.
       
   199 Source18:       mozilla-api-key
       
   200 Source19:       google-api-key
       
   201 Source20:       https://ftp.mozilla.org/pub/%{srcname}/releases/%{version}%{orig_suffix}/source/%{srcname}-%{orig_version}%{orig_suffix}.source.tar.xz.asc
       
   202 Source21:       https://ftp.mozilla.org/pub/%{srcname}/releases/%{version}%{orig_suffix}/KEY#/mozilla.keyring
       
   203 # Gecko/Toolkit
       
   204 Patch1:         mozilla-nongnome-proxies.patch
       
   205 Patch2:         mozilla-kde.patch
       
   206 Patch3:         mozilla-ntlm-full-path.patch
       
   207 Patch4:         mozilla-aarch64-startup-crash.patch
       
   208 Patch6:         mozilla-sandbox-fips.patch
       
   209 Patch7:         mozilla-fix-aarch64-libopus.patch
       
   210 Patch9:         mozilla-s390-context.patch
       
   211 Patch10:        mozilla-pgo.patch
       
   212 Patch11:        mozilla-reduce-rust-debuginfo.patch
       
   213 Patch13:        mozilla-bmo1005535.patch
       
   214 Patch14:        mozilla-bmo1568145.patch
       
   215 Patch15:        mozilla-bmo1504834-part1.patch
       
   216 Patch16:        mozilla-bmo1504834-part2.patch
       
   217 Patch17:        mozilla-bmo1504834-part3.patch
       
   218 Patch19:        mozilla-bmo1512162.patch
       
   219 Patch20:        mozilla-fix-top-level-asm.patch
       
   220 Patch21:        mozilla-bmo1504834-part4.patch
       
   221 Patch22:        mozilla-bmo849632.patch
       
   222 Patch24:        mozilla-bmo1602730.patch
       
   223 Patch25:        mozilla-bmo998749.patch
       
   224 Patch26:        mozilla-bmo1626236.patch
       
   225 Patch27:        mozilla-s390x-skia-gradient.patch
       
   226 Patch28:        mozilla-libavcodec58_91.patch
       
   227 Patch29:        mozilla-bmo1708709.patch
       
   228 Patch30:        mozilla-silence-no-return-type.patch
       
   229 Patch31:        mozilla-bmo1725828.patch
       
   230 # Firefox/browser
       
   231 Patch101:       firefox-kde.patch
       
   232 Patch102:       firefox-branded-icons.patch
       
   233 %endif
       
   234 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
       
   235 Requires(post): coreutils shared-mime-info desktop-file-utils
       
   236 Requires(postun):shared-mime-info desktop-file-utils
       
   237 Requires:       %{name}-branding >= 68
       
   238 %requires_ge    mozilla-nspr
       
   239 %requires_ge    mozilla-nss
       
   240 %requires_ge    libfreetype6
       
   241 Recommends:     libcanberra0
       
   242 Recommends:     libpulse0
       
   243 # addon leads to startup crash (bnc#908892)
       
   244 Obsoletes:      tracker-miner-firefox < 0.15
       
   245 %if 0%{?devpkg} == 0
       
   246 Obsoletes:      %{name}-devel < %{version}
       
   247 %endif
       
   248 # libproxy's mozjs pacrunner crashes FF (bnc#759123)
       
   249 %if 0%{?suse_version} < 1220
       
   250 Obsoletes:      libproxy1-pacrunner-mozjs <= 0.4.7
       
   251 %endif
       
   252 ExcludeArch:    armv6l armv6hl
       
   253 
       
   254 %description
       
   255 Mozilla Firefox is a standalone web browser, designed for standards
       
   256 compliance and performance.  Its functionality can be enhanced via a
       
   257 plethora of extensions.
       
   258 
       
   259 %if 0%{?devpkg}
       
   260 %package devel
       
   261 Summary:        Devel package for %{appname}
       
   262 Group:          Development/Tools/Other
       
   263 Provides:       firefox-devel = %{version}-%{release}
       
   264 Requires:       %{name} = %{version}
       
   265 Requires:       perl(Archive::Zip)
       
   266 Requires:       perl(XML::Simple)
       
   267 
       
   268 %description devel
       
   269 Development files for %{appname} to make packaging of addons easier.
       
   270 %endif
       
   271 
       
   272 %if %localize
       
   273 %package translations-common
       
   274 Summary:        Common translations for %{appname}
       
   275 Group:          System/Localization
       
   276 Provides:       locale(%{name}: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)
       
   277 # This is there for updates from Firefox before the translations-package was split up into 2 packages
       
   278 Provides:       %{name}-translations
       
   279 Requires:       %{name} = %{version}
       
   280 Obsoletes:      %{name}-translations < %{version}-%{release}
       
   281 
       
   282 %description translations-common
       
   283 This package contains several common languages for the user interface
       
   284 of %{appname}.
       
   285 
       
   286 %package translations-other
       
   287 Summary:        Extra translations for %{appname}
       
   288 Group:          System/Localization
       
   289 Provides:       locale(%{name}:ach;af;an;ast;az;be;bg;bn;br;bs;cak;cy;dsb;en_CA;eo;es_MX;et;eu;fa;ff;fy_NL;ga_IE;gd;gl;gn;gu_IN;he;hi_IN;hr;hsb;hy_AM;ia;id;is;ka;kab;kk;km;kn;lij;lt;lv;mk;mr;ms;my;ne_NP;nn_NO;oc;pa_IN;rm;ro;si;sk;sl;son;sq;sr;ta;te;th;tr;uk;ur;uz;vi;xh)
       
   290 Requires:       %{name} = %{version}
       
   291 Obsoletes:      %{name}-translations < %{version}-%{release}
       
   292 
       
   293 %description translations-other
       
   294 This package contains rarely used languages for the user interface
       
   295 of %{appname}.
       
   296 %endif
       
   297 
       
   298 %package branding-upstream
       
   299 Summary:        Upstream branding for %{appname}
       
   300 Group:          Productivity/Networking/Web/Browsers
       
   301 Provides:       %{name}-branding = %{version}
       
   302 Conflicts:      otherproviders(%{name}-branding)
       
   303 Supplements:    packageand(%{name}:branding-upstream)
       
   304 #BRAND: Provide three files -
       
   305 #BRAND: /usr/lib/firefox/browserconfig.properties that contains the
       
   306 #BRAND: default homepage and some other default configuration options
       
   307 #BRAND: /usr/lib/firefox/defaults/profile/bookmarks.html that contains
       
   308 #BRAND: the list of default bookmarks
       
   309 #BRAND: It's also possible to create a file
       
   310 #BRAND: /usr/lib/firefox/defaults/preferences/firefox-$vendor.js to set
       
   311 #BRAND: custom preference overrides.
       
   312 #BRAND: It's also possible to drop files in /usr/lib/firefox/distribution/searchplugins/common/
       
   313 
       
   314 %description branding-upstream
       
   315 This package provides upstream look and feel for %{appname}.
       
   316 
       
   317 %if !%{with only_print_mozconfig}
       
   318 %prep
       
   319 %if %localize
       
   320 
       
   321 # If generated incorrectly, the tarball will be ~270B in
       
   322 # size, so 1MB seems like good enough limit to check.
       
   323 MINSIZE=1048576
       
   324 if (( $(stat -Lc%s "%{SOURCE7}") < MINSIZE)); then
       
   325     echo "Translations tarball %{SOURCE7} not generated properly."
       
   326     exit 1
       
   327 fi
       
   328 
       
   329 %setup -q -n %{srcname}-%{orig_version} -b 7
       
   330 %else
       
   331 %setup -q -n %{srcname}-%{orig_version}
       
   332 %endif
       
   333 cd $RPM_BUILD_DIR/%{srcname}-%{orig_version}
       
   334 %patch1 -p1
       
   335 %patch2 -p1
       
   336 %patch3 -p1
       
   337 %patch4 -p1
       
   338 %patch6 -p1
       
   339 %patch7 -p1
       
   340 %patch9 -p1
       
   341 %patch10 -p1
       
   342 %patch11 -p1
       
   343 %patch13 -p1
       
   344 %patch14 -p1
       
   345 %patch15 -p1
       
   346 %patch16 -p1
       
   347 %patch17 -p1
       
   348 %patch19 -p1
       
   349 %patch20 -p1
       
   350 %patch21 -p1
       
   351 %patch22 -p1
       
   352 %patch24 -p1
       
   353 %patch25 -p1
       
   354 %patch26 -p1
       
   355 %patch27 -p1
       
   356 %patch28 -p1
       
   357 %patch29 -p1
       
   358 %patch30 -p1
       
   359 %patch31 -p1
       
   360 # Firefox
       
   361 %patch101 -p1
       
   362 %patch102 -p1
       
   363 %endif
       
   364 
       
   365 %build
       
   366 %if !%{with only_print_mozconfig}
       
   367 # no need to add build time to binaries
       
   368 modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{pkgname}.changes")"
       
   369 DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\""
       
   370 TIME="\"$(date -d "${modified}" "+%%R")\""
       
   371 find . -regex ".*\.c\|.*\.cpp\|.*\.h" -exec sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" {} +
       
   372 
       
   373 # SLE-12 provides python36, but that package does not provide a python3 binary
       
   374 %if 0%{?sle_version} >= 120000 && 0%{?sle_version} < 150000
       
   375 sed -i "s/python3/python36/g" configure.in
       
   376 sed -i "s/python3/python36/g" mach
       
   377 export PYTHON3=/usr/bin/python36
       
   378 %endif
       
   379 
       
   380 # Webrender does not support big endian yet, so we are forcing it off
       
   381 # see: https://bugzilla.mozilla.org/show_bug.cgi?id=1716707
       
   382 %ifarch s390x ppc64
       
   383 echo 'pref("gfx.webrender.force-disabled", true);' >> %{SOURCE9}
       
   384 %endif
       
   385 
       
   386 #
       
   387 kdehelperversion=$(cat toolkit/xre/nsKDEUtils.cpp | grep '#define KMOZILLAHELPER_VERSION' | cut -d ' ' -f 3)
       
   388 if test "$kdehelperversion" != %{kde_helper_version}; then
       
   389   echo fix kde helper version in the .spec file
       
   390   exit 1
       
   391 fi
       
   392 
       
   393 source %{SOURCE4}
       
   394 %endif
       
   395 
       
   396 export CARGO_HOME=${RPM_BUILD_DIR}/%{srcname}-%{orig_version}/.cargo
       
   397 export MOZ_SOURCE_CHANGESET=$RELEASE_TAG
       
   398 export SOURCE_REPO=$RELEASE_REPO
       
   399 export source_repo=$RELEASE_REPO
       
   400 export MOZ_SOURCE_REPO=$RELEASE_REPO
       
   401 export MOZ_BUILD_DATE=$RELEASE_TIMESTAMP
       
   402 export MOZILLA_OFFICIAL=1
       
   403 export BUILD_OFFICIAL=1
       
   404 export MOZ_TELEMETRY_REPORTING=1
       
   405 export MACH_USE_SYSTEM_PYTHON=1
       
   406 %if 0%{?suse_version} <= 1320
       
   407 export CC=gcc-9
       
   408 %else
       
   409 %if 0%{?clang_build} == 0
       
   410 export CC=gcc
       
   411 export CXX=g++
       
   412 %endif
       
   413 %endif
       
   414 %ifarch %arm %ix86
       
   415 # Limit RAM usage during link
       
   416 export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
       
   417 %endif
       
   418 %if 0%{?build_hardened}
       
   419 export LDFLAGS="${LDFLAGS} -fPIC -Wl,-z,relro,-z,now"
       
   420 %endif
       
   421 %ifarch ppc64 ppc64le
       
   422 %if 0%{?clang_build} == 0
       
   423 export CFLAGS="$CFLAGS -mminimal-toc"
       
   424 %endif
       
   425 %endif
       
   426 export CXXFLAGS="$CFLAGS"
       
   427 export MOZCONFIG=$RPM_BUILD_DIR/mozconfig
       
   428 %if %{with only_print_mozconfig}
       
   429 echo "export CC=$CC"
       
   430 echo "export CXX=$CXX"
       
   431 echo "export CFLAGS=\"$CFLAGS\""
       
   432 echo "export CXXFLAGS=\"$CXXFLAGS\""
       
   433 echo "export LDFLAGS=\"$LDFLAGS\""
       
   434 echo "export RUSTFLAGS=\"$RUSTFLAGS\""
       
   435 echo "export CARGO_HOME=\"$CARGO_HOME\""
       
   436 echo "export PATH=\"$PATH\""
       
   437 echo "export LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH\""
       
   438 echo "export PKG_CONFIG_PATH=\"$PKG_CONFIG_PATH\""
       
   439 echo "export MOZCONFIG=\"$MOZCONFIG\""
       
   440 echo "export MOZILLA_OFFICIAL=1"
       
   441 echo "export BUILD_OFFICIAL=1"
       
   442 echo "export MOZ_TELEMETRY_REPORTING=1"
       
   443 echo ""
       
   444 cat << EOF
       
   445 %else
       
   446 %ifarch aarch64 %arm ppc64 ppc64le
       
   447 %limit_build -m 2000
       
   448 %endif
       
   449 cat << EOF > $MOZCONFIG
       
   450 %endif
       
   451 mk_add_options MOZILLA_OFFICIAL=1
       
   452 mk_add_options BUILD_OFFICIAL=1
       
   453 mk_add_options MOZ_MAKE_FLAGS=%{?jobs:-j%jobs}
       
   454 mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obj
       
   455 . \$topsrcdir/browser/config/mozconfig
       
   456 ac_add_options --disable-bootstrap
       
   457 ac_add_options --prefix=%{_prefix}
       
   458 ac_add_options --libdir=%{_libdir}
       
   459 ac_add_options --includedir=%{_includedir}
       
   460 ac_add_options --enable-release
       
   461 %if 0%{wayland_supported}
       
   462 ac_add_options --enable-default-toolkit=cairo-gtk3-wayland
       
   463 %else
       
   464 ac_add_options --enable-default-toolkit=cairo-gtk3
       
   465 %endif
       
   466 # bmo#1441155 - Disable the generation of Rust debug symbols on Linux32
       
   467 %ifarch %ix86 %arm
       
   468 ac_add_options --disable-debug-symbols
       
   469 %else
       
   470 ac_add_options --enable-debug-symbols
       
   471 %endif
       
   472 # building with elf-hack started to fail everywhere with FF73
       
   473 #%if 0%{?suse_version} > 1549
       
   474 %ifnarch aarch64 ppc64 ppc64le s390x
       
   475 ac_add_options --disable-elf-hack
       
   476 %endif
       
   477 #%endif
       
   478 ac_add_options --with-system-nspr
       
   479 ac_add_options --with-system-nss
       
   480 %if 0%{useccache} != 0
       
   481 ac_add_options --with-ccache
       
   482 %endif
       
   483 %if %{localize}
       
   484 ac_add_options --with-l10n-base=$RPM_BUILD_DIR/l10n
       
   485 %endif
       
   486 #ac_add_options --with-system-jpeg    # libjpeg-turbo is used internally
       
   487 #ac_add_options --with-system-png     # doesn't work because of missing APNG support
       
   488 ac_add_options --with-system-zlib
       
   489 ac_add_options --disable-updater
       
   490 ac_add_options --disable-tests
       
   491 ac_add_options --enable-alsa
       
   492 ac_add_options --disable-debug
       
   493 #ac_add_options --enable-chrome-format=jar
       
   494 ac_add_options --enable-update-channel=%{update_channel}
       
   495 ac_add_options --with-mozilla-api-keyfile=%{SOURCE18}
       
   496 # Google-service currently not available for free anymore
       
   497 #ac_add_options --with-google-location-service-api-keyfile=%{SOURCE19}
       
   498 ac_add_options --with-google-safebrowsing-api-keyfile=%{SOURCE19}
       
   499 ac_add_options --with-unsigned-addon-scopes=app
       
   500 ac_add_options --allow-addon-sideload
       
   501 %if %branding
       
   502 ac_add_options --enable-official-branding
       
   503 %endif
       
   504 ac_add_options --enable-libproxy
       
   505 %if ! %crashreporter
       
   506 ac_add_options --disable-crashreporter
       
   507 %endif
       
   508 %ifarch %arm
       
   509 ac_add_options --with-fpu=vfpv3-d16
       
   510 ac_add_options --with-float-abi=hard
       
   511 %ifarch armv6l armv6hl
       
   512 ac_add_options --with-arch=armv6
       
   513 %else
       
   514 ac_add_options --with-arch=armv7-a
       
   515 %endif
       
   516 %endif
       
   517 # mitigation/workaround for bmo#1512162
       
   518 %ifarch s390x
       
   519 ac_add_options --enable-optimize="-O1"
       
   520 %endif
       
   521 %ifarch x86_64
       
   522 # LTO needs newer toolchain stack only (at least GCC 8.2.1 (r268506)
       
   523 %if 0%{?suse_version} > 1500 && 0%{?suse_version} < 1550
       
   524 ac_add_options --enable-lto
       
   525 %if 0%{?do_profiling}
       
   526 ac_add_options MOZ_PGO=1
       
   527 %endif
       
   528 %endif
       
   529 %endif
       
   530 EOF
       
   531 %if !%{with only_print_mozconfig}
       
   532 %if 0%{useccache} != 0
       
   533 ccache -s
       
   534 %endif
       
   535 %if 0%{?do_profiling}
       
   536 xvfb-run --server-args="-screen 0 1920x1080x24" \
       
   537 %endif
       
   538 ./mach build -v
       
   539 
       
   540 # build additional locales
       
   541 %if %localize
       
   542 truncate -s 0 %{_tmppath}/translations.{common,other}
       
   543 # langpack-build can not be done in parallel easily (see https://bugzilla.mozilla.org/show_bug.cgi?id=1660943)
       
   544 # Therefore, we have to have a separate obj-dir for each language
       
   545 # We do this, by creating a mozconfig-template with the necessary switches
       
   546 # and a placeholder obj-dir, which gets copied and modified for each language
       
   547 
       
   548 # Create mozconfig-template for langbuild
       
   549 cat << EOF > ${MOZCONFIG}_LANG
       
   550 mk_add_options MOZILLA_OFFICIAL=1
       
   551 mk_add_options BUILD_OFFICIAL=1
       
   552 mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obj_LANG
       
   553 . \$topsrcdir/browser/config/mozconfig
       
   554 ac_add_options --prefix=%{_prefix}
       
   555 ac_add_options --with-l10n-base=$RPM_BUILD_DIR/l10n
       
   556 ac_add_options --disable-updater
       
   557 %if %branding
       
   558 ac_add_options --enable-official-branding
       
   559 %endif
       
   560 EOF
       
   561 
       
   562 %ifarch %ix86
       
   563 %define njobs 1
       
   564 %else
       
   565 %define njobs 0%{?jobs:%jobs}
       
   566 %endif
       
   567 mkdir -p $RPM_BUILD_DIR/langpacks_artifacts/
       
   568 sed -r '/^(ja-JP-mac|ga-IE|en-US|)$/d;s/ .*$//' $RPM_BUILD_DIR/%{srcname}-%{orig_version}/browser/locales/shipped-locales \
       
   569     | xargs -n 1 %{?njobs:-P %njobs} -I {} /bin/sh -c '
       
   570         locale=$1
       
   571         cp ${MOZCONFIG}_LANG ${MOZCONFIG}_$locale
       
   572         sed -i "s|obj_LANG|obj_$locale|" ${MOZCONFIG}_$locale
       
   573         export MOZCONFIG=${MOZCONFIG}_$locale
       
   574         # nsinstall is needed for langpack-build. It is already built by `./mach build`, but building it again is very fast
       
   575         ./mach build config/nsinstall langpack-$locale
       
   576         cp -L ../obj_$locale/dist/linux-*/xpi/firefox-%{orig_version}.$locale.langpack.xpi \
       
   577             $RPM_BUILD_DIR/langpacks_artifacts/langpack-$locale@firefox.mozilla.org.xpi
       
   578         # check against the fixed common list and sort into the right filelist
       
   579         _matched=0
       
   580         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
       
   581             [ "$_match" = "$locale" ] && _matched=1
       
   582         done
       
   583         [ $_matched -eq 1 ] && _l10ntarget=common || _l10ntarget=other
       
   584         echo %{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org.xpi \
       
   585             >> %{_tmppath}/translations.$_l10ntarget
       
   586 ' -- {}
       
   587 %endif
       
   588 
       
   589 %if 0%{useccache} != 0
       
   590 ccache -s
       
   591 %endif
       
   592 %endif
       
   593 
       
   594 %install
       
   595 cd $RPM_BUILD_DIR/obj
       
   596 source %{SOURCE4}
       
   597 export MOZ_SOURCE_STAMP=$RELEASE_TAG
       
   598 export MOZ_SOURCE_REPO=$RELEASE_REPO
       
   599 # need to remove default en-US firefox-l10n.js before it gets
       
   600 # populated into browser's omni.ja; it only contains general.useragent.locale
       
   601 # which should be loaded from each language pack (set in firefox.js)
       
   602 rm dist/bin/browser/defaults/preferences/firefox-l10n.js
       
   603 make -C browser/installer STRIP=/bin/true MOZ_PKG_FATAL_WARNINGS=0
       
   604 #DEBUG (break the build if searchplugins are missing / temporary)
       
   605 grep amazondotcom dist/firefox/browser/omni.ja
       
   606 # copy tree into RPM_BUILD_ROOT
       
   607 mkdir -p %{buildroot}%{progdir}
       
   608 cp -rf $RPM_BUILD_DIR/obj/dist/%{srcname}/* %{buildroot}%{progdir}
       
   609 mkdir -p %{buildroot}%{progdir}/browser/extensions
       
   610 cp -rf $RPM_BUILD_DIR/langpacks_artifacts/* %{buildroot}%{progdir}/browser/extensions/
       
   611 mkdir -p %{buildroot}%{progdir}/distribution/extensions
       
   612 mkdir -p %{buildroot}%{progdir}/browser/defaults/preferences/
       
   613 # renaming executables (for regular vs. ESR)
       
   614 %if "%{srcname}" != "%{progname}"
       
   615 mv %{buildroot}%{progdir}/%{srcname} %{buildroot}%{progdir}/%{progname}
       
   616 mv %{buildroot}%{progdir}/%{srcname}-bin %{buildroot}%{progdir}/%{progname}-bin
       
   617 %endif
       
   618 # install gre prefs
       
   619 install -m 644 %{SOURCE13} %{buildroot}%{progdir}/defaults/pref/
       
   620 # install browser prefs
       
   621 install -m 644 %{SOURCE9} %{buildroot}%{progdir}/browser/defaults/preferences/firefox.js
       
   622 
       
   623 # remove some executable permissions
       
   624 find %{buildroot}%{progdir} \
       
   625      -name "*.js" -o \
       
   626      -name "*.jsm" -o \
       
   627      -name "*.rdf" -o \
       
   628      -name "*.properties" -o \
       
   629      -name "*.dtd" -o \
       
   630      -name "*.txt" -o \
       
   631      -name "*.xml" -o \
       
   632      -name "*.css" \
       
   633      -exec chmod a-x {} +
       
   634 # remove mkdir.done files from installed base
       
   635 find %{buildroot}%{progdir} -type f -name ".mkdir.done" -delete
       
   636 # overwrite the mozilla start-script and link it to /usr/bin
       
   637 mkdir --parents %{buildroot}/usr/bin
       
   638 sed "s:%%PREFIX:%{_prefix}:g
       
   639 s:%%PROGDIR:%{progdir}:g
       
   640 s:%%APPNAME:%{progname}:g
       
   641 s:%%WAYLAND_SUPPORTED:%{wayland_supported}:g
       
   642 s:%%PROFILE:.mozilla/firefox:g" \
       
   643   %{SOURCE3} > %{buildroot}%{progdir}/%{progname}.sh
       
   644 chmod 755 %{buildroot}%{progdir}/%{progname}.sh
       
   645 ln -sf ../..%{progdir}/%{progname}.sh %{buildroot}%{_bindir}/%{progname}
       
   646 # desktop file
       
   647 mkdir -p %{buildroot}%{_datadir}/applications
       
   648 sed "s:%%NAME:%{appname}:g
       
   649 s:%%EXEC:%{progname}:g
       
   650 s:%%ICON:%{progname}:g" \
       
   651   %{SOURCE1} > %{buildroot}%{_datadir}/applications/%{desktop_file_name}.desktop
       
   652 %suse_update_desktop_file %{desktop_file_name} Network WebBrowser GTK
       
   653 # additional mime-types
       
   654 mkdir -p %{buildroot}%{_datadir}/mime/packages
       
   655 cp %{SOURCE8} %{buildroot}%{_datadir}/mime/packages/%{progname}.xml
       
   656 # appdata
       
   657 mkdir -p %{buildroot}%{_datadir}/metainfo
       
   658 sed "s:firefox.desktop:%{desktop_file_name}:g" \
       
   659   %{SOURCE15} > %{buildroot}%{_datadir}/metainfo/%{desktop_file_name}.appdata.xml
       
   660 # install man-page
       
   661 mkdir -p %{buildroot}%{_mandir}/man1/
       
   662 cp %{SOURCE11} %{buildroot}%{_mandir}/man1/%{progname}.1
       
   663 # install GNOME Shell search provider
       
   664 mkdir -p %{buildroot}%{_datadir}/gnome-shell/search-providers
       
   665 cp %{SOURCE17} %{buildroot}%{_datadir}/gnome-shell/search-providers
       
   666 ##########
       
   667 # ADDONS
       
   668 #
       
   669 mkdir -p %{buildroot}%{_datadir}/mozilla/extensions/%{firefox_appid}
       
   670 mkdir -p %{buildroot}%{_libdir}/mozilla/extensions/%{firefox_appid}
       
   671 # Install symbolic icon for GNOME
       
   672 %if %branding
       
   673 for size in 16 22 24 32 48 64 128 256; do
       
   674 %else
       
   675 for size in 16 32 48; do
       
   676 %endif
       
   677   mkdir -p %{buildroot}%{gnome_dir}/share/icons/hicolor/${size}x${size}/apps/
       
   678   cp %{buildroot}%{progdir}/browser/chrome/icons/default/default$size.png \
       
   679          %{buildroot}%{gnome_dir}/share/icons/hicolor/${size}x${size}/apps/%{progname}.png
       
   680 done
       
   681 # excludes
       
   682 rm -f %{buildroot}%{progdir}/updater.ini
       
   683 rm -f %{buildroot}%{progdir}/removed-files
       
   684 rm -f %{buildroot}%{progdir}/README.txt
       
   685 rm -f %{buildroot}%{progdir}/old-homepage-default.properties
       
   686 rm -f %{buildroot}%{progdir}/run-mozilla.sh
       
   687 rm -f %{buildroot}%{progdir}/LICENSE
       
   688 rm -f %{buildroot}%{progdir}/precomplete
       
   689 rm -f %{buildroot}%{progdir}/update-settings.ini
       
   690 %if 0%{?devpkg}
       
   691 # devel
       
   692 mkdir -p %{buildroot}%{_bindir}
       
   693 install -m 755 %SOURCE12 %{buildroot}%{_bindir}
       
   694 # inspired by mandriva
       
   695 mkdir -p %{buildroot}%{_rpmmacrodir}
       
   696 cat <<'FIN' >%{buildroot}%{_rpmmacrodir}/macros.%{progname}
       
   697 # Macros from %{name} package
       
   698 %%firefox_major              %{major}
       
   699 %%firefox_version            %{version}
       
   700 %%firefox_mainver            %{mainver}
       
   701 %%firefox_mozillapath        %%{_libdir}/%{progname}
       
   702 %%firefox_pluginsdir         %%{_libdir}/mozilla/plugins
       
   703 %%firefox_appid              \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
       
   704 %%firefox_extdir             %%(if [ "%%_target_cpu" = "noarch" ]; then echo %%{_datadir}/mozilla/extensions/%%{firefox_appid}; else echo %%{_libdir}/mozilla/extensions/%%{firefox_appid}; fi)
       
   705 
       
   706 %%firefox_ext_install() \
       
   707    extdir="%%{buildroot}%%{firefox_extdir}/`mozilla-get-app-id '%%1'`" \
       
   708    mkdir -p "$extdir" \
       
   709    %%{__unzip} -q -d "$extdir" "%%1" \
       
   710    %%{nil}
       
   711 FIN
       
   712 %endif
       
   713 # fdupes
       
   714 %fdupes %{buildroot}%{progdir}
       
   715 %fdupes %{buildroot}%{_datadir}
       
   716 
       
   717 %clean
       
   718 rm -rf %{buildroot}
       
   719 %if %localize
       
   720 rm -rf %{_tmppath}/translations.*
       
   721 %endif
       
   722 
       
   723 %post
       
   724 # update mime and desktop database
       
   725 %mime_database_post
       
   726 %desktop_database_post
       
   727 %icon_theme_cache_post
       
   728 exit 0
       
   729 
       
   730 %postun
       
   731 %icon_theme_cache_postun
       
   732 %desktop_database_postun
       
   733 %mime_database_postun
       
   734 exit 0
       
   735 
       
   736 %files
       
   737 %defattr(-,root,root)
       
   738 %dir %{progdir}
       
   739 %dir %{progdir}/browser/
       
   740 %dir %{progdir}/browser/chrome/
       
   741 %{progdir}/browser/defaults
       
   742 %{progdir}/browser/features/
       
   743 %{progdir}/browser/chrome/icons
       
   744 %{progdir}/browser/omni.ja
       
   745 %dir %{progdir}/distribution/
       
   746 %{progdir}/distribution/extensions/
       
   747 %{progdir}/defaults/
       
   748 %{progdir}/gmp-clearkey/
       
   749 %attr(755,root,root) %{progdir}/%{progname}.sh
       
   750 %{progdir}/%{progname}
       
   751 %{progdir}/%{progname}-bin
       
   752 %{progdir}/application.ini
       
   753 %{progdir}/dependentlibs.list
       
   754 %{progdir}/*.so
       
   755 %{progdir}/omni.ja
       
   756 %{progdir}/fonts/
       
   757 %{progdir}/pingsender
       
   758 %{progdir}/platform.ini
       
   759 %{progdir}/plugin-container
       
   760 %if %crashreporter
       
   761 %{progdir}/crashreporter
       
   762 %{progdir}/crashreporter.ini
       
   763 %{progdir}/Throbber-small.gif
       
   764 %{progdir}/minidump-analyzer
       
   765 %{progdir}/browser/crashreporter-override.ini
       
   766 %endif
       
   767 %{_datadir}/applications/%{desktop_file_name}.desktop
       
   768 %{_datadir}/mime/packages/%{progname}.xml
       
   769 %dir %{_datadir}/gnome-shell
       
   770 %dir %{_datadir}/gnome-shell/search-providers
       
   771 %{_datadir}/gnome-shell/search-providers/*.ini
       
   772 %dir %{_datadir}/mozilla
       
   773 %dir %{_datadir}/mozilla/extensions
       
   774 %dir %{_datadir}/mozilla/extensions/%{firefox_appid}
       
   775 %dir %{_libdir}/mozilla
       
   776 %dir %{_libdir}/mozilla/extensions
       
   777 %dir %{_libdir}/mozilla/extensions/%{firefox_appid}
       
   778 %{gnome_dir}/share/icons/hicolor/
       
   779 %{_bindir}/%{progname}
       
   780 %doc %{_mandir}/man1/%{progname}.1.gz
       
   781 %{_datadir}/metainfo/
       
   782 
       
   783 %if 0%{?devpkg}
       
   784 %files devel
       
   785 %defattr(-,root,root)
       
   786 %{_bindir}/mozilla-get-app-id
       
   787 %{_rpmmacrodir}/macros.%{progname}
       
   788 %endif
       
   789 
       
   790 %if %localize
       
   791 %files translations-common -f %{_tmppath}/translations.common
       
   792 %defattr(-,root,root)
       
   793 %dir %{progdir}
       
   794 %dir %{progdir}/browser/extensions/
       
   795 
       
   796 %files translations-other -f %{_tmppath}/translations.other
       
   797 %defattr(-,root,root)
       
   798 %dir %{progdir}
       
   799 %dir %{progdir}/browser/extensions/
       
   800 %endif
       
   801 
       
   802 # this package does not need to provide files but is needed to fulfill
       
   803 # requirements if no other branding package is to be installed
       
   804 %files branding-upstream
       
   805 %defattr(-,root,root)
       
   806 %dir %{progdir}
       
   807 
       
   808 %changelog