/[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 897566 - (show annotations) (download)
Tue Nov 3 16:30:57 2015 UTC (8 years, 5 months ago) by luigiwalser
File size: 15975 byte(s)
38.4.0
1 #
2 # WARNING, READ FIRST:
3 #
4 # This is a special package that needs special treatment. Due to the amount of
5 # security updates it needs, it's common to ship new upstream versions instead of patching.
6 # That means this package MUST be BUILDABLE for stable official releases.
7 # This also means only STABLE upstream releases, NO betas.
8 # This is a discussed topic. Please, do not flame it again.
9
10 # Stay on ESR for stable releases and for cauldron before mageia 5.
11 # /!\ Do not update more than FF 45 for mga6. /!\
12 # ff 38 -> 45 -> 52
13
14
15 # (doktor5000) this switch enables to build with clang
16 # WARNING, DO NOT CHANGE THIS, If YOU DON'T TEST AND FIX FIREFOX AFTERWARDS!
17 # clang can build firefox without issues, but it will be really crashy
18 # during runtime, even for simple things
19 # see https://bugs.mageia.org/show_bug.cgi?id=14062
20 # and https://bugs.mageia.org/show_bug.cgi?id=13575
21 %define use_clang 0
22
23
24 %define major 38
25 %define ff_epoch 0
26 # (tpg) set version HERE !!!
27 %define extra esr
28 #define extra %nil
29 %define realver %{version}%extra
30 %define firefox_appid \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
31
32 # (tpg) MOZILLA_FIVE_HOME
33 %define mozillalibdir %{_libdir}/%{name}
34 %define pluginsdir %{_libdir}/mozilla/plugins
35
36 # libxul.so is provided by libxulrunnner2.0.
37 %global __requires_exclude libxul.so
38
39 # this seems fragile, so require the exact version or later (#58754)
40 %define sqlite3_version %(pkg-config --modversion sqlite3 &>/dev/null && pkg-config --modversion sqlite3 2>/dev/null || echo 0)
41 %define nss_version %(pkg-config --modversion nss &>/dev/null && pkg-config --modversion nss 2>/dev/null || echo 0)
42 %define nspr_version %(pkg-config --modversion nspr &>/dev/null && pkg-config --modversion nspr 2>/dev/null || echo 0)
43
44 %define _use_syshunspell 1
45
46
47 %define update_channel %{extra}%major
48
49 Summary: Next generation web browser
50 Name: firefox
51 Version: %{major}.4.0
52 Epoch: %{ff_epoch}
53 Release: %mkrel 1
54 License: MPLv1+
55 Group: Networking/WWW
56 Url: http://www.mozilla.org/firefox/organizations/
57 Source0: https://ftp.mozilla.org/pub/mozilla.org/%{name}/releases/%{realver}/source/%{name}-%{realver}.source.tar.bz2
58 Source4: %{name}.desktop
59 Source8: %{name}-searchengines-duckduckgo.xml
60 Source9: kde.js
61 Patch1: firefox-6.0-lang.patch
62 # (OpenSuse) add patch to make firefox always use /usr/bin/firefox when "make firefox
63 # the default web browser" is used fix mdv bug#58784
64 Patch5: firefox-38.0-appname.patch
65 Patch6: firefox-7.0-fix-str-fmt.patch
66 Patch8: firefox-disable-check-default-browser.patch
67 Patch10: firefox-3.5.3-default-mail-handler.patch
68 # Patches for kde integration of FF
69 # (doktor5000) old URL, not updated often: https://build.opensuse.org/package/rawsourcefile/mozilla:Factory/MozillaFirefox/mozilla-kde.patch
70 Patch11: http://www.rosenauer.org/hg/mozilla/file/tip/mozilla-kde.patch
71 # (fwang) please modify patch12 with `sed -e 's/MozillaFirefox/firefox/'` to fit our desktop filename
72 # (doktor5000) old URL, not updated often: https://build.opensuse.org/package/rawsourcefile/mozilla:Factory/MozillaFirefox/firefox-kde.patch
73 Patch12: http://www.rosenauer.org/hg/mozilla/file/tip/firefox-kde.patch
74 Patch13: firefox-13-fix-nspr-include.patch
75 Patch37: firefox-38.0-nss-version.patch
76
77 BuildRequires: gtk+2-devel
78 BuildRequires: unzip
79 BuildRequires: zip
80 BuildRequires: pkgconfig(xinerama)
81 BuildRequires: pkgconfig(xscrnsaver)
82 BuildRequires: libjpeg-devel
83 BuildRequires: pkgconfig(libpng) >= 1.6.13
84 BuildRequires: pkgconfig(zlib)
85 BuildRequires: pkgconfig(gio-2.0)
86 BuildRequires: pkgconfig(libIDL-2.0)
87 BuildRequires: makedepend
88 BuildRequires: pkgconfig(nss) >= 3.18.1
89 BuildRequires: nss-static-devel
90 BuildRequires: pkgconfig(nspr) >= 4.10.6
91 BuildRequires: pkgconfig(libstartup-notification-1.0)
92 BuildRequires: pkgconfig(dbus-glib-1)
93 BuildRequires: python
94 BuildRequires: pkgconfig(sqlite3) >= 3.8.8.2
95 %ifnarch %arm %mips
96 BuildRequires: valgrind
97 BuildRequires: yasm >= 1.0.1
98 %endif
99 %ifarch %arm
100 BuildRequires: pkgconfig(libffi)
101 %endif
102 BuildRequires: rootcerts >= 1:20130411.00
103 BuildRequires: pkgconfig(xt)
104 %if %_use_syshunspell
105 BuildRequires: pkgconfig(hunspell)
106 %endif
107 BuildRequires: doxygen
108 BuildRequires: wget
109 BuildRequires: pkgconfig(libnotify)
110 BuildRequires: pkgconfig(cairo) >= 1.10
111 BuildRequires: pkgconfig(dri)
112 BuildRequires: pkgconfig(libvpx)
113 BuildRequires: icu-devel
114 BuildRequires: autoconf2.1
115 BuildRequires: libiw-devel
116 BuildRequires: python-virtualenv
117 BuildRequires: pkgconfig(gstreamer-1.0)
118 BuildRequires: pkgconfig(gstreamer-allocators-1.0)
119 BuildRequires: pkgconfig(alsa)
120 BuildRequires: pkgconfig(libevent)
121 BuildRequires: pkgconfig(libproxy-1.0)
122 BuildRequires: pkgconfig(libpulse)
123 BuildRequires: pkgconfig(ogg)
124 BuildRequires: pkgconfig(opus)
125 BuildRequires: pkgconfig(theoradec)
126 BuildRequires: pkgconfig(vorbis)
127 %if "%use_clang" == "1"
128 BuildRequires: clang
129 %endif
130
131 Provides: %{name} = %{epoch}:%{version}
132 Provides: mozilla-firefox = %{epoch}:%{version}-%{release}
133 Provides: webclient
134
135 Requires: %{mklibname sqlite3_ 0} >= %{sqlite3_version}
136 Requires: %{mklibname nss 3} >= 2:%{nss_version}
137 Requires: %{mklibname nspr 4} >= 2:%{nspr_version}
138 Requires: indexhtml
139 Requires: xdg-utils
140 # fixes bug #42096
141 Requires: mailcap
142 Recommends: hunspell-en
143 %if %{mgaversion} >= 4
144 Requires: %{_lib}notify4
145 Requires: gstreamer1.0-libav
146 %endif
147 # make sure our default bookmarks are present
148 Requires: desktop-common-data
149 # try to fix mga#1344 (automatic installation of proper -l10n package)
150 # packages requiring locales-XX will be automatically preferred when locales-XX
151 # is already installed
152 Recommends: firefox-l10n
153
154 Recommends: %{_lib}canberra0
155 Recommends: %{_lib}cups2
156 Obsoletes: firefox-ext-weave-sync
157 Obsoletes: firefox-beta < 25
158
159 %description
160 The award-winning Web browser is now faster, more secure, and fully customizable
161 to your online life. With Firefox(R), we've added powerful new features that
162 make your online experience even better. It is an 'open source' product which is
163 freely available, and is acquiring a growing proportion of international web
164 browser usage.
165
166 Firefox claims to offer a more secure web browsing experience than other products,
167 with better protection against spyware and other Internet-based security threats.
168 It includes all the standard features of a modern web browser, like Internet
169 searching, tracking recently visited sites, setting up shortcuts to favourite
170 sites, customising the software behaviour and so on. Firefox also includes
171 features like 'tabbed browsing' (opening several web sites as sections within the
172 same window) and methods for controlling pop-up windows, cookies and downloaded
173 files.
174
175 %package devel
176 Summary: Development files for %{name}
177 Group: Development/Other
178 Obsoletes: firefox-beta-devel < 25
179
180 %description devel
181 Files and macros mainly for building Firefox extensions.
182
183 %prep
184 %if %{?extra}
185 %setup -q -n mozilla-%update_channel
186 %else
187 %setup -q -n mozilla-release
188 %endif
189 %patch1 -p1 -b .lang
190 %patch5 -p1 -b .appname
191 %patch8 -p1 -b .disable-software-update
192 %patch10 -p1 -b .default-mail-handler
193 %patch11 -p1 -b .mozkde
194 %patch12 -p1 -b .ffkde
195
196 %patch37 -p0
197
198 pushd js/src
199 autoconf-2.13
200 popd
201 autoconf-2.13
202
203 # needed to regenerate certdata.c
204 pushd security/nss/lib/ckfw/builtins
205 perl ./certdata.perl < /etc/pki/tls/mozilla/certdata.txt
206 popd
207
208 %build
209 export MOZCONFIG=$PWD/mozconfig
210 cat << EOF > $MOZCONFIG
211 mk_add_options MOZILLA_OFFICIAL=1
212 mk_add_options BUILD_OFFICIAL=1
213 mk_add_options MOZ_MAKE_FLAGS="%{_smp_mflags}"
214 mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obj
215 # -Werror=format-security causes build failures when -Wno-format is explicitly given
216 # for some sources
217 mk_add_options MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -Wformat-security -Wformat"
218 ac_add_options --host=%{_host}
219 ac_add_options --target=%{_target_platform}
220 ac_add_options --enable-optimize="%{optflags}"
221 ac_add_options --prefix="%{_prefix}"
222 ac_add_options --libdir="%{_libdir}"
223 ac_add_options --sysconfdir="%{_sysconfdir}"
224 ac_add_options --mandir="%{_mandir}"
225 ac_add_options --includedir="%{_includedir}"
226 ac_add_options --datadir="%{_datadir}"
227 ac_add_options --with-system-nspr
228 ac_add_options --with-system-nss
229 ac_add_options --with-system-zlib
230 ac_add_options --with-system-libvpx
231 ac_add_options --with-system-libevent
232 ac_add_options --with-system-harfbuzz
233 %if "%use_clang" == "0"
234 ac_add_options --disable-cpp-exceptions
235 %endif
236 ac_add_options --enable-webm
237 ac_add_options --enable-gio
238 ac_add_options --disable-gnomevfs
239 ac_add_options --disable-updater
240 ac_add_options --disable-tests
241 ac_add_options --disable-debug
242 ac_add_options --enable-official-branding
243 ac_add_options --enable-libproxy
244 %if %{mgaversion} >= 3
245 ac_add_options --with-system-png
246 %endif
247 ac_add_options --with-system-jpeg
248 ac_add_options --enable-system-cairo
249 ac_add_options --enable-system-sqlite
250 ac_add_options --with-system-icu
251 ac_add_options --enable-startup-notification
252 ac_add_options --enable-xinerama
253 ac_add_options --with-distribution-id=org.mageia
254 ac_add_options --disable-crashreporter
255 ac_add_options --enable-update-channel=%{update_channel}
256 ac_add_options --enable-gstreamer=1.0
257 %ifarch %arm
258 %if "%{_target_cpu}" != "armv7l"
259 ac_add_options --disable-methodjit
260 %endif
261 ac_add_options --enable-system-ffi
262 %endif
263 %ifnarch %arm %mips
264 ac_add_options --with-valgrind
265 %endif
266 ac_add_options --with-system-ogg
267 ac_add_options --enable-opus
268 ac_add_options --enable-webrtc
269 %if "%use_clang" == "1"
270 export CC="clang"
271 export CXX="clang++"
272 %endif
273
274 EOF
275
276 %ifarch %arm
277 export CFLAGS="-D__ARM_PCS $(echo %{optflags})"
278 export CXXFLAGS="$CFLAGS"
279 %endif
280
281 %if "%use_clang" == "1"
282 export CC="clang"
283 export CXX="clang++"
284 %endif
285
286 export LDFLAGS="%ldflags"
287 make -f client.mk build
288
289 %install
290 make -C %{_builddir}/obj/browser/installer STRIP=/bin/true MOZ_PKG_FATAL_WARNINGS=0
291
292 # Copy files to buildroot
293 %{__mkdir_p} %{buildroot}%{mozillalibdir}
294 cp -rf %{_builddir}/obj/dist/firefox/* %{buildroot}%{mozillalibdir}
295
296 %{__mkdir_p} %{buildroot}%{_bindir}
297 ln -sf %{mozillalibdir}/firefox %{buildroot}%{_bindir}/firefox
298 pushd %{buildroot}%{_bindir}
299 ln -sf firefox mozilla-firefox
300 popd
301 mkdir -p %{buildroot}%{mozillalibdir}/browser/defaults/preferences/
302 install -m 644 %{SOURCE9} %{buildroot}%{mozillalibdir}/browser/defaults/preferences/kde.js
303
304 # Create and own %_libdir/mozilla/plugins & firefox extensions directories
305 %{__mkdir_p} %{buildroot}%{pluginsdir}
306 %{__mkdir_p} %{buildroot}%{_libdir}/mozilla/extensions/%{firefox_appid}
307 %{__mkdir_p} %{buildroot}%{_datadir}/mozilla/extensions/%{firefox_appid}
308
309 # (tpg) desktop entry
310 %{__mkdir_p} %{buildroot}%{_datadir}/applications
311 install -m 644 %{SOURCE4} %{buildroot}%{_datadir}/applications/%{name}.desktop
312
313 # (tpg) icons
314 %{__cp} %{buildroot}%{mozillalibdir}/browser/chrome/icons/default/default16.png %{buildroot}/%{mozillalibdir}/browser/icons/
315 for i in 16 22 24 32 48 256; do
316 %{__mkdir_p} %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps
317 %{__install} -m 644 browser/branding/official/default$i.png %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps/%{name}.png ;
318 done
319 %{__mkdir_p} %{buildroot}{%{_liconsdir},%{_iconsdir},%{_miconsdir}}
320 ln -sf %{mozillalibdir}/browser/chrome/icons/default/default48.png %{buildroot}%{_liconsdir}/%{name}.png
321 ln -sf %{mozillalibdir}/browser/chrome/icons/default/default32.png %{buildroot}%{_iconsdir}/%{name}.png
322 ln -sf %{mozillalibdir}/browser/chrome/icons/default/default16.png %{buildroot}%{_miconsdir}/%{name}.png
323
324 # exclusions
325 rm -f %{buildroot}%{mozillalibdir}/README.txt
326 rm -f %{buildroot}%{mozillalibdir}/removed-files
327 rm -f %{buildroot}%{mozillalibdir}/precomplete
328
329 # this file is only used when creating a new user profile
330 install -D -m644 browser/app/profile/prefs.js %{buildroot}%{mozillalibdir}/browser/defaults/profile/prefs.js
331 cat << EOF >> %{buildroot}%{mozillalibdir}/browser/defaults/profile/prefs.js
332 user_pref("browser.EULA.override", true);
333 user_pref("browser.shell.checkDefaultBrowser", false);
334 user_pref("browser.startup.homepage", "file:///usr/share/indexhtml/index.html");
335 user_pref("app.update.auto", false);
336 user_pref("app.update.enabled", false);
337 user_pref("app.update.autoInstallEnabled", false);
338 user_pref("browser.showQuitWarning", true);
339 EOF
340
341 # display icon for Firefox button
342 %{__mkdir_p} %{buildroot}%{mozillalibdir}/browser/defaults/profile/chrome
343 cat << EOF > %{buildroot}%{mozillalibdir}/browser/defaults/profile/chrome/userChrome.css
344 #appmenu-toolbar-button {
345 list-style-image: url("chrome://branding/content/icon16.png");
346 }
347 EOF
348
349 # files in this directory are read on every startup, and can change/add
350 # preferences for existing profiles
351 # extensions.autoDisableScopes is a new preference added in firefox 8
352 # it defines "scopes" where newly installed addons are disabled by default
353 # this is an additive bit field, and the value defaults to 15 (1+2+4+8)
354 # we need to remove system scope (8) from it so language packs and other addons
355 # which are installed systemwide won't get marked as 3rd party and disabled
356 # documentation: http://kb.mozillazine.org/About:config_entries#Extensions.
357 # or in toolkit/mozapps/extensions/AddonManager.jsm
358 # we also need to disable the "disable addon selection dialog"
359 # (doktor5000) - path has changed since FF 21
360 # http://mike.kaply.com/2013/04/24/major-changes-coming-in-firefox-21/
361 cat << EOF > %{buildroot}%{mozillalibdir}/browser/defaults/preferences/mga.js
362 pref("general.useragent.locale", "chrome://global/locale/intl.properties");
363 pref("extensions.autoDisableScopes", 0);
364 pref("extensions.shownSelectionUI", true);
365 EOF
366 # FIXME: Add it back in mga.js when this search engine will be used by default.
367 # user_pref("browser.search.selectedEngine","duckduckgo.com");
368
369 # use the system myspell dictionaries
370 rm -fr %{buildroot}%{mozillalibdir}/dictionaries
371 ln -s %{_datadir}/hunspell %{buildroot}%{mozillalibdir}/dictionaries
372
373 # (lm) touch and %ghost bookmarks.html to a proper uninstall
374 touch %{buildroot}%{mozillalibdir}/browser/defaults/profile/bookmarks.html
375
376 %find_lang %{name}
377
378 # Add stuff to build a plugin to -devel
379 mkdir -p %{buildroot}%{_includedir}
380 cp -a dom/plugins/base/np*.h %{buildroot}%{_includedir}
381 mkdir -p %{buildroot}/%{_datadir}/pkgconfig
382 cat <<EOF >%{buildroot}/%{_datadir}/pkgconfig/mozilla-plugin.pc
383 Name: Mozilla Plug-In API
384 Description: Mozilla Plug-In API
385 Version: %{version}
386 Cflags: -I%{_includedir} -DXP_UNIX
387 EOF
388
389 mkdir -p %{buildroot}%{_sys_macros_dir}
390 cat <<FIN >%{buildroot}%{_sys_macros_dir}/%{name}.macros
391 # Macros from %{name} package
392 %%firefox_major %{version}
393 %%firefox_epoch %{ff_epoch}
394 %%firefox_version %{version}
395 %%firefox_mozillapath %{mozillalibdir}
396 %%firefox_pluginsdir %{pluginsdir}
397 %%firefox_appid \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
398 %%firefox_extdir %%(if [ "%%_target_cpu" = "noarch" ]; then echo %%{_datadir}/mozilla/extensions/%%{firefox_appid}; else echo %%{_libdir}/mozilla/extensions/%%{firefox_appid}; fi)
399 FIN
400 cp -f %{SOURCE8} %{buildroot}%{mozillalibdir}/browser/searchplugins/duckduckgo.xml
401
402 %pre
403 if [ -d %{mozillalibdir}/dictionaries ]; then
404 rm -fr %{mozillalibdir}/dictionaries
405 fi
406
407 %post
408 if [ ! -r /etc/sysconfig/oem ]; then
409 case `grep META_CLASS /etc/sysconfig/system` in
410 *powerpack) bookmark="mozilla-powerpack.html" ;;
411 *desktop) bookmark="mozilla-one.html";;
412 *) bookmark="mozilla-download.html";;
413 esac
414 ln -s -f %_prefix/share/mga/bookmarks/mozilla/$bookmark %{mozillalibdir}/browser/defaults/profile/bookmarks.html
415 fi
416
417 %files -f %{name}.lang
418 %{_bindir}/%{name}
419 %{_bindir}/mozilla-firefox
420 %{_iconsdir}/hicolor/*/apps/*.png
421 %{_miconsdir}/%{name}.png
422 %{_iconsdir}/%{name}.png
423 %{_liconsdir}/%{name}.png
424 %{_datadir}/applications/*.desktop
425 %{mozillalibdir}
426 %ghost %{mozillalibdir}/browser/defaults/profile/bookmarks.html
427 %dir %{_libdir}/mozilla
428 %dir %{pluginsdir}
429 %dir %{_libdir}/mozilla/extensions/%{firefox_appid}
430 %dir %{_datadir}/mozilla/extensions/%{firefox_appid}
431
432 %files devel
433 %{_sys_macros_dir}/%{name}.macros
434 %{_includedir}/np*.h
435 %{_datadir}/pkgconfig/mozilla-plugin.pc

  ViewVC Help
Powered by ViewVC 1.1.30