MozillaFirefox/MozillaFirefox.spec
changeset 1113 8e9195853a32
parent 1088 84cdfb476431
parent 1112 8a4f5aea2475
child 1114 572ec48f3fe8
equal deleted inserted replaced
1088:84cdfb476431 1113:8e9195853a32
     1 #
     1 #
     2 # spec file for package MozillaFirefox
     2 # spec file for package MozillaFirefox
     3 #
     3 #
     4 # Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
     4 # Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
     5 #               2006-2019 Wolfgang Rosenauer
     5 #               2006-2019 Wolfgang Rosenauer <wr@rosenauer.org>
     6 #
     6 #
     7 # All modifications and additions to the file contributed by third parties
     7 # All modifications and additions to the file contributed by third parties
     8 # remain the property of their copyright owners, unless otherwise agreed
     8 # remain the property of their copyright owners, unless otherwise agreed
     9 # upon. The license for this file, and modifications and additions to the
     9 # upon. The license for this file, and modifications and additions to the
    10 # file, is the same license as for the pristine package itself (unless the
    10 # file, is the same license as for the pristine package itself (unless the
    16 # Please submit bugfixes or comments via https://bugs.opensuse.org/
    16 # Please submit bugfixes or comments via https://bugs.opensuse.org/
    17 #
    17 #
    18 
    18 
    19 
    19 
    20 # changed with every update
    20 # changed with every update
    21 %define major          65
    21 %define major          70
    22 %define mainver        %major.0.1
    22 %define mainver        %major.0
    23 %define orig_version   65.0.1
    23 %define orig_version   70.0
    24 %define orig_suffix    %{nil}
    24 %define orig_suffix    %{nil}
    25 %define update_channel beta
    25 %define update_channel beta
    26 %define branding       1
    26 %define branding       1
    27 %define releasedate    20190211233335
    27 %define devpkg         1
    28 %define source_prefix  firefox-%{orig_version}
    28 %define releasedate    20191016161957
    29 
    29 
    30 # always build with GCC as SUSE Security Team requires that
    30 # always build with GCC as SUSE Security Team requires that
    31 %define clang_build 0
    31 %define clang_build 0
    32 
    32 
    33 # PIE, full relro
    33 # PIE, full relro
    34 %define build_hardened 1
    34 %define build_hardened 1
       
    35 
       
    36 %bcond_with only_print_mozconfig
    35 
    37 
    36 # Firefox only supports i686
    38 # Firefox only supports i686
    37 %ifarch %ix86
    39 %ifarch %ix86
    38 ExclusiveArch:  i586 i686
    40 ExclusiveArch:  i586 i686
    39 BuildArch:      i686
    41 BuildArch:      i686
    41 %endif
    43 %endif
    42 
    44 
    43 # general build definitions
    45 # general build definitions
    44 %define progname firefox
    46 %define progname firefox
    45 %define pkgname  MozillaFirefox
    47 %define pkgname  MozillaFirefox
       
    48 %define srcname  firefox
    46 %define appname  Firefox
    49 %define appname  Firefox
    47 %define progdir %{_prefix}/%_lib/%{progname}
    50 %define progdir %{_prefix}/%_lib/%{progname}
    48 %define gnome_dir     %{_prefix}
    51 %define gnome_dir     %{_prefix}
    49 %define desktop_file_name %{progname}
    52 %define desktop_file_name %{progname}
    50 %define firefox_appid \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
    53 %define firefox_appid \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
    60 Name:           %{pkgname}
    63 Name:           %{pkgname}
    61 BuildRequires:  Mesa-devel
    64 BuildRequires:  Mesa-devel
    62 BuildRequires:  alsa-devel
    65 BuildRequires:  alsa-devel
    63 BuildRequires:  autoconf213
    66 BuildRequires:  autoconf213
    64 BuildRequires:  dbus-1-glib-devel
    67 BuildRequires:  dbus-1-glib-devel
       
    68 BuildRequires:  dejavu-fonts
    65 BuildRequires:  fdupes
    69 BuildRequires:  fdupes
    66 BuildRequires:  memory-constraints
    70 BuildRequires:  memory-constraints
    67 %if 0%{?suse_version} <= 1320
    71 %if 0%{?suse_version} <= 1320
    68 BuildRequires:  gcc7-c++
    72 BuildRequires:  gcc7-c++
    69 %else
    73 %else
    70 BuildRequires:  gcc-c++
    74 BuildRequires:  gcc-c++
    71 %endif
    75 %endif
    72 BuildRequires:  cargo >= 1.30
    76 BuildRequires:  cargo >= 1.36
    73 BuildRequires:  libXcomposite-devel
    77 BuildRequires:  libXcomposite-devel
    74 BuildRequires:  libcurl-devel
    78 BuildRequires:  libcurl-devel
    75 BuildRequires:  libidl-devel
    79 BuildRequires:  libidl-devel
    76 BuildRequires:  libiw-devel
    80 BuildRequires:  libiw-devel
    77 BuildRequires:  libnotify-devel
    81 BuildRequires:  libnotify-devel
    78 BuildRequires:  libproxy-devel
    82 BuildRequires:  libproxy-devel
    79 BuildRequires:  makeinfo
    83 BuildRequires:  makeinfo
    80 BuildRequires:  mozilla-nspr-devel >= 4.20
    84 BuildRequires:  mozilla-nspr-devel >= 4.22
    81 BuildRequires:  mozilla-nss-devel >= 3.41
    85 BuildRequires:  mozilla-nss-devel >= 3.46.1
    82 BuildRequires:  nodejs >= 8.11
    86 BuildRequires:  nasm >= 2.13
       
    87 BuildRequires:  nodejs8 >= 8.11
    83 BuildRequires:  python-devel
    88 BuildRequires:  python-devel
    84 BuildRequires:  python2-xml
    89 BuildRequires:  python2-xml
    85 BuildRequires:  python3 >= 3.5
    90 BuildRequires:  python3 >= 3.5
    86 BuildRequires:  rust >= 1.30
    91 BuildRequires:  rust >= 1.36
    87 BuildRequires:  rust-cbindgen >= 0.6.7
    92 BuildRequires:  rust-cbindgen >= 0.9.1
    88 BuildRequires:  startup-notification-devel
    93 BuildRequires:  startup-notification-devel
    89 BuildRequires:  unzip
    94 BuildRequires:  unzip
    90 BuildRequires:  update-desktop-files
    95 BuildRequires:  update-desktop-files
    91 BuildRequires:  xorg-x11-libXt-devel
    96 BuildRequires:  xorg-x11-libXt-devel
       
    97 %if 0%{?do_profiling}
       
    98 BuildRequires:  xvfb-run
       
    99 %endif
    92 BuildRequires:  yasm
   100 BuildRequires:  yasm
    93 BuildRequires:  zip
   101 BuildRequires:  zip
    94 %if 0%{?suse_version} < 1550
   102 %if 0%{?suse_version} < 1550
    95 BuildRequires:  pkgconfig(gconf-2.0)
   103 BuildRequires:  pkgconfig(gconf-2.0) >= 1.2.1
    96 %endif
   104 %endif
    97 BuildRequires:  pkgconfig(gdk-x11-2.0)
   105 BuildRequires:  pkgconfig(gdk-x11-2.0)
    98 BuildRequires:  pkgconfig(glib-2.0) >= 2.22
   106 BuildRequires:  pkgconfig(glib-2.0) >= 2.22
    99 BuildRequires:  pkgconfig(gobject-2.0)
   107 BuildRequires:  pkgconfig(gobject-2.0)
   100 BuildRequires:  pkgconfig(gtk+-2.0) >= 2.18.0
   108 BuildRequires:  pkgconfig(gtk+-2.0) >= 2.18.0
   129 Provides:       mozilla-kde4-version = %{kde_helper_version}
   137 Provides:       mozilla-kde4-version = %{kde_helper_version}
   130 Summary:        Mozilla %{appname} Web Browser
   138 Summary:        Mozilla %{appname} Web Browser
   131 License:        MPL-2.0
   139 License:        MPL-2.0
   132 Group:          Productivity/Networking/Web/Browsers
   140 Group:          Productivity/Networking/Web/Browsers
   133 Url:            http://www.mozilla.org/
   141 Url:            http://www.mozilla.org/
   134 Source:         http://ftp.mozilla.org/pub/firefox/releases/%{version}/source/firefox-%{orig_version}%{orig_suffix}.source.tar.xz
   142 %if !%{with only_print_mozconfig}
       
   143 Source:         http://ftp.mozilla.org/pub/%{srcname}/releases/%{version}%{orig_suffix}/source/%{srcname}-%{orig_version}%{orig_suffix}.source.tar.xz
   135 Source1:        MozillaFirefox.desktop
   144 Source1:        MozillaFirefox.desktop
   136 Source2:        MozillaFirefox-rpmlintrc
   145 Source2:        MozillaFirefox-rpmlintrc
   137 Source3:        mozilla.sh.in
   146 Source3:        mozilla.sh.in
       
   147 Source4:        tar_stamps
   138 Source5:        source-stamp.txt
   148 Source5:        source-stamp.txt
   139 Source6:        kde.js
       
   140 Source7:        l10n-%{orig_version}%{orig_suffix}.tar.xz
   149 Source7:        l10n-%{orig_version}%{orig_suffix}.tar.xz
   141 Source8:        firefox-mimeinfo.xml
   150 Source8:        firefox-mimeinfo.xml
   142 Source9:        firefox.js
   151 Source9:        firefox.js
   143 Source10:       compare-locales.tar.xz
   152 Source10:       compare-locales.tar.xz
   144 Source11:       firefox.1
   153 Source11:       firefox.1
   145 Source12:       mozilla-get-app-id
   154 Source12:       mozilla-get-app-id
   146 Source13:       spellcheck.js
   155 Source13:       spellcheck.js
   147 Source14:       create-tar.sh
   156 Source14:       https://github.com/openSUSE/firefox-scripts/raw/master/create-tar.sh
   148 Source15:       firefox-appdata.xml
   157 Source15:       firefox-appdata.xml
   149 Source16:       MozillaFirefox.changes
   158 Source16:       %{name}.changes
   150 # Set up API keys, see http://www.chromium.org/developers/how-tos/api-keys
   159 # Set up API keys, see http://www.chromium.org/developers/how-tos/api-keys
   151 # Note: these are for the openSUSE Firefox builds ONLY. For your own distribution,
   160 # Note: these are for the openSUSE Firefox builds ONLY. For your own distribution,
   152 # please get your own set of keys.
   161 # please get your own set of keys.
   153 Source18:       mozilla-api-key
   162 Source18:       mozilla-api-key
   154 Source19:       google-api-key
   163 Source19:       google-api-key
   155 Source20:       http://ftp.mozilla.org/pub/firefox/releases/%{version}/source/firefox-%{orig_version}%{orig_suffix}.source.tar.xz.asc
   164 Source20:       https://ftp.mozilla.org/pub/%{srcname}/releases/%{version}%{orig_suffix}/source/%{srcname}-%{orig_version}%{orig_suffix}.source.tar.xz.asc
   156 Source21:       mozilla.keyring
   165 Source21:       https://ftp.mozilla.org/pub/%{srcname}/releases/%{version}%{orig_suffix}/KEY#/mozilla.keyring
   157 # Gecko/Toolkit
   166 # Gecko/Toolkit
   158 Patch1:         mozilla-nongnome-proxies.patch
   167 Patch1:         mozilla-nongnome-proxies.patch
   159 Patch2:         mozilla-kde.patch
   168 Patch2:         mozilla-kde.patch
   160 Patch3:         mozilla-ntlm-full-path.patch
   169 Patch3:         mozilla-ntlm-full-path.patch
   161 Patch4:         mozilla-openaes-decl.patch
   170 Patch4:         mozilla-openaes-decl.patch
   162 Patch7:         mozilla-aarch64-startup-crash.patch
   171 Patch5:         mozilla-aarch64-startup-crash.patch
   163 Patch8:         mozilla-bmo256180.patch
   172 Patch6:         mozilla-bmo1463035.patch
   164 Patch9:         mozilla-bmo1463035.patch
   173 Patch7:         mozilla-cubeb-noreturn.patch
   165 Patch10:        mozilla-cubeb-noreturn.patch
   174 Patch8:         mozilla-fix-aarch64-libopus.patch
       
   175 Patch9:         mozilla-disable-wasm-emulate-arm-unaligned-fp-access.patch
       
   176 Patch10:        mozilla-s390-context.patch
       
   177 Patch11:        mozilla-s390-bigendian.patch
       
   178 Patch12:        mozilla-reduce-rust-debuginfo.patch
       
   179 Patch13:        mozilla-ppc-altivec_static_inline.patch
       
   180 Patch14:        mozilla-bmo1005535.patch
       
   181 Patch15:        mozilla-bmo1568145.patch
       
   182 Patch16:        mozilla-bmo1504834-part1.patch
       
   183 Patch17:        mozilla-bmo1504834-part2.patch
       
   184 Patch18:        mozilla-bmo1504834-part3.patch
       
   185 Patch19:        mozilla-bmo1511604.patch
       
   186 Patch20:        mozilla-bmo1554971.patch
       
   187 Patch21:        mozilla-bmo1512162.patch
       
   188 Patch22:        mozilla-fix-top-level-asm.patch
   166 # Firefox/browser
   189 # Firefox/browser
   167 Patch101:       firefox-kde.patch
   190 Patch101:       firefox-kde.patch
   168 Patch102:       firefox-branded-icons.patch
   191 Patch102:       firefox-branded-icons.patch
       
   192 %endif # only_print_mozconfig
   169 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
   193 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
   170 Requires(post):   coreutils shared-mime-info desktop-file-utils
   194 Requires(post):   coreutils shared-mime-info desktop-file-utils
   171 Requires(postun): shared-mime-info desktop-file-utils
   195 Requires(postun): shared-mime-info desktop-file-utils
   172 %if %branding
   196 Requires:       %{name}-branding >= 68
   173 Requires:       %{name}-branding > 44.0
       
   174 %endif
       
   175 Requires:       mozilla-nspr >= %(rpm -q --queryformat '%%{VERSION}' mozilla-nspr)
   197 Requires:       mozilla-nspr >= %(rpm -q --queryformat '%%{VERSION}' mozilla-nspr)
   176 Requires:       mozilla-nss >= %(rpm -q --queryformat '%%{VERSION}' mozilla-nss)
   198 Requires:       mozilla-nss >= %(rpm -q --queryformat '%%{VERSION}' mozilla-nss)
   177 Recommends:     libcanberra0
   199 Recommends:     libcanberra0
   178 Recommends:     libpulse0
   200 Recommends:     libpulse0
   179 # addon leads to startup crash (bnc#908892)
   201 # addon leads to startup crash (bnc#908892)
   180 Obsoletes:      tracker-miner-firefox < 0.15
   202 Obsoletes:      tracker-miner-firefox < 0.15
       
   203 %if 0%{?devpkg} == 0
       
   204 Obsoletes:      %{name}-devel < %{version}
       
   205 %endif
   181 # libproxy's mozjs pacrunner crashes FF (bnc#759123)
   206 # libproxy's mozjs pacrunner crashes FF (bnc#759123)
   182 %if 0%{?suse_version} < 1220
   207 %if 0%{?suse_version} < 1220
   183 Obsoletes:      libproxy1-pacrunner-mozjs <= 0.4.7
   208 Obsoletes:      libproxy1-pacrunner-mozjs <= 0.4.7
   184 %endif
   209 %endif
   185 ##BuildArch:      i686 x86_64 aarch64 ppc64le
   210 ##BuildArch:      i686 x86_64 aarch64 ppc64le
   187 %description
   212 %description
   188 Mozilla Firefox is a standalone web browser, designed for standards
   213 Mozilla Firefox is a standalone web browser, designed for standards
   189 compliance and performance.  Its functionality can be enhanced via a
   214 compliance and performance.  Its functionality can be enhanced via a
   190 plethora of extensions.
   215 plethora of extensions.
   191 
   216 
       
   217 %if 0%{?devpkg}
   192 %package devel
   218 %package devel
   193 Summary:        Devel package for %{appname}
   219 Summary:        Devel package for %{appname}
   194 Group:          Development/Tools/Other
   220 Group:          Development/Tools/Other
   195 Provides:       firefox-devel = %{version}-%{release}
   221 Provides:       firefox-devel = %{version}-%{release}
   196 Requires:       %{name} = %{version}
   222 Requires:       %{name} = %{version}
   197 Requires:       perl(Archive::Zip)
   223 Requires:       perl(Archive::Zip)
   198 Requires:       perl(XML::Simple)
   224 Requires:       perl(XML::Simple)
   199 
   225 
   200 %description devel
   226 %description devel
   201 Development files for %{appname} to make packaging of addons easier.
   227 Development files for %{appname} to make packaging of addons easier.
       
   228 %endif
   202 
   229 
   203 %if %localize
   230 %if %localize
   204 %package translations-common
   231 %package translations-common
   205 Summary:        Common translations for %{appname}
   232 Summary:        Common translations for %{appname}
   206 Group:          System/Localization
   233 Group:          System/Localization
   207 Provides:       locale(%{name}:ar;ca;cs;da;de;en_GB;el;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)
   234 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)
   208 Requires:       %{name} = %{version}
   235 Requires:       %{name} = %{version}
   209 Obsoletes:      %{name}-translations < %{version}-%{release}
   236 Obsoletes:      %{name}-translations < %{version}-%{release}
   210 
   237 
   211 %description translations-common
   238 %description translations-common
   212 This package contains several common languages for the user interface
   239 This package contains several common languages for the user interface
   213 of %{appname}.
   240 of %{appname}.
   214 
   241 
   215 %package translations-other
   242 %package translations-other
   216 Summary:        Extra translations for %{appname}
   243 Summary:        Extra translations for %{appname}
   217 Group:          System/Localization
   244 Group:          System/Localization
   218 Provides:       locale(%{name}:ach;af;an;as;ast;az;bg;bn_BD;bn_IN;br;bs;cak;cy;dsb;en_ZA;eo;es_MX;et;eu;fa;ff;fy_NL;ga_IE;gd;gl;gn;gu_IN;he;hi_IN;hr;hsb;hy_AM;id;is;ka;kab;kk;km;kn;lij;lt;lv;mai;mk;ml;mr;ms;ne-NP;nn_NO;oc;or;pa_IN;rm;ro;si;sk;sl;son;sq;sr;ta;te;th;tr;uk;uz;vi;xh)
   245 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)
   219 Requires:       %{name} = %{version}
   246 Requires:       %{name} = %{version}
   220 Obsoletes:      %{name}-translations < %{version}-%{release}
   247 Obsoletes:      %{name}-translations < %{version}-%{release}
   221 
   248 
   222 %description translations-other
   249 %description translations-other
   223 This package contains rarely used languages for the user interface
   250 This package contains rarely used languages for the user interface
   224 of %{appname}.
   251 of %{appname}.
   225 %endif
   252 %endif
   226 
   253 
   227 %if %branding
       
   228 %package branding-upstream
   254 %package branding-upstream
   229 Summary:        Upstream branding for %{appname}
   255 Summary:        Upstream branding for %{appname}
   230 Group:          Productivity/Networking/Web/Browsers
   256 Group:          Productivity/Networking/Web/Browsers
   231 Provides:       %{name}-branding = %{version}
   257 Provides:       %{name}-branding = %{version}
   232 Conflicts:      otherproviders(%{name}-branding)
   258 Conflicts:      otherproviders(%{name}-branding)
   241 #BRAND: custom preference overrides.
   267 #BRAND: custom preference overrides.
   242 #BRAND: It's also possible to drop files in /usr/lib/firefox/distribution/searchplugins/common/
   268 #BRAND: It's also possible to drop files in /usr/lib/firefox/distribution/searchplugins/common/
   243 
   269 
   244 %description branding-upstream
   270 %description branding-upstream
   245 This package provides upstream look and feel for %{appname}.
   271 This package provides upstream look and feel for %{appname}.
   246 %endif
       
   247 
   272 
   248 %if %crashreporter
   273 %if %crashreporter
   249 %package buildsymbols
   274 %package buildsymbols
   250 Summary:        Breakpad buildsymbols for %{appname}
   275 Summary:        Breakpad buildsymbols for %{appname}
   251 Group:          Development/Debug
   276 Group:          Development/Debug
   253 %description buildsymbols
   278 %description buildsymbols
   254 This subpackage contains the Breakpad created and compatible debugging
   279 This subpackage contains the Breakpad created and compatible debugging
   255 symbols meant for upload to Mozilla's crash collector database.
   280 symbols meant for upload to Mozilla's crash collector database.
   256 %endif
   281 %endif
   257 
   282 
       
   283 %if !%{with only_print_mozconfig}
   258 %prep
   284 %prep
   259 %if %localize
   285 %if %localize
   260 %setup -q -n %{source_prefix} -b 7 -b 10
   286 
   261 %else
   287 # If generated incorrectly, the tarball will be ~270B in
   262 %setup -q -n %{source_prefix}
   288 # size, so 1MB seems like good enough limit to check.
   263 %endif
   289 MINSIZE=1048576
   264 cd $RPM_BUILD_DIR/%{source_prefix}
   290 if (( $(stat -Lc%s "%{SOURCE7}") < MINSIZE)); then
       
   291     echo "Translations tarball %{SOURCE7} not generated properly."
       
   292     exit 1
       
   293 fi
       
   294 
       
   295 %setup -q -n %{srcname}-%{orig_version} -b 7 -b 10
       
   296 %else
       
   297 %setup -q -n %{srcname}-%{orig_version}
       
   298 %endif
       
   299 cd $RPM_BUILD_DIR/%{srcname}-%{orig_version}
   265 %patch1 -p1
   300 %patch1 -p1
   266 %patch2 -p1
   301 %patch2 -p1
   267 %patch3 -p1
   302 %patch3 -p1
   268 %patch4 -p1
   303 %patch4 -p1
       
   304 %patch5 -p1
       
   305 %patch6 -p1
   269 %patch7 -p1
   306 %patch7 -p1
   270 %patch8 -p1
   307 %patch8 -p1
   271 %patch9 -p1
   308 %patch9 -p1
   272 %patch10 -p1
   309 %patch10 -p1
       
   310 %ifarch s390x ppc64
       
   311 %patch11 -p1
       
   312 %endif
       
   313 %patch12 -p1
       
   314 %patch13 -p1
       
   315 %patch14 -p1
       
   316 %patch15 -p1
       
   317 %patch16 -p1
       
   318 %patch17 -p1
       
   319 %patch18 -p1
       
   320 %patch19 -p1
       
   321 %patch20 -p1
       
   322 %patch21 -p1
       
   323 %patch22 -p1
   273 # Firefox
   324 # Firefox
   274 %patch101 -p1
   325 %patch101 -p1
   275 %patch102 -p1
   326 %patch102 -p1
       
   327 %endif # only_print_mozconfig
   276 
   328 
   277 %build
   329 %build
       
   330 %if !%{with only_print_mozconfig}
   278 # no need to add build time to binaries
   331 # no need to add build time to binaries
   279 modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/MozillaFirefox.changes")"
   332 modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")"
   280 DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\""
   333 DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\""
   281 TIME="\"$(date -d "${modified}" "+%%R")\""
   334 TIME="\"$(date -d "${modified}" "+%%R")\""
   282 find . -regex ".*\.c\|.*\.cpp\|.*\.h" -exec sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" {} +
   335 find . -regex ".*\.c\|.*\.cpp\|.*\.h" -exec sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" {} +
   283 #
   336 #
   284 kdehelperversion=$(cat toolkit/xre/nsKDEUtils.cpp | grep '#define KMOZILLAHELPER_VERSION' | cut -d ' ' -f 3)
   337 kdehelperversion=$(cat toolkit/xre/nsKDEUtils.cpp | grep '#define KMOZILLAHELPER_VERSION' | cut -d ' ' -f 3)
   285 if test "$kdehelperversion" != %{kde_helper_version}; then
   338 if test "$kdehelperversion" != %{kde_helper_version}; then
   286   echo fix kde helper version in the .spec file
   339   echo fix kde helper version in the .spec file
   287   exit 1
   340   exit 1
   288 fi
   341 fi
   289 source %{SOURCE5}
   342 source %{SOURCE5}
       
   343 %endif # only_print_mozconfig
       
   344 
       
   345 export CARGO_HOME=${RPM_BUILD_DIR}/%{srcname}-%{orig_version}/.cargo
   290 export MOZ_SOURCE_CHANGESET=$REV
   346 export MOZ_SOURCE_CHANGESET=$REV
   291 export SOURCE_REPO=$REPO
   347 export SOURCE_REPO=$REPO
   292 export source_repo=$REPO
   348 export source_repo=$REPO
   293 export MOZ_SOURCE_REPO=$REPO
   349 export MOZ_SOURCE_REPO=$REPO
   294 export MOZ_BUILD_DATE=%{releasedate}
   350 export MOZ_BUILD_DATE=%{releasedate}
   315 export CFLAGS="$CFLAGS -mminimal-toc"
   371 export CFLAGS="$CFLAGS -mminimal-toc"
   316 %endif
   372 %endif
   317 %endif
   373 %endif
   318 export CXXFLAGS="$CFLAGS"
   374 export CXXFLAGS="$CFLAGS"
   319 export MOZCONFIG=$RPM_BUILD_DIR/mozconfig
   375 export MOZCONFIG=$RPM_BUILD_DIR/mozconfig
   320 %limit_build -m 1500
   376 %if %{with only_print_mozconfig}
       
   377 echo "export CC=$CC"
       
   378 echo "export CXX=$CXX"
       
   379 echo "export CFLAGS=\"$CFLAGS\""
       
   380 echo "export LDFLAGS=\"$LDFLAGS\""
       
   381 echo "export RUSTFLAGS=\"$RUSTFLAGS\""
       
   382 echo ""
       
   383 cat << EOF
       
   384 %else
       
   385 %limit_build -m 2000
   321 cat << EOF > $MOZCONFIG
   386 cat << EOF > $MOZCONFIG
       
   387 %endif
   322 mk_add_options MOZILLA_OFFICIAL=1
   388 mk_add_options MOZILLA_OFFICIAL=1
   323 mk_add_options BUILD_OFFICIAL=1
   389 mk_add_options BUILD_OFFICIAL=1
   324 mk_add_options MOZ_MAKE_FLAGS=%{?jobs:-j%jobs}
   390 mk_add_options MOZ_MAKE_FLAGS=%{?jobs:-j%jobs}
   325 mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obj
   391 mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obj
   326 . \$topsrcdir/browser/config/mozconfig
   392 . \$topsrcdir/browser/config/mozconfig
   337 ac_add_options --disable-debug-symbols
   403 ac_add_options --disable-debug-symbols
   338 %else
   404 %else
   339 ac_add_options --enable-debug-symbols
   405 ac_add_options --enable-debug-symbols
   340 %endif
   406 %endif
   341 %if 0%{?suse_version} > 1549
   407 %if 0%{?suse_version} > 1549
   342 %ifnarch aarch64 ppc64 ppc64le
   408 %ifnarch aarch64 ppc64 ppc64le s390x
   343 ac_add_options --disable-elf-hack
   409 ac_add_options --disable-elf-hack
   344 %endif
   410 %endif
   345 %endif
   411 %endif
   346 ac_add_options --with-system-nspr
   412 ac_add_options --with-system-nspr
   347 ac_add_options --with-system-nss
   413 ac_add_options --with-system-nss
   357 ac_add_options --disable-debug
   423 ac_add_options --disable-debug
   358 ac_add_options --enable-startup-notification
   424 ac_add_options --enable-startup-notification
   359 #ac_add_options --enable-chrome-format=jar
   425 #ac_add_options --enable-chrome-format=jar
   360 ac_add_options --enable-update-channel=%{update_channel}
   426 ac_add_options --enable-update-channel=%{update_channel}
   361 ac_add_options --with-mozilla-api-keyfile=%{SOURCE18}
   427 ac_add_options --with-mozilla-api-keyfile=%{SOURCE18}
   362 ac_add_options --with-google-api-keyfile=%{SOURCE19}
   428 ac_add_options --with-google-location-service-api-keyfile=%{SOURCE19}
       
   429 ac_add_options --with-google-safebrowsing-api-keyfile=%{SOURCE19}
   363 ac_add_options --with-unsigned-addon-scopes=app
   430 ac_add_options --with-unsigned-addon-scopes=app
   364 %if %branding
   431 %if %branding
   365 ac_add_options --enable-official-branding
   432 ac_add_options --enable-official-branding
   366 %endif
   433 %endif
   367 ac_add_options --enable-libproxy
   434 ac_add_options --enable-libproxy
   378 %endif
   445 %endif
   379 %endif
   446 %endif
   380 %ifarch aarch64 %arm s390x
   447 %ifarch aarch64 %arm s390x
   381 ac_add_options --disable-webrtc
   448 ac_add_options --disable-webrtc
   382 %endif
   449 %endif
       
   450 # mitigation/workaround for bmo#1512162
       
   451 %ifarch s390x
       
   452 ac_add_options --enable-optimize="-O1"
       
   453 %endif
   383 %ifarch x86_64
   454 %ifarch x86_64
   384 # LTO needs newer toolchain stack only (at least GCC 8.2.1 (r268506)
   455 # LTO needs newer toolchain stack only (at least GCC 8.2.1 (r268506)
   385 %if 0%{?suse_version} > 1500
   456 %if 0%{?suse_version} > 1500
   386 ac_add_options --enable-lto
   457 ac_add_options --enable-lto
       
   458 %if 0%{?do_profiling}
       
   459 ac_add_options MOZ_PGO=1
       
   460 %endif
   387 %endif
   461 %endif
   388 %endif
   462 %endif
   389 EOF
   463 EOF
   390 ./mach build
   464 %if !%{with only_print_mozconfig}
       
   465 %ifarch ppc64 s390x s390
       
   466 # NOTE: Currently, system-icu is too old, so we can't build with that,
       
   467 #       but have to generate the .dat-file freshly. This seems to be a
       
   468 #       less fragile approach anyways.
       
   469 # ac_add_options --with-system-icu
       
   470 echo "Generate big endian version of config/external/icu/data/icud58l.dat"
       
   471 ./mach python intl/icu_sources_data.py .
       
   472 ls -l config/external/icu/data
       
   473 rm -f config/external/icu/data/icudt*l.dat
       
   474 %endif
       
   475 %if 0%{?do_profiling}
       
   476 xvfb-run --server-args="-screen 0 1920x1080x24" \
       
   477 %endif
       
   478 ./mach build -v
       
   479 %endif # only_print_mozconfig
   391 
   480 
   392 %install
   481 %install
   393 cd $RPM_BUILD_DIR/obj
   482 cd $RPM_BUILD_DIR/obj
   394 source %{SOURCE5}
   483 source %{SOURCE5}
   395 export MOZ_SOURCE_STAMP=$REV
   484 export MOZ_SOURCE_STAMP=$REV
   401 make -C browser/installer STRIP=/bin/true MOZ_PKG_FATAL_WARNINGS=0
   490 make -C browser/installer STRIP=/bin/true MOZ_PKG_FATAL_WARNINGS=0
   402 #DEBUG (break the build if searchplugins are missing / temporary)
   491 #DEBUG (break the build if searchplugins are missing / temporary)
   403 grep amazondotcom dist/firefox/browser/omni.ja
   492 grep amazondotcom dist/firefox/browser/omni.ja
   404 # copy tree into RPM_BUILD_ROOT
   493 # copy tree into RPM_BUILD_ROOT
   405 mkdir -p %{buildroot}%{progdir}
   494 mkdir -p %{buildroot}%{progdir}
   406 cp -rf $RPM_BUILD_DIR/obj/dist/firefox/* %{buildroot}%{progdir}
   495 cp -rf $RPM_BUILD_DIR/obj/dist/%{srcname}/* %{buildroot}%{progdir}
   407 mkdir -p %{buildroot}%{progdir}/distribution/extensions
   496 mkdir -p %{buildroot}%{progdir}/distribution/extensions
   408 mkdir -p %{buildroot}%{progdir}/browser/defaults/preferences/
   497 mkdir -p %{buildroot}%{progdir}/browser/defaults/preferences/
       
   498 # renaming executables (for regular vs. ESR)
       
   499 %if "%{srcname}" != "%{progname}"
       
   500 mv %{buildroot}%{progdir}/%{srcname} %{buildroot}%{progdir}/%{progname}
       
   501 mv %{buildroot}%{progdir}/%{srcname}-bin %{buildroot}%{progdir}/%{progname}-bin
       
   502 %endif
   409 # install gre prefs
   503 # install gre prefs
   410 install -m 644 %{SOURCE13} %{buildroot}%{progdir}/defaults/pref/
   504 install -m 644 %{SOURCE13} %{buildroot}%{progdir}/defaults/pref/
   411 # install browser prefs
   505 # install browser prefs
   412 install -m 644 %{SOURCE6} %{buildroot}%{progdir}/browser/defaults/preferences/kde.js
       
   413 install -m 644 %{SOURCE9} %{buildroot}%{progdir}/browser/defaults/preferences/firefox.js
   506 install -m 644 %{SOURCE9} %{buildroot}%{progdir}/browser/defaults/preferences/firefox.js
   414 # install additional locales
   507 # build additional locales
   415 %if %localize
   508 %if %localize
   416 mkdir -p %{buildroot}%{progdir}/browser/extensions
   509 mkdir -p %{buildroot}%{progdir}/browser/extensions
   417 truncate -s 0 %{_tmppath}/translations.{common,other}
   510 truncate -s 0 %{_tmppath}/translations.{common,other}
   418 sed -r '/^(ja-JP-mac|en-US|)$/d;s/ .*$//' $RPM_BUILD_DIR/%{source_prefix}/browser/locales/shipped-locales \
   511 sed -r '/^(ja-JP-mac|en-US|)$/d;s/ .*$//' $RPM_BUILD_DIR/%{srcname}-%{orig_version}/browser/locales/shipped-locales \
   419     | xargs -P 8 -n 1 -I {} /bin/sh -c '
   512     | xargs -n 1 -I {} /bin/sh -c '
   420         locale=$1
   513         locale=$1
   421         pushd $RPM_BUILD_DIR/compare-locales
   514         pushd $RPM_BUILD_DIR/compare-locales
   422         PYTHONPATH=lib \
   515         PYTHONPATH=lib \
   423             scripts/compare-locales -m ../l10n-merged/$locale \
   516             scripts/compare-locales -m ../l10n-merged/$locale \
   424             ../%{source_prefix}/browser/locales/l10n.ini ../l10n $locale
   517             ../%{srcname}-%{orig_version}/browser/locales/l10n.ini ../l10n $locale
   425         popd
   518         popd
   426         LOCALE_MERGEDIR=$RPM_BUILD_DIR/l10n-merged/$locale \
   519         LOCALE_MERGEDIR=$RPM_BUILD_DIR/l10n-merged/$locale \
   427             make -C browser/locales langpack-$locale
   520             make -C browser/locales langpack-$locale
   428         cp -rL dist/xpi-stage/locale-$locale \
   521         cp -rL dist/xpi-stage/locale-$locale \
   429             %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org
   522             %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org
   430         # remove prefs, profile defaults, and hyphenation from langpack
   523         # remove prefs, profile defaults, and hyphenation from langpack
   431         rm -rf %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org/defaults
   524         rm -rf %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org/defaults
   432         rm -rf %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org/hyphenation
   525         rm -rf %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org/hyphenation
   433         # check against the fixed common list and sort into the right filelist
   526         # check against the fixed common list and sort into the right filelist
   434         _matched=0
   527         _matched=0
   435         for _match in ar ca cs da de en-GB el 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
   528         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
   436             [ "$_match" = "$locale" ] && _matched=1
   529             [ "$_match" = "$locale" ] && _matched=1
   437         done
   530         done
   438         [ $_matched -eq 1 ] && _l10ntarget=common || _l10ntarget=other
   531         [ $_matched -eq 1 ] && _l10ntarget=common || _l10ntarget=other
   439         echo %{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org \
   532         echo %{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org \
   440             >> %{_tmppath}/translations.$_l10ntarget
   533             >> %{_tmppath}/translations.$_l10ntarget
   455 find %{buildroot}%{progdir} -type f -name ".mkdir.done" -delete
   548 find %{buildroot}%{progdir} -type f -name ".mkdir.done" -delete
   456 # overwrite the mozilla start-script and link it to /usr/bin
   549 # overwrite the mozilla start-script and link it to /usr/bin
   457 mkdir --parents %{buildroot}/usr/bin
   550 mkdir --parents %{buildroot}/usr/bin
   458 sed "s:%%PREFIX:%{_prefix}:g
   551 sed "s:%%PREFIX:%{_prefix}:g
   459 s:%%PROGDIR:%{progdir}:g
   552 s:%%PROGDIR:%{progdir}:g
   460 s:%%APPNAME:firefox:g
   553 s:%%APPNAME:%{progname}:g
   461 s:%%PROFILE:.mozilla/firefox:g" \
   554 s:%%PROFILE:.mozilla/firefox:g" \
   462   %{SOURCE3} > %{buildroot}%{progdir}/%{progname}.sh
   555   %{SOURCE3} > %{buildroot}%{progdir}/%{progname}.sh
   463 chmod 755 %{buildroot}%{progdir}/%{progname}.sh
   556 chmod 755 %{buildroot}%{progdir}/%{progname}.sh
   464 ln -sf ../..%{progdir}/%{progname}.sh %{buildroot}%{_bindir}/%{progname}
   557 ln -sf ../..%{progdir}/%{progname}.sh %{buildroot}%{_bindir}/%{progname}
   465 # desktop file
   558 # desktop file
   472 # additional mime-types
   565 # additional mime-types
   473 mkdir -p %{buildroot}%{_datadir}/mime/packages
   566 mkdir -p %{buildroot}%{_datadir}/mime/packages
   474 cp %{SOURCE8} %{buildroot}%{_datadir}/mime/packages/%{progname}.xml
   567 cp %{SOURCE8} %{buildroot}%{_datadir}/mime/packages/%{progname}.xml
   475 # appdata
   568 # appdata
   476 mkdir -p %{buildroot}%{_datadir}/appdata
   569 mkdir -p %{buildroot}%{_datadir}/appdata
   477 cp %{SOURCE15} %{buildroot}%{_datadir}/appdata/%{desktop_file_name}.appdata.xml
   570 sed "s:firefox.desktop:%{desktop_file_name}:g" \
       
   571   %{SOURCE15} > %{buildroot}%{_datadir}/appdata/%{desktop_file_name}.appdata.xml
   478 # install man-page
   572 # install man-page
   479 mkdir -p %{buildroot}%{_mandir}/man1/
   573 mkdir -p %{buildroot}%{_mandir}/man1/
   480 cp %{SOURCE11} %{buildroot}%{_mandir}/man1/%{progname}.1
   574 cp %{SOURCE11} %{buildroot}%{_mandir}/man1/%{progname}.1
   481 ##########
   575 ##########
   482 # ADDONS
   576 # ADDONS
   502 rm -f %{buildroot}%{progdir}/old-homepage-default.properties
   596 rm -f %{buildroot}%{progdir}/old-homepage-default.properties
   503 rm -f %{buildroot}%{progdir}/run-mozilla.sh
   597 rm -f %{buildroot}%{progdir}/run-mozilla.sh
   504 rm -f %{buildroot}%{progdir}/LICENSE
   598 rm -f %{buildroot}%{progdir}/LICENSE
   505 rm -f %{buildroot}%{progdir}/precomplete
   599 rm -f %{buildroot}%{progdir}/precomplete
   506 rm -f %{buildroot}%{progdir}/update-settings.ini
   600 rm -f %{buildroot}%{progdir}/update-settings.ini
       
   601 %if 0%{?devpkg}
   507 # devel
   602 # devel
   508 mkdir -p %{buildroot}%{_bindir}
   603 mkdir -p %{buildroot}%{_bindir}
   509 install -m 755 %SOURCE12 %{buildroot}%{_bindir}
   604 install -m 755 %SOURCE12 %{buildroot}%{_bindir}
   510 # inspired by mandriva
   605 # inspired by mandriva
   511 mkdir -p %{buildroot}%{_sysconfdir}/rpm
   606 mkdir -p %{buildroot}%{_sysconfdir}/rpm
   523    extdir="%%{buildroot}%%{firefox_extdir}/`mozilla-get-app-id '%%1'`" \
   618    extdir="%%{buildroot}%%{firefox_extdir}/`mozilla-get-app-id '%%1'`" \
   524    mkdir -p "$extdir" \
   619    mkdir -p "$extdir" \
   525    %%{__unzip} -q -d "$extdir" "%%1" \
   620    %%{__unzip} -q -d "$extdir" "%%1" \
   526    %%{nil}
   621    %%{nil}
   527 FIN
   622 FIN
   528 # just dumping an xpi file there doesn't work...
   623 %endif
   529 #%%firefox_ext_install() \
       
   530 #       extdir="%%{buildroot}%%{firefox_extdir}" \
       
   531 #       mkdir -p "$extdir" \
       
   532 #       cp "%%1" "$extdir" \
       
   533 #       %%{nil}
       
   534 # fdupes
   624 # fdupes
   535 %fdupes %{buildroot}%{progdir}
   625 %fdupes %{buildroot}%{progdir}
   536 %fdupes %{buildroot}%{_datadir}
   626 %fdupes %{buildroot}%{_datadir}
   537 # create breakpad debugsymbols
   627 # create breakpad debugsymbols
   538 %if %crashreporter
   628 %if %crashreporter
   582 %{progdir}/defaults/
   672 %{progdir}/defaults/
   583 %dir %{progdir}/gtk2
   673 %dir %{progdir}/gtk2
   584 %{progdir}/gtk2/libmozgtk.so
   674 %{progdir}/gtk2/libmozgtk.so
   585 %{progdir}/gmp-clearkey/
   675 %{progdir}/gmp-clearkey/
   586 %attr(755,root,root) %{progdir}/%{progname}.sh
   676 %attr(755,root,root) %{progdir}/%{progname}.sh
   587 %{progdir}/firefox
   677 %{progdir}/%{progname}
   588 %{progdir}/firefox-bin
   678 %{progdir}/%{progname}-bin
   589 %{progdir}/application.ini
   679 %{progdir}/application.ini
   590 %{progdir}/chrome.manifest
   680 %{progdir}/chrome.manifest
   591 %{progdir}/dependentlibs.list
   681 %{progdir}/dependentlibs.list
   592 %{progdir}/*.so
   682 %{progdir}/*.so
   593 %{progdir}/omni.ja
   683 %{progdir}/omni.ja
   614 %{gnome_dir}/share/icons/hicolor/
   704 %{gnome_dir}/share/icons/hicolor/
   615 %{_bindir}/%{progname}
   705 %{_bindir}/%{progname}
   616 %doc %{_mandir}/man1/%{progname}.1.gz
   706 %doc %{_mandir}/man1/%{progname}.1.gz
   617 %{_datadir}/appdata/
   707 %{_datadir}/appdata/
   618 
   708 
       
   709 %if 0%{?devpkg}
   619 %files devel
   710 %files devel
   620 %defattr(-,root,root)
   711 %defattr(-,root,root)
   621 %{_bindir}/mozilla-get-app-id
   712 %{_bindir}/mozilla-get-app-id
   622 %config %{_sysconfdir}/rpm/macros.%{progname}
   713 %config %{_sysconfdir}/rpm/macros.%{progname}
       
   714 %endif
   623 
   715 
   624 %if %localize
   716 %if %localize
   625 
       
   626 %files translations-common -f %{_tmppath}/translations.common
   717 %files translations-common -f %{_tmppath}/translations.common
   627 %defattr(-,root,root)
   718 %defattr(-,root,root)
   628 %dir %{progdir}
   719 %dir %{progdir}
   629 %dir %{progdir}/browser/extensions/
   720 %dir %{progdir}/browser/extensions/
   630 
   721 
   634 %dir %{progdir}/browser/extensions/
   725 %dir %{progdir}/browser/extensions/
   635 %endif
   726 %endif
   636 
   727 
   637 # this package does not need to provide files but is needed to fulfill
   728 # this package does not need to provide files but is needed to fulfill
   638 # requirements if no other branding package is to be installed
   729 # requirements if no other branding package is to be installed
   639 %if %branding
       
   640 %files branding-upstream
   730 %files branding-upstream
   641 %defattr(-,root,root)
   731 %defattr(-,root,root)
   642 %dir %{progdir}
   732 %dir %{progdir}
   643 %endif
       
   644 
   733 
   645 %if %crashreporter
   734 %if %crashreporter
   646 %files buildsymbols
   735 %files buildsymbols
   647 %defattr(-,root,root)
   736 %defattr(-,root,root)
   648 %{_datadir}/mozilla/*.zip
   737 %{_datadir}/mozilla/*.zip