/[packages]/cauldron/firefox/current/SPECS/firefox.spec
ViewVC logotype

Contents of /cauldron/firefox/current/SPECS/firefox.spec

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30