/[packages]/updates/5/firefox/current/SPECS/firefox.spec
ViewVC logotype

Contents of /updates/5/firefox/current/SPECS/firefox.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1097060 - (show annotations) (download)
Sat Apr 22 12:37:40 2017 UTC (7 years ago) by neoclust
File size: 16538 byte(s)
SILENT: fix build on mga5
1 # WARNING: This package is synced with FC
2
3 #
4 # WARNING, READ FIRST:
5 #
6 # This is a special package that needs special treatment. Due to the amount of
7 # security updates it needs, it's common to ship new upstream versions instead of patching.
8 # That means this package MUST be BUILDABLE for stable official releases.
9 # This also means only STABLE upstream releases, NO betas.
10 # This is a discussed topic. Please, do not flame it again.
11
12 # Stay on ESR for stable releases and for cauldron before mageia 5.
13 # /!\ Do not update more than FF 45 for mga6. /!\
14 # ff 45 -> 52 -> 59
15
16 # Tentative workaround for BS cc1plus kill issue (09/2016)
17 #define _smp_ncpus_max 8
18
19 %define toolkit_gtk3 1
20
21 # Use system cairo?
22 %define system_cairo 0
23
24 %define major 52
25 %define ff_epoch 0
26 # (tpg) set version HERE !!!
27 %define extra esr
28 %define realver %{version}%extra
29 %define firefox_appid \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
30
31 # (tpg) MOZILLA_FIVE_HOME
32 %define mozillalibdir %{_libdir}/%{name}
33 %define pluginsdir %{_libdir}/mozilla/plugins
34
35 # libxul.so is provided by libxulrunnner2.0.
36 %global __requires_exclude libxul.so
37
38 # Minimal required versions
39 %global cairo_version 1.13.1
40 %global freetype_version 2.1.9
41 %global libnotify_version 0.7.0
42 %global libvpx_version 1.5.0
43
44 # this seems fragile, so require the exact version or later (#58754)
45 %global nspr_version 4.12
46 %global nspr_build_version %(pkg-config --silence-errors --modversion nspr 2>/dev/null || echo 65536)
47 %global nss_version 3.21.1
48 %global nss_build_version %(pkg-config --silence-errors --modversion nss 2>/dev/null || echo 65536)
49 %global sqlite_version 3.8.8.2
50 # The actual sqlite version (see #480989):
51 %global sqlite_build_version %(pkg-config --silence-errors --modversion sqlite3 2>/dev/null || echo 65536)
52
53
54 %define update_channel %{extra}%major
55
56 Summary: Mozilla Firefox Web browser
57 Name: firefox
58 Version: %{major}.1.0
59 Epoch: %{ff_epoch}
60 Release: %mkrel 1
61 License: MPLv1.1 or GPLv2+ or LGPLv2+
62 Group: Networking/WWW
63 Url: https://www.mozilla.org/firefox/organizations/
64 Source0: https://ftp.mozilla.org/pub/firefox/releases/%{realver}/source/%{name}-%{realver}.source.tar.xz
65 Source4: %{name}.desktop
66 Source8: %{name}-searchengines-duckduckgo.xml
67 Source9: kde.js
68 # From Fedora:
69 Source10: firefox-mozconfig
70
71 # Fedora patches:
72 Patch3: mozilla-build-arm.patch
73 Patch223: rhbz-1291190-appchooser-crash.patch
74
75 # Mageia patches:
76 Patch1000: firefox-lang.patch
77 # (OpenSuse) add patch to make firefox always use /usr/bin/firefox when "make firefox
78 # the default web browser" is used fix mdv bug#58784
79 Patch1005: firefox-38.0-appname.patch
80 Patch1008: firefox-disable-check-default-browser.patch
81 # Patches for kde integration of FF
82 # (doktor5000) if the patches need updating, grab both from the branch corresponding with the current firefox version at
83 # http://www.rosenauer.org/hg/mozilla
84 Patch1011: http://www.rosenauer.org/hg/mozilla/file/tip/mozilla-kde.patch
85 # (fwang) please modify patch12 with `sed -e 's/MozillaFirefox/firefox/'` to fit our desktop filename
86 Patch1012: http://www.rosenauer.org/hg/mozilla/file/tip/firefox-kde.patch
87
88 Patch1037: firefox-38.0-nss-version.patch
89 Patch1039: firefox-43.4.0-optimize-dont-force-O3.patch
90
91 BuildRequires: pkgconfig(nspr) >= %{nspr_version}
92 BuildRequires: pkgconfig(nss) >= %{nss_version}
93 BuildRequires: nss-static-devel >= %{nss_version}
94 %if %{?system_cairo}
95 BuildRequires: pkgconfig(cairo) >= %{cairo_version}
96 %endif
97 BuildRequires: pkgconfig(xinerama)
98 BuildRequires: pkgconfig(xscrnsaver)
99 BuildRequires: pkgconfig(libpng)
100 BuildRequires: libjpeg-devel
101 BuildRequires: zip
102 BuildRequires: bzip2-devel
103 BuildRequires: pkgconfig(zlib)
104 BuildRequires: pkgconfig(libIDL-2.0)
105 %if %{toolkit_gtk3}
106 BuildRequires: pkgconfig(gtk+-3.0)
107 %endif
108 BuildRequires: pkgconfig(gtk+-2.0)
109 BuildRequires: pkgconfig(pango)
110 BuildRequires: pkgconfig(xt)
111 BuildRequires: pkgconfig(hunspell)
112 BuildRequires: pkgconfig(libstartup-notification-1.0)
113 BuildRequires: pkgconfig(alsa)
114 BuildRequires: pkgconfig(libnotify) >= %{libnotify_version}
115 BuildRequires: pkgconfig(dri)
116 #BuildRequires: pkgconfig(libvpx) >= %{libvpx_version}
117 BuildRequires: autoconf2.1
118 BuildRequires: pkgconfig(libpulse)
119 BuildRequires: pkgconfig(icu-i18n)
120 BuildRequires: pkgconfig(gconf-2.0)
121 BuildRequires: yasm
122 Requires: %{mklibname nss 3} >= 2:%{nss_build_version}
123 Requires: %{mklibname nspr 4} >= 2:%{nspr_build_version}
124 BuildRequires: pkgconfig(gstreamer-1.0)
125 BuildRequires: pkgconfig(gstreamer-allocators-1.0)
126 BuildRequires: python
127 BuildRequires: pkgconfig(sqlite3) >= %{sqlite_version}
128 Requires: %{mklibname sqlite3_ 0} >= %{sqlite_build_version}
129 BuildRequires: pkgconfig(libffi)
130 BuildRequires: rootcerts >= 1:20130411.00
131 BuildRequires: doxygen
132 BuildRequires: libiw-devel
133 BuildRequires: python-virtualenv
134 BuildRequires: pkgconfig(libevent)
135 BuildRequires: pkgconfig(libproxy-1.0)
136
137 Provides: %{name} = %{epoch}:%{version}
138 Provides: mozilla-firefox = %{epoch}:%{version}-%{release}
139 Provides: webclient
140
141 Requires: indexhtml
142 Requires: xdg-utils
143 # fixes bug #42096
144 Requires: mailcap
145 Recommends: hunspell-en
146 Requires: %{_lib}notify4
147 Requires: gstreamer1.0-libav
148 # make sure our default bookmarks are present
149 Requires: desktop-common-data
150 # try to fix mga#1344 (automatic installation of proper -l10n package)
151 # packages requiring locales-XX will be automatically preferred when locales-XX
152 # is already installed
153 Recommends: firefox-l10n
154
155 Recommends: %{_lib}canberra0
156 Recommends: %{_lib}cups2
157 Obsoletes: firefox-ext-weave-sync
158 Obsoletes: firefox-beta < 25
159
160 %description
161 Mozilla Firefox is an open-source web browser, designed for standards
162 compliance, performance and portability.
163
164 %package devel
165 Summary: Development files for %{name}
166 Group: Development/Other
167 Obsoletes: firefox-beta-devel < 25
168
169 %description devel
170 Files and macros mainly for building Firefox extensions.
171
172 %prep
173 %if %{?extra}
174 #setup -q -n mozilla-%{update_channel}
175 %setup -q -n firefox-%{version}esr
176 %else
177 #setup -q -n mozilla-release
178 %setup -q -n %name-%version
179 %endif
180 # Fedora patches:
181 %patch3 -p2 -b .arm
182 %patch223 -p1 -b .appchooser-crash
183
184 # Mageia patches:
185 %patch1000 -p1 -b .lang
186 %patch1005 -p1 -b .appname
187 %patch1008 -p1 -b .defaultbrowser
188 %patch1011 -p1 -b .mozkde
189 %patch1012 -p1 -b .ffkde
190
191 %patch1037 -p0
192 %patch1039 -p1 -b .noo3_noos
193
194 pushd js/src
195 autoconf-2.13
196 popd
197 autoconf-2.13
198
199 %{__rm} -f .mozconfig
200 %{__cp} %{SOURCE10} .mozconfig
201 # Mageia specific options:
202 cat << EOF >> .mozconfig
203 ac_add_options --with-system-libevent
204 ac_add_options --enable-libproxy
205 ac_add_options --with-system-png
206 ac_add_options --with-distribution-id=org.mageia
207 ac_add_options --enable-update-channel=%{update_channel}
208 EOF
209
210 # Options shared with FC:
211 echo "ac_add_options --enable-official-branding" >> .mozconfig
212
213 %if %{toolkit_gtk3}
214 echo "ac_add_options --enable-default-toolkit=cairo-gtk3" >> .mozconfig
215 %else
216 echo "ac_add_options --enable-default-toolkit=cairo-gtk2" >> .mozconfig
217 %endif
218
219 echo "ac_add_options --with-system-nspr" >> .mozconfig
220 echo "ac_add_options --with-system-nss" >> .mozconfig
221
222 # SQLite is too old.
223 # echo "ac_add_options --enable-system-sqlite" >> .mozconfig
224
225 %if %{?system_cairo}
226 echo "ac_add_options --enable-system-cairo" >> .mozconfig
227 %else
228 echo "ac_add_options --disable-system-cairo" >> .mozconfig
229 %endif
230
231 echo "ac_add_options --enable-system-ffi" >> .mozconfig
232
233 echo "ac_add_options --enable-gstreamer=1.0" >> .mozconfig
234
235 %ifarch %{arm}
236 echo "ac_add_options --disable-elf-hack" >> .mozconfig
237 %endif
238
239 echo "ac_add_options --disable-debug" >> .mozconfig
240 echo "ac_add_options --enable-optimize" >> .mozconfig
241
242 %ifarch armv7hl
243 echo "ac_add_options --with-arch=armv7-a" >> .mozconfig
244 echo "ac_add_options --with-float-abi=hard" >> .mozconfig
245 echo "ac_add_options --with-fpu=vfpv3-d16" >> .mozconfig
246 echo "ac_add_options --disable-elf-hack" >> .mozconfig
247 %endif
248 %ifarch armv7hnl
249 echo "ac_add_options --with-arch=armv7-a" >> .mozconfig
250 echo "ac_add_options --with-float-abi=hard" >> .mozconfig
251 echo "ac_add_options --with-fpu=neon" >> .mozconfig
252 echo "ac_add_options --disable-elf-hack" >> .mozconfig
253 echo "ac_add_options --disable-ion" >> .mozconfig
254 echo "ac_add_options --disable-yarr-jit" >> .mozconfig
255 %endif
256 %ifarch armv5tel
257 echo "ac_add_options --with-arch=armv5te" >> .mozconfig
258 echo "ac_add_options --with-float-abi=soft" >> .mozconfig
259 echo "ac_add_options --disable-elf-hack" >> .mozconfig
260 echo "ac_add_options --disable-ion" >> .mozconfig
261 echo "ac_add_options --disable-yarr-jit" >> .mozconfig
262 %endif
263
264 %ifnarch %{ix86} x86_64
265 echo "ac_add_options --disable-webrtc" >> .mozconfig
266 %endif
267
268 echo "ac_add_options --disable-crashreporter" >> .mozconfig
269
270 echo "ac_add_options --with-system-jpeg" >> .mozconfig
271
272 # Using the bundled libvpx because the mgav5 one is too old.
273 #echo "ac_add_options --with-system-libvpx" >> .mozconfig
274
275 %build
276 # -fpermissive is needed to build with gcc 4.6+ which has become stricter
277 #
278 # Mozilla builds with -Wall with exception of a few warnings which show up
279 # everywhere in the code; so, don't override that.
280 #
281 # Disable C++ exceptions since Mozilla code is not exception-safe
282 #
283 MOZ_OPT_FLAGS=$(echo "$RPM_OPT_FLAGS" | %{__sed} -e 's/-Wall//')
284 #rhbz#1037063
285 # -Werror=format-security causes build failures when -Wno-format is explicitly given
286 # for some sources
287 # Explicitly force the hardening flags for Firefox so it passes the checksec test;
288 # See also https://fedoraproject.org/wiki/Changes/Harden_All_Packages
289 MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -Wformat-security -Wformat -Werror=format-security"
290 MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fPIC -Wl,-z,relro -Wl,-z,now"
291 %ifarch %{arm}
292 MOZ_LINK_FLAGS="-Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
293 %endif
294
295 export CFLAGS=$MOZ_OPT_FLAGS
296 export CXXFLAGS=$MOZ_OPT_FLAGS
297 export LDFLAGS=$MOZ_LINK_FLAGS
298
299 export PREFIX='%{_prefix}'
300 export LIBDIR='%{_libdir}'
301
302 MOZ_SMP_FLAGS=-j1
303 # On x86 architectures, Mozilla can build up to 4 jobs at once in parallel,
304 # however builds tend to fail on other arches when building in parallel.
305 %ifarch %{ix86} x86_64 ppc ppc64 ppc64le aarch64
306 [ -z "$RPM_BUILD_NCPUS" ] && \
307 RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"
308 MOZ_SMP_FLAGS=-j$RPM_BUILD_NCPUS
309 %endif
310
311 make -f client.mk build STRIP="/bin/true" MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS" MOZ_SERVICES_SYNC="1"
312
313 %install
314 make -C objdir/browser/installer STRIP=/bin/true MOZ_PKG_FATAL_WARNINGS=0
315
316 # Copy files to buildroot
317 %{__mkdir_p} %{buildroot}%{mozillalibdir}
318 cp -rf objdir/dist/firefox/* %{buildroot}%{mozillalibdir}
319
320 %{__mkdir_p} %{buildroot}%{_bindir}
321 ln -sf %{mozillalibdir}/firefox %{buildroot}%{_bindir}/firefox
322 pushd %{buildroot}%{_bindir}
323 ln -sf firefox mozilla-firefox
324 popd
325 mkdir -p %{buildroot}%{mozillalibdir}/browser/defaults/preferences/
326 install -m 644 %{SOURCE9} %{buildroot}%{mozillalibdir}/browser/defaults/preferences/kde.js
327
328 # Create and own %{_libdir}/mozilla/plugins & firefox extensions directories
329 %{__mkdir_p} %{buildroot}%{pluginsdir}
330 %{__mkdir_p} %{buildroot}%{_libdir}/mozilla/extensions/%{firefox_appid}
331 %{__mkdir_p} %{buildroot}%{_datadir}/mozilla/extensions/%{firefox_appid}
332
333 # (tpg) desktop entry
334 %{__mkdir_p} %{buildroot}%{_datadir}/applications
335 install -m 644 %{SOURCE4} %{buildroot}%{_datadir}/applications/%{name}.desktop
336
337 # (tpg) icons
338 %{__cp} %{buildroot}%{mozillalibdir}/browser/chrome/icons/default/default16.png %{buildroot}/%{mozillalibdir}/browser/icons/
339 for i in 16 22 24 32 48 256; do
340 %{__mkdir_p} %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps
341 %{__install} -m 644 browser/branding/official/default$i.png %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps/%{name}.png ;
342 done
343 %{__mkdir_p} %{buildroot}{%{_liconsdir},%{_iconsdir},%{_miconsdir}}
344 ln -sf %{mozillalibdir}/browser/chrome/icons/default/default48.png %{buildroot}%{_liconsdir}/%{name}.png
345 ln -sf %{mozillalibdir}/browser/chrome/icons/default/default32.png %{buildroot}%{_iconsdir}/%{name}.png
346 ln -sf %{mozillalibdir}/browser/chrome/icons/default/default16.png %{buildroot}%{_miconsdir}/%{name}.png
347
348 # exclusions
349 rm -f %{buildroot}%{mozillalibdir}/README.txt
350 rm -f %{buildroot}%{mozillalibdir}/removed-files
351 rm -f %{buildroot}%{mozillalibdir}/precomplete
352
353 # this file is only used when creating a new user profile
354 %{__mkdir_p} %{buildroot}%{mozillalibdir}/distribution
355 install -D -m644 browser/app/profile/prefs.js %{buildroot}%{mozillalibdir}/distribution/distribution.ini
356 cat << EOF >> %{buildroot}%{mozillalibdir}/distribution/distribution.ini
357 [Global]
358 id=
359 version=
360 about=Firefox packaged by Mageia
361 [LocalizablePreferences]
362 browser.shell.checkDefaultBrowser="false"
363 browser.startup.homepage="file:///usr/share/indexhtml/index.html"
364 update_notifications.enabled="false"
365 EOF
366
367 # display icon for Firefox button
368 %{__mkdir_p} %{buildroot}%{mozillalibdir}/browser/defaults/profile/chrome
369 cat << EOF > %{buildroot}%{mozillalibdir}/browser/defaults/profile/chrome/userChrome.css
370 #appmenu-toolbar-button {
371 list-style-image: url("chrome://branding/content/icon16.png");
372 }
373 EOF
374
375 # files in this directory are read on every startup, and can change/add
376 # preferences for existing profiles
377 # extensions.autoDisableScopes is a new preference added in firefox 8
378 # it defines "scopes" where newly installed addons are disabled by default
379 # this is an additive bit field, and the value defaults to 15 (1+2+4+8)
380 # we need to remove system scope (8) from it so language packs and other addons
381 # which are installed systemwide won't get marked as 3rd party and disabled
382 # documentation: http://kb.mozillazine.org/About:config_entries#Extensions.
383 # or in toolkit/mozapps/extensions/AddonManager.jsm
384 # we also need to disable the "disable addon selection dialog"
385 # (doktor5000) - path has changed since FF 21
386 # http://mike.kaply.com/2013/04/24/major-changes-coming-in-firefox-21/
387 cat << EOF > %{buildroot}%{mozillalibdir}/browser/defaults/preferences/mga.js
388 pref("general.useragent.locale", "chrome://global/locale/intl.properties");
389 pref("extensions.autoDisableScopes", 0);
390 pref("extensions.shownSelectionUI", true);
391 EOF
392 # FIXME: Add it back in mga.js when this search engine will be used by default.
393 # user_pref("browser.search.selectedEngine","duckduckgo.com");
394
395 # use the system myspell dictionaries
396 rm -fr %{buildroot}%{mozillalibdir}/dictionaries
397 ln -s %{_datadir}/hunspell %{buildroot}%{mozillalibdir}/dictionaries
398
399 # (lm) touch and %ghost bookmarks.html to a proper uninstall
400 touch %{buildroot}%{mozillalibdir}/browser/defaults/profile/bookmarks.html
401
402 # Add stuff to build a plugin to -devel
403 mkdir -p %{buildroot}%{_includedir}
404 cp -a dom/plugins/base/np*.h %{buildroot}%{_includedir}
405 mkdir -p %{buildroot}/%{_datadir}/pkgconfig
406 cat <<EOF >%{buildroot}/%{_datadir}/pkgconfig/mozilla-plugin.pc
407 Name: Mozilla Plug-In API
408 Description: Mozilla Plug-In API
409 Version: %{version}
410 Cflags: -I%{_includedir} -DXP_UNIX
411 EOF
412
413 mkdir -p %{buildroot}%{_sys_macros_dir}
414 cat <<FIN >%{buildroot}%{_sys_macros_dir}/%{name}.macros
415 # Macros from %{name} package
416 %%firefox_major %{version}
417 %%firefox_epoch %{ff_epoch}
418 %%firefox_version %{version}
419 %%firefox_mozillapath %{mozillalibdir}
420 %%firefox_pluginsdir %{pluginsdir}
421 %%firefox_appid \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
422 %%firefox_extdir %%(if [ "%%_target_cpu" = "noarch" ]; then echo %%{_datadir}/mozilla/extensions/%%{firefox_appid}; else echo %%{_libdir}/mozilla/extensions/%%{firefox_appid}; fi)
423 FIN
424 # temp build fix:
425 mkdir -p %{buildroot}%{mozillalibdir}/browser/searchplugins
426 cp -f %{SOURCE8} %{buildroot}%{mozillalibdir}/browser/searchplugins/duckduckgo.xml
427
428 %pre
429 if [ -d %{mozillalibdir}/dictionaries ]; then
430 rm -fr %{mozillalibdir}/dictionaries
431 fi
432
433 %post
434 if [ ! -r /etc/sysconfig/oem ]; then
435 case `grep META_CLASS /etc/sysconfig/system` in
436 *powerpack) bookmark="mozilla-powerpack.html" ;;
437 *desktop) bookmark="mozilla-one.html";;
438 *) bookmark="mozilla-download.html";;
439 esac
440 ln -s -f %{_prefix}/share/mga/bookmarks/mozilla/$bookmark %{mozillalibdir}/browser/defaults/profile/bookmarks.html
441 fi
442
443 %files
444 %{_bindir}/%{name}
445 %{_bindir}/mozilla-firefox
446 %{_iconsdir}/hicolor/*/apps/*.png
447 %{_miconsdir}/%{name}.png
448 %{_iconsdir}/%{name}.png
449 %{_liconsdir}/%{name}.png
450 %{_datadir}/applications/*.desktop
451 %{mozillalibdir}
452 %ghost %{mozillalibdir}/browser/defaults/profile/bookmarks.html
453 %dir %{_libdir}/mozilla
454 %dir %{pluginsdir}
455 %dir %{_libdir}/mozilla/extensions/%{firefox_appid}
456 %dir %{_datadir}/mozilla/extensions/%{firefox_appid}
457
458 %files devel
459 %{_sys_macros_dir}/%{name}.macros
460 %{_includedir}/np*.h
461 %{_datadir}/pkgconfig/mozilla-plugin.pc

  ViewVC Help
Powered by ViewVC 1.1.30