author | Wolfgang Rosenauer <wr@rosenauer.org> |
Wed, 14 Jun 2017 13:47:28 +0200 | |
branch | firefox52 |
changeset 980 | c0c95a18e37c |
parent 976 | 14640a79141f |
child 988 | 85024ab72ccb |
permissions | -rw-r--r-- |
950 | 1 |
# |
2 |
# spec file for package firefox-esr |
|
3 |
# |
|
4 |
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. |
|
5 |
# 2006-2017 Wolfgang Rosenauer |
|
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 http://bugs.opensuse.org/ |
|
17 |
# |
|
18 |
||
19 |
||
20 |
# changed with every update |
|
21 |
%define major 52 |
|
980 | 22 |
%define mainver %major.2 |
950 | 23 |
%define update_channel esr52 |
980 | 24 |
%define releasedate 20170612000000 |
950 | 25 |
|
26 |
# PIE, full relro (x86_64 for now) |
|
27 |
%define build_hardened 1 |
|
28 |
||
29 |
%if 0%{?suse_version} > 1320 |
|
30 |
%define firefox_use_gtk3 1 |
|
31 |
%ifarch %ix86 x86_64 |
|
969
8d48ef5efb59
52.1.0 including esr variants and proper changelogs
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
968
diff
changeset
|
32 |
%define firefox_use_rust 0 |
950 | 33 |
%endif |
34 |
%endif |
|
35 |
||
36 |
# general build definitions |
|
37 |
%if "%{update_channel}" != "aurora" |
|
38 |
%define progname firefox |
|
39 |
%define pkgname firefox-esr |
|
40 |
%define appname Firefox |
|
41 |
%else |
|
42 |
%define progname firefox-dev |
|
43 |
%define pkgname firefox-dev-edition |
|
44 |
%define appname Firefox Developer Edition |
|
45 |
%endif |
|
46 |
%define progdir %{_prefix}/%_lib/%{progname} |
|
47 |
%define gnome_dir %{_prefix} |
|
48 |
%define desktop_file_name %{progname} |
|
49 |
%define firefox_appid \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\} |
|
50 |
%define _use_internal_dependency_generator 0 |
|
51 |
%define __find_requires sh %{SOURCE4} |
|
52 |
%global provfind sh -c "grep -v '.so' | %__find_provides" |
|
53 |
%global __find_provides %provfind |
|
54 |
# Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys |
|
55 |
# Note: these are for the openSUSE Firefox builds ONLY. For your own distribution, |
|
56 |
# please get your own set of keys. |
|
57 |
%define _google_api_key AIzaSyD1hTe85_a14kr1Ks8T3Ce75rvbR1_Dx7Q |
|
58 |
%if %update_channel == "aurora" |
|
59 |
%define branding 0 |
|
60 |
%else |
|
61 |
%define branding 1 |
|
62 |
%endif |
|
63 |
%define localize 1 |
|
64 |
%ifarch %ix86 x86_64 |
|
65 |
%define crashreporter 1 |
|
66 |
%else |
|
67 |
%define crashreporter 0 |
|
68 |
%endif |
|
69 |
||
70 |
Name: %{pkgname} |
|
71 |
BuildRequires: Mesa-devel |
|
72 |
BuildRequires: autoconf213 |
|
73 |
BuildRequires: dbus-1-glib-devel |
|
74 |
BuildRequires: fdupes |
|
75 |
BuildRequires: gcc-c++ |
|
76 |
BuildRequires: libXcomposite-devel |
|
77 |
BuildRequires: libcurl-devel |
|
78 |
BuildRequires: libgnomeui-devel |
|
79 |
BuildRequires: libidl-devel |
|
80 |
BuildRequires: libiw-devel |
|
81 |
BuildRequires: libnotify-devel |
|
82 |
BuildRequires: libproxy-devel |
|
83 |
BuildRequires: makeinfo |
|
84 |
BuildRequires: mozilla-nspr-devel >= 4.13.1 |
|
980 | 85 |
BuildRequires: mozilla-nss-devel >= 3.28.5 |
950 | 86 |
BuildRequires: nss-shared-helper-devel |
87 |
BuildRequires: python-devel |
|
88 |
BuildRequires: startup-notification-devel |
|
89 |
BuildRequires: unzip |
|
90 |
BuildRequires: update-desktop-files |
|
91 |
BuildRequires: xorg-x11-libXt-devel |
|
92 |
BuildRequires: yasm |
|
93 |
BuildRequires: zip |
|
969
8d48ef5efb59
52.1.0 including esr variants and proper changelogs
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
968
diff
changeset
|
94 |
BuildRequires: pkgconfig(libffi) |
950 | 95 |
BuildRequires: pkgconfig(libpulse) |
96 |
%if 0%{?firefox_use_gtk3} |
|
97 |
BuildRequires: pkgconfig(glib-2.0) |
|
98 |
BuildRequires: pkgconfig(gobject-2.0) |
|
99 |
BuildRequires: pkgconfig(gtk+-3.0) >= 3.4.0 |
|
100 |
BuildRequires: pkgconfig(gtk+-unix-print-3.0) |
|
101 |
%endif |
|
102 |
%if 0%{?firefox_use_rust} |
|
103 |
BuildRequires: cargo |
|
104 |
BuildRequires: rust >= 1.10 |
|
105 |
BuildRequires: rust-std |
|
106 |
%endif |
|
107 |
# libavcodec is required for H.264 support but the |
|
108 |
# openSUSE version is currently not able to play H.264 |
|
109 |
# therefore the Packman version is required |
|
110 |
# minimum version of libavcodec is 53 |
|
111 |
Recommends: libavcodec-full >= 0.10.16 |
|
112 |
Version: %{mainver} |
|
113 |
Release: 0 |
|
114 |
%if "%{name}" == "MozillaFirefox" |
|
115 |
Provides: firefox-esr = %{mainver} |
|
116 |
Provides: firefox-esr = %{version}-%{release} |
|
117 |
%endif |
|
118 |
Provides: web_browser |
|
119 |
Provides: browser(npapi) |
|
120 |
%if "%{update_channel}" != "aurora" |
|
121 |
Provides: appdata() |
|
122 |
Provides: appdata(firefox.appdata.xml) |
|
123 |
%endif |
|
124 |
# this is needed to match this package with the kde4 helper package without the main package |
|
125 |
# having a hard requirement on the kde4 package |
|
126 |
%define kde_helper_version 6 |
|
127 |
Provides: mozilla-kde4-version = %{kde_helper_version} |
|
128 |
Conflicts: firefox |
|
129 |
Summary: Mozilla %{appname} Web Browser |
|
130 |
License: MPL-2.0 |
|
131 |
Group: Productivity/Networking/Web/Browsers |
|
132 |
Url: http://www.mozilla.org/ |
|
133 |
Source: firefox-%{version}-source.tar.xz |
|
134 |
Source1: MozillaFirefox.desktop |
|
135 |
Source2: MozillaFirefox-rpmlintrc |
|
136 |
Source3: mozilla.sh.in |
|
137 |
Source4: find-external-requires.sh |
|
138 |
Source5: source-stamp.txt |
|
139 |
Source6: kde.js |
|
140 |
Source7: l10n-%{version}.tar.xz |
|
141 |
Source8: firefox-mimeinfo.xml |
|
142 |
Source9: firefox.js |
|
143 |
Source10: compare-locales.tar.xz |
|
144 |
Source11: firefox.1 |
|
145 |
Source12: mozilla-get-app-id |
|
146 |
Source13: spellcheck.js |
|
147 |
Source14: create-tar.sh |
|
148 |
Source15: firefox-appdata.xml |
|
149 |
Source16: firefox-esr.changes |
|
150 |
Source17: l10n_changesets.txt |
|
973
28f802837a7a
changes and update esr variants
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
969
diff
changeset
|
151 |
Source18: mozilla-api-key |
950 | 152 |
# Gecko/Toolkit |
153 |
Patch1: mozilla-nongnome-proxies.patch |
|
154 |
Patch2: mozilla-shared-nss-db.patch |
|
155 |
Patch3: mozilla-kde.patch |
|
156 |
Patch5: mozilla-language.patch |
|
157 |
Patch6: mozilla-ntlm-full-path.patch |
|
158 |
Patch7: mozilla-openaes-decl.patch |
|
159 |
Patch8: mozilla-no-stdcxx-check.patch |
|
160 |
Patch9: mozilla-reduce-files-per-UnifiedBindings.patch |
|
161 |
Patch10: mozilla-aarch64-startup-crash.patch |
|
162 |
# Firefox/browser |
|
163 |
Patch101: firefox-kde.patch |
|
164 |
Patch102: firefox-no-default-ualocale.patch |
|
165 |
Patch103: firefox-branded-icons.patch |
|
166 |
||
167 |
BuildRoot: %{_tmppath}/%{name}-%{version}-build |
|
168 |
Requires(post): coreutils shared-mime-info desktop-file-utils |
|
169 |
Requires(postun): shared-mime-info desktop-file-utils |
|
170 |
%if %branding |
|
171 |
Requires: %{name}-branding > 44.0 |
|
172 |
%endif |
|
173 |
Requires: mozilla-nspr >= %(rpm -q --queryformat '%{VERSION}' mozilla-nspr) |
|
174 |
Requires: mozilla-nss >= %(rpm -q --queryformat '%{VERSION}' mozilla-nss) |
|
175 |
Recommends: libcanberra0 |
|
176 |
Recommends: libpulse0 |
|
177 |
# addon leads to startup crash (bnc#908892) |
|
178 |
Obsoletes: tracker-miner-firefox < 0.15 |
|
179 |
# libproxy's mozjs pacrunner crashes FF (bnc#759123) |
|
180 |
%if 0%{?suse_version} < 1220 |
|
181 |
Obsoletes: libproxy1-pacrunner-mozjs <= 0.4.7 |
|
182 |
%endif |
|
183 |
||
184 |
%description |
|
185 |
Mozilla Firefox is a standalone web browser, designed for standards |
|
186 |
compliance and performance. Its functionality can be enhanced via a |
|
187 |
plethora of extensions. |
|
188 |
||
189 |
%package devel |
|
190 |
Summary: Devel package for %{appname} |
|
191 |
Group: Development/Tools/Other |
|
192 |
Provides: firefox-devel = %{version}-%{release} |
|
193 |
Requires: %{name} = %{version} |
|
194 |
Requires: perl(Archive::Zip) |
|
195 |
Requires: perl(XML::Simple) |
|
196 |
||
197 |
%description devel |
|
198 |
Development files for %{appname} to make packaging of addons easier. |
|
199 |
||
200 |
%if %localize |
|
201 |
%package translations-common |
|
202 |
Summary: Common translations for %{appname} |
|
203 |
Group: System/Localization |
|
204 |
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) |
|
205 |
Requires: %{name} = %{version} |
|
206 |
Obsoletes: %{name}-translations < %{version}-%{release} |
|
207 |
||
208 |
%description translations-common |
|
209 |
This package contains several common languages for the user interface |
|
210 |
of %{appname}. |
|
211 |
||
212 |
%package translations-other |
|
213 |
Summary: Extra translations for %{appname} |
|
214 |
Group: System/Localization |
|
215 |
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;nn_NO;or;pa_IN;rm;ro;si;sk;sl;son;sq;sr;ta;te;th;tr;uk;uz;vi;xh) |
|
216 |
Requires: %{name} = %{version} |
|
217 |
Obsoletes: %{name}-translations < %{version}-%{release} |
|
218 |
||
219 |
%description translations-other |
|
220 |
This package contains rarely used languages for the user interface |
|
221 |
of %{appname}. |
|
222 |
%endif |
|
223 |
||
224 |
%if %branding |
|
225 |
%package branding-upstream |
|
226 |
Summary: Upstream branding for %{appname} |
|
227 |
Group: Productivity/Networking/Web/Browsers |
|
228 |
Provides: %{name}-branding = %{version} |
|
229 |
Conflicts: otherproviders(MozillaFirefox-branding) |
|
230 |
Supplements: packageand(%{name}:branding-upstream) |
|
231 |
#BRAND: Provide three files - |
|
232 |
#BRAND: /usr/lib/firefox/browserconfig.properties that contains the |
|
233 |
#BRAND: default homepage and some other default configuration options |
|
234 |
#BRAND: /usr/lib/firefox/defaults/profile/bookmarks.html that contains |
|
235 |
#BRAND: the list of default bookmarks |
|
236 |
#BRAND: It's also possible to create a file |
|
237 |
#BRAND: /usr/lib/firefox/defaults/preferences/firefox-$vendor.js to set |
|
238 |
#BRAND: custom preference overrides. |
|
239 |
#BRAND: It's also possible to drop files in /usr/lib/firefox/distribution/searchplugins/common/ |
|
240 |
||
241 |
%description branding-upstream |
|
242 |
This package provides upstream look and feel for %{appname}. |
|
243 |
%endif |
|
244 |
||
245 |
%if %crashreporter |
|
246 |
%package buildsymbols |
|
247 |
Summary: Breakpad buildsymbols for %{appname} |
|
248 |
Group: Development/Debug |
|
249 |
||
250 |
%description buildsymbols |
|
251 |
This subpackage contains the Breakpad created and compatible debugging |
|
252 |
symbols meant for upload to Mozilla's crash collector database. |
|
253 |
%endif |
|
254 |
||
255 |
%prep |
|
256 |
%if %localize |
|
257 |
%setup -q -n mozilla -b 7 -b 10 |
|
258 |
%else |
|
259 |
%setup -q -n mozilla |
|
260 |
%endif |
|
261 |
cd $RPM_BUILD_DIR/mozilla |
|
262 |
%patch1 -p1 |
|
263 |
%patch2 -p1 |
|
264 |
%patch3 -p1 |
|
265 |
%patch5 -p1 |
|
266 |
%patch6 -p1 |
|
267 |
%patch7 -p1 |
|
268 |
%patch8 -p1 |
|
269 |
%patch9 -p1 |
|
270 |
%patch10 -p1 |
|
271 |
# Firefox |
|
272 |
%patch101 -p1 |
|
273 |
%patch102 -p1 |
|
274 |
%patch103 -p1 |
|
275 |
||
276 |
%build |
|
277 |
# no need to add build time to binaries |
|
278 |
modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/firefox-esr.changes")" |
|
279 |
DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\"" |
|
280 |
TIME="\"$(date -d "${modified}" "+%%R")\"" |
|
281 |
find . -regex ".*\.c\|.*\.cpp\|.*\.h" -exec sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" {} + |
|
282 |
# |
|
283 |
kdehelperversion=$(cat toolkit/xre/nsKDEUtils.cpp | grep '#define KMOZILLAHELPER_VERSION' | cut -d ' ' -f 3) |
|
284 |
if test "$kdehelperversion" != %{kde_helper_version}; then |
|
285 |
echo fix kde helper version in the .spec file |
|
286 |
exit 1 |
|
287 |
fi |
|
288 |
source %{SOURCE5} |
|
289 |
export MOZ_SOURCE_CHANGESET=$REV |
|
290 |
export SOURCE_REPO=$REPO |
|
291 |
export source_repo=$REPO |
|
292 |
export MOZ_SOURCE_REPO=$REPO |
|
293 |
export MOZ_BUILD_DATE=%{releasedate} |
|
294 |
export MOZILLA_OFFICIAL=1 |
|
295 |
export BUILD_OFFICIAL=1 |
|
296 |
export MOZ_TELEMETRY_REPORTING=1 |
|
297 |
export MOZ_GOOGLE_API_KEY=%{_google_api_key} |
|
298 |
export CFLAGS="%{optflags} -fno-strict-aliasing" |
|
976
14640a79141f
remove -fno-inline-small-functions and explicitely optimize with
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
975
diff
changeset
|
299 |
# boo#986541: add -fno-delete-null-pointer-checks for gcc6 |
950 | 300 |
%if 0%{?suse_version} > 1320 |
976
14640a79141f
remove -fno-inline-small-functions and explicitely optimize with
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
975
diff
changeset
|
301 |
export CFLAGS="$CFLAGS -fno-delete-null-pointer-checks" |
950 | 302 |
%endif |
303 |
%ifarch %arm |
|
304 |
export CFLAGS="${CFLAGS/-g / }" |
|
305 |
%endif |
|
306 |
%ifarch %arm %ix86 |
|
307 |
# Limit RAM usage during link |
|
308 |
export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" |
|
309 |
%endif |
|
310 |
%if 0%{?build_hardened} |
|
311 |
%ifarch x86_64 |
|
312 |
export LDFLAGS="${LDFLAGS} -Wl,-z,relro,-z,now" |
|
313 |
%endif |
|
314 |
%endif |
|
315 |
%ifarch ppc64 ppc64le |
|
316 |
export CFLAGS="$CFLAGS -mminimal-toc" |
|
317 |
%endif |
|
318 |
export CXXFLAGS="$CFLAGS" |
|
319 |
export MOZCONFIG=$RPM_BUILD_DIR/mozconfig |
|
320 |
cat << EOF > $MOZCONFIG |
|
321 |
mk_add_options MOZILLA_OFFICIAL=1 |
|
322 |
mk_add_options BUILD_OFFICIAL=1 |
|
323 |
mk_add_options MOZ_MAKE_FLAGS=%{?jobs:-j%jobs} |
|
324 |
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obj |
|
325 |
. \$topsrcdir/browser/config/mozconfig |
|
326 |
ac_add_options --prefix=%{_prefix} |
|
327 |
ac_add_options --libdir=%{_libdir} |
|
328 |
ac_add_options --includedir=%{_includedir} |
|
329 |
ac_add_options --enable-release |
|
330 |
%if 0%{?firefox_use_rust} |
|
331 |
ac_add_options --enable-rust |
|
332 |
%endif |
|
333 |
%if 0%{?firefox_use_gtk3} |
|
334 |
ac_add_options --enable-default-toolkit=cairo-gtk3 |
|
335 |
%else |
|
336 |
ac_add_options --enable-default-toolkit=cairo-gtk2 |
|
337 |
%endif |
|
338 |
%if 0%{?build_hardened} |
|
339 |
ac_add_options --enable-pie |
|
340 |
%endif |
|
976
14640a79141f
remove -fno-inline-small-functions and explicitely optimize with
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
975
diff
changeset
|
341 |
# gcc7 (boo#104105) |
14640a79141f
remove -fno-inline-small-functions and explicitely optimize with
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
975
diff
changeset
|
342 |
%if 0%{?suse_version} > 1320 |
14640a79141f
remove -fno-inline-small-functions and explicitely optimize with
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
975
diff
changeset
|
343 |
ac_add_options --enable-optimize="-g -O2" |
14640a79141f
remove -fno-inline-small-functions and explicitely optimize with
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
975
diff
changeset
|
344 |
%endif |
950 | 345 |
%ifarch %ix86 %arm |
346 |
%if 0%{?suse_version} > 1230 |
|
347 |
ac_add_options --disable-optimize |
|
348 |
%endif |
|
349 |
%endif |
|
350 |
%ifarch ppc ppc64 ppc64le %arm |
|
351 |
ac_add_options --disable-elf-hack |
|
352 |
%endif |
|
353 |
ac_add_options --with-system-nspr |
|
354 |
ac_add_options --with-system-nss |
|
355 |
%if %{localize} |
|
356 |
ac_add_options --with-l10n-base=$RPM_BUILD_DIR/l10n |
|
357 |
%endif |
|
358 |
#ac_add_options --with-system-jpeg # libjpeg-turbo is used internally |
|
359 |
#ac_add_options --with-system-png # doesn't work because of missing APNG support |
|
360 |
ac_add_options --with-system-zlib |
|
361 |
ac_add_options --disable-updater |
|
362 |
ac_add_options --disable-tests |
|
363 |
ac_add_options --enable-alsa |
|
364 |
ac_add_options --disable-debug |
|
365 |
ac_add_options --enable-startup-notification |
|
366 |
#ac_add_options --enable-chrome-format=jar |
|
367 |
ac_add_options --enable-update-channel=%{update_channel} |
|
973
28f802837a7a
changes and update esr variants
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
969
diff
changeset
|
368 |
ac_add_options --with-mozilla-api-keyfile=%{SOURCE18} |
950 | 369 |
%if %branding |
370 |
ac_add_options --enable-official-branding |
|
371 |
%endif |
|
372 |
ac_add_options --enable-libproxy |
|
373 |
%if ! %crashreporter |
|
374 |
ac_add_options --disable-crashreporter |
|
375 |
%endif |
|
376 |
%ifarch %arm |
|
377 |
ac_add_options --with-fpu=vfpv3-d16 |
|
378 |
ac_add_options --with-float-abi=hard |
|
379 |
ac_add_options --with-arch=armv7-a |
|
380 |
%endif |
|
381 |
%ifarch %arm s390x |
|
382 |
ac_add_options --disable-webrtc |
|
383 |
%endif |
|
384 |
EOF |
|
385 |
make -f client.mk build |
|
386 |
||
387 |
%install |
|
388 |
cd $RPM_BUILD_DIR/obj |
|
389 |
source %{SOURCE5} |
|
390 |
export MOZ_SOURCE_STAMP=$REV |
|
391 |
export MOZ_SOURCE_REPO=$REPO |
|
392 |
# need to remove default en-US firefox-l10n.js before it gets |
|
393 |
# populated into browser's omni.ja; it only contains general.useragent.locale |
|
394 |
# which should be loaded from each language pack (set in firefox.js) |
|
395 |
rm dist/bin/browser/defaults/preferences/firefox-l10n.js |
|
396 |
make -C browser/installer STRIP=/bin/true MOZ_PKG_FATAL_WARNINGS=0 |
|
397 |
#DEBUG (break the build if searchplugins are missing / temporary) |
|
398 |
grep amazondotcom dist/firefox/browser/omni.ja |
|
399 |
# copy tree into RPM_BUILD_ROOT |
|
400 |
mkdir -p %{buildroot}%{progdir} |
|
401 |
cp -rf $RPM_BUILD_DIR/obj/dist/firefox/* %{buildroot}%{progdir} |
|
402 |
mkdir -p %{buildroot}%{progdir}/distribution/extensions |
|
403 |
mkdir -p %{buildroot}%{progdir}/browser/defaults/preferences/ |
|
404 |
# install gre prefs |
|
405 |
install -m 644 %{SOURCE13} %{buildroot}%{progdir}/defaults/pref/ |
|
406 |
# install browser prefs |
|
407 |
install -m 644 %{SOURCE6} %{buildroot}%{progdir}/browser/defaults/preferences/kde.js |
|
408 |
install -m 644 %{SOURCE9} %{buildroot}%{progdir}/browser/defaults/preferences/firefox.js |
|
409 |
# install additional locales |
|
410 |
%if %localize |
|
411 |
rm -f %{_tmppath}/translations.* |
|
412 |
touch %{_tmppath}/translations.{common,other} |
|
413 |
for locale in $(awk '{ print $1; }' %{SOURCE17}); do |
|
414 |
case $locale in |
|
415 |
ja-JP-mac|en-US|'') |
|
416 |
;; |
|
417 |
*) |
|
418 |
pushd $RPM_BUILD_DIR/compare-locales |
|
419 |
PYTHONPATH=lib \ |
|
420 |
scripts/compare-locales -m ../l10n-merged/$locale \ |
|
421 |
../mozilla/browser/locales/l10n.ini ../l10n $locale |
|
422 |
popd |
|
423 |
LOCALE_MERGEDIR=$RPM_BUILD_DIR/l10n-merged/$locale \ |
|
424 |
make -C browser/locales langpack-$locale |
|
425 |
cp -rL dist/xpi-stage/locale-$locale \ |
|
426 |
%{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org |
|
427 |
# remove prefs, profile defaults, and hyphenation from langpack |
|
428 |
rm -rf %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org/defaults |
|
429 |
rm -rf %{buildroot}%{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org/hyphenation |
|
430 |
# check against the fixed common list and sort into the right filelist |
|
431 |
_matched=0 |
|
432 |
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 |
|
433 |
[ "$_match" = "$locale" ] && _matched=1 |
|
434 |
done |
|
435 |
[ $_matched -eq 1 ] && _l10ntarget=common || _l10ntarget=other |
|
436 |
echo %{progdir}/browser/extensions/langpack-$locale@firefox.mozilla.org \ |
|
437 |
>> %{_tmppath}/translations.$_l10ntarget |
|
438 |
esac |
|
439 |
done |
|
440 |
%endif |
|
441 |
# remove some executable permissions |
|
442 |
find %{buildroot}%{progdir} \ |
|
443 |
-name "*.js" -o \ |
|
444 |
-name "*.jsm" -o \ |
|
445 |
-name "*.rdf" -o \ |
|
446 |
-name "*.properties" -o \ |
|
447 |
-name "*.dtd" -o \ |
|
448 |
-name "*.txt" -o \ |
|
449 |
-name "*.xml" -o \ |
|
450 |
-name "*.css" | xargs chmod a-x |
|
451 |
# remove mkdir.done files from installed base |
|
452 |
find %{buildroot}%{progdir} -name ".mkdir.done" | xargs rm |
|
453 |
# overwrite the mozilla start-script and link it to /usr/bin |
|
454 |
mkdir --parents %{buildroot}/usr/bin |
|
455 |
sed "s:%%PREFIX:%{_prefix}:g |
|
456 |
s:%%PROGDIR:%{progdir}:g |
|
457 |
s:%%APPNAME:firefox:g |
|
458 |
s:%%PROFILE:.mozilla/firefox:g" \ |
|
459 |
%{SOURCE3} > %{buildroot}%{progdir}/%{progname}.sh |
|
460 |
chmod 755 %{buildroot}%{progdir}/%{progname}.sh |
|
461 |
ln -sf ../..%{progdir}/%{progname}.sh %{buildroot}%{_bindir}/%{progname} |
|
462 |
# desktop file |
|
463 |
mkdir -p %{buildroot}%{_datadir}/applications |
|
464 |
sed "s:%%NAME:%{appname}:g |
|
465 |
s:%%EXEC:%{progname}:g |
|
466 |
s:%%ICON:%{progname}:g" \ |
|
467 |
%{SOURCE1} > %{buildroot}%{_datadir}/applications/%{desktop_file_name}.desktop |
|
468 |
%suse_update_desktop_file %{desktop_file_name} Network WebBrowser GTK |
|
469 |
# additional mime-types |
|
470 |
mkdir -p %{buildroot}%{_datadir}/mime/packages |
|
471 |
cp %{SOURCE8} %{buildroot}%{_datadir}/mime/packages/%{progname}.xml |
|
472 |
# appdata |
|
473 |
%if "%{update_channel}" != "aurora" |
|
474 |
mkdir -p %{buildroot}%{_datadir}/appdata |
|
475 |
cp %{SOURCE15} %{buildroot}%{_datadir}/appdata/%{desktop_file_name}.appdata.xml |
|
476 |
%endif |
|
477 |
# install man-page |
|
478 |
mkdir -p %{buildroot}%{_mandir}/man1/ |
|
479 |
cp %{SOURCE11} %{buildroot}%{_mandir}/man1/%{progname}.1 |
|
480 |
########## |
|
481 |
# ADDONS |
|
482 |
# |
|
483 |
mkdir -p %{buildroot}%{_datadir}/mozilla/extensions/%{firefox_appid} |
|
484 |
mkdir -p %{buildroot}%{_libdir}/mozilla/extensions/%{firefox_appid} |
|
485 |
mkdir -p %{buildroot}/usr/share/pixmaps/ |
|
486 |
ln -sf %{progdir}/browser/icons/mozicon128.png %{buildroot}/usr/share/pixmaps/%{progname}.png |
|
487 |
ln -sf %{progdir}/browser/icons/mozicon128.png %{buildroot}/usr/share/pixmaps/%{progname}-gnome.png |
|
488 |
%if %branding |
|
489 |
for size in 16 22 24 32 48 256; do |
|
490 |
%else |
|
491 |
for size in 16 32 48; do |
|
492 |
%endif |
|
493 |
mkdir -p %{buildroot}%{gnome_dir}/share/icons/hicolor/${size}x${size}/apps/ |
|
494 |
cp %{buildroot}%{progdir}/browser/chrome/icons/default/default$size.png \ |
|
495 |
%{buildroot}%{gnome_dir}/share/icons/hicolor/${size}x${size}/apps/%{progname}.png |
|
496 |
done |
|
497 |
# excludes |
|
498 |
rm -f %{buildroot}%{progdir}/updater.ini |
|
499 |
rm -f %{buildroot}%{progdir}/removed-files |
|
500 |
rm -f %{buildroot}%{progdir}/README.txt |
|
501 |
rm -f %{buildroot}%{progdir}/old-homepage-default.properties |
|
502 |
rm -f %{buildroot}%{progdir}/run-mozilla.sh |
|
503 |
rm -f %{buildroot}%{progdir}/LICENSE |
|
504 |
rm -f %{buildroot}%{progdir}/precomplete |
|
505 |
rm -f %{buildroot}%{progdir}/dictionaries/en-US* |
|
506 |
rm -f %{buildroot}%{progdir}/update-settings.ini |
|
507 |
# devel |
|
508 |
mkdir -p %{buildroot}%{_bindir} |
|
509 |
install -m 755 %SOURCE12 %{buildroot}%{_bindir} |
|
510 |
# inspired by mandriva |
|
511 |
mkdir -p %{buildroot}%{_sysconfdir}/rpm |
|
512 |
cat <<'FIN' >%{buildroot}%{_sysconfdir}/rpm/macros.%{progname} |
|
513 |
# Macros from %{name} package |
|
514 |
%%firefox_major %{major} |
|
515 |
%%firefox_version %{version} |
|
516 |
%%firefox_mainver %{mainver} |
|
517 |
%%firefox_mozillapath %%{_libdir}/%{progname} |
|
518 |
%%firefox_pluginsdir %%{_libdir}/browser-plugins |
|
519 |
%%firefox_appid \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\} |
|
520 |
%%firefox_extdir %%(if [ "%%_target_cpu" = "noarch" ]; then echo %%{_datadir}/mozilla/extensions/%%{firefox_appid}; else echo %%{_libdir}/mozilla/extensions/%%{firefox_appid}; fi) |
|
521 |
||
522 |
%%firefox_ext_install() \ |
|
523 |
extdir="%%{buildroot}%%{firefox_extdir}/`mozilla-get-app-id '%%1'`" \ |
|
524 |
mkdir -p "$extdir" \ |
|
525 |
%%{__unzip} -q -d "$extdir" "%%1" \ |
|
526 |
%%{nil} |
|
527 |
FIN |
|
528 |
# just dumping an xpi file there doesn't work... |
|
529 |
#%%firefox_ext_install() \ |
|
530 |
# extdir="%%{buildroot}%%{firefox_extdir}" \ |
|
531 |
# mkdir -p "$extdir" \ |
|
532 |
# cp "%%1" "$extdir" \ |
|
533 |
# %%{nil} |
|
534 |
# fdupes |
|
535 |
%fdupes %{buildroot}%{progdir} |
|
536 |
%fdupes %{buildroot}%{_datadir} |
|
537 |
# create breakpad debugsymbols |
|
538 |
%if %crashreporter |
|
539 |
SYMBOLS_NAME="firefox-%{version}-` echo '%{release}' | sed 's@\.[^\.]\+$@@' `.%{_arch}-%{suse_version}-symbols" |
|
540 |
make buildsymbols \ |
|
541 |
SYMBOL_INDEX_NAME="$SYMBOLS_NAME.txt" \ |
|
542 |
SYMBOL_FULL_ARCHIVE_BASENAME="$SYMBOLS_NAME-full" \ |
|
543 |
SYMBOL_ARCHIVE_BASENAME="$SYMBOLS_NAME" |
|
544 |
if [ -e dist/*symbols.zip ]; then |
|
545 |
mkdir -p %{buildroot}%{_datadir}/mozilla/ |
|
546 |
cp dist/*symbols.zip %{buildroot}%{_datadir}/mozilla/ |
|
547 |
fi |
|
548 |
%endif |
|
549 |
||
550 |
%clean |
|
551 |
rm -rf %{buildroot} |
|
552 |
%if %localize |
|
553 |
rm -rf %{_tmppath}/translations.* |
|
554 |
%endif |
|
555 |
||
556 |
%post |
|
557 |
# update mime and desktop database |
|
558 |
%mime_database_post |
|
559 |
%desktop_database_post |
|
560 |
%icon_theme_cache_post |
|
561 |
exit 0 |
|
562 |
||
563 |
%postun |
|
564 |
%icon_theme_cache_postun |
|
565 |
%desktop_database_postun |
|
566 |
%mime_database_postun |
|
567 |
exit 0 |
|
568 |
||
569 |
%files |
|
570 |
%defattr(-,root,root) |
|
571 |
%dir %{progdir} |
|
572 |
%dir %{progdir}/browser/ |
|
573 |
%dir %{progdir}/browser/chrome/ |
|
574 |
%dir %{progdir}/browser/extensions/ |
|
575 |
%{progdir}/browser/defaults |
|
576 |
%{progdir}/browser/features/ |
|
577 |
%{progdir}/browser/icons/ |
|
578 |
%{progdir}/browser/chrome/icons |
|
579 |
%{progdir}/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi |
|
580 |
%{progdir}/browser/blocklist.xml |
|
581 |
%{progdir}/browser/chrome.manifest |
|
582 |
%{progdir}/browser/omni.ja |
|
583 |
%dir %{progdir}/distribution/ |
|
584 |
%{progdir}/distribution/extensions/ |
|
585 |
%{progdir}/defaults/ |
|
586 |
%{progdir}/dictionaries/ |
|
587 |
%if 0%{?firefox_use_gtk3} |
|
588 |
%dir %{progdir}/gtk2 |
|
589 |
%{progdir}/gtk2/libmozgtk.so |
|
590 |
%endif |
|
591 |
%{progdir}/gmp-clearkey/ |
|
592 |
%attr(755,root,root) %{progdir}/%{progname}.sh |
|
593 |
%{progdir}/firefox |
|
594 |
%{progdir}/firefox-bin |
|
595 |
%{progdir}/application.ini |
|
596 |
%{progdir}/chrome.manifest |
|
597 |
%{progdir}/dependentlibs.list |
|
598 |
%{progdir}/icudt58l.dat |
|
599 |
%{progdir}/*.so |
|
600 |
%{progdir}/omni.ja |
|
601 |
%{progdir}/fonts/ |
|
602 |
%{progdir}/platform.ini |
|
603 |
%{progdir}/plugin-container |
|
604 |
%if %crashreporter |
|
605 |
%{progdir}/crashreporter |
|
606 |
%{progdir}/crashreporter.ini |
|
607 |
%{progdir}/Throbber-small.gif |
|
608 |
%{progdir}/minidump-analyzer |
|
609 |
%{progdir}/browser/crashreporter-override.ini |
|
610 |
%endif |
|
611 |
%{_datadir}/applications/%{desktop_file_name}.desktop |
|
612 |
%{_datadir}/mime/packages/%{progname}.xml |
|
613 |
%{_datadir}/pixmaps/firefox* |
|
614 |
%dir %{_datadir}/mozilla |
|
615 |
%dir %{_datadir}/mozilla/extensions |
|
616 |
%dir %{_datadir}/mozilla/extensions/%{firefox_appid} |
|
617 |
%dir %{_libdir}/mozilla |
|
618 |
%dir %{_libdir}/mozilla/extensions |
|
619 |
%dir %{_libdir}/mozilla/extensions/%{firefox_appid} |
|
620 |
%{gnome_dir}/share/icons/hicolor/ |
|
621 |
%{_bindir}/%{progname} |
|
622 |
%doc %{_mandir}/man1/%{progname}.1.gz |
|
623 |
%if "%{update_channel}" != "aurora" |
|
624 |
%{_datadir}/appdata/ |
|
625 |
%endif |
|
626 |
||
627 |
%files devel |
|
628 |
%defattr(-,root,root) |
|
629 |
%{_bindir}/mozilla-get-app-id |
|
630 |
%config %{_sysconfdir}/rpm/macros.%{progname} |
|
631 |
||
632 |
%if %localize |
|
633 |
||
634 |
%files translations-common -f %{_tmppath}/translations.common |
|
635 |
%defattr(-,root,root) |
|
636 |
%dir %{progdir} |
|
637 |
%dir %{progdir}/browser/extensions/ |
|
638 |
||
639 |
%files translations-other -f %{_tmppath}/translations.other |
|
640 |
%defattr(-,root,root) |
|
641 |
%dir %{progdir} |
|
642 |
%dir %{progdir}/browser/extensions/ |
|
643 |
%endif |
|
644 |
||
645 |
# this package does not need to provide files but is needed to fulfill |
|
646 |
# requirements if no other branding package is to be installed |
|
647 |
%if %branding |
|
648 |
%files branding-upstream |
|
649 |
%defattr(-,root,root) |
|
650 |
%dir %{progdir} |
|
651 |
%endif |
|
652 |
||
653 |
%if %crashreporter |
|
654 |
%files buildsymbols |
|
655 |
%defattr(-,root,root) |
|
656 |
%{_datadir}/mozilla/*.zip |
|
657 |
%endif |
|
658 |
||
659 |
%changelog |