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

  ViewVC Help
Powered by ViewVC 1.1.30