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