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