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