1 |
# |
2 |
# WARNING, READ FIRST: |
3 |
# |
4 |
# PLEASE svn cp SOURCES FROM xulrunner SOURCES INSTEAD |
5 |
# OF COMMITING AGAIN THE TARBALL |
6 |
# |
7 |
# This is a special package that needs special treatment. Due to the amount of |
8 |
# security updates it needs, it's common to ship new upstream versions instead of patching. |
9 |
# That means this package MUST be BUILDABLE for stable official releases. |
10 |
# This also means only STABLE upstream releases, NO betas. |
11 |
# This is a discussed topic. Please, do not flame it again. |
12 |
|
13 |
%define major 4 |
14 |
%define ff_epoch 0 |
15 |
# (tpg) set version HERE !!! |
16 |
%define realver %{major}.0 |
17 |
%define prel b10 |
18 |
%define xulrunner_version 2.0 |
19 |
# (tpg) MOZILLA_FIVE_HOME |
20 |
%define mozillalibdir %{_libdir}/%{name}-%{realver}%{?prel} |
21 |
%define pluginsdir %{_libdir}/mozilla/plugins |
22 |
|
23 |
# libxul.so is provided by libxulrunnner2.0. |
24 |
%define _requires_exceptions libxul.so |
25 |
|
26 |
# this seems fragile, so require the exact version or later (#58754) |
27 |
%define sqlite3_version %(pkg-config --modversion sqlite3 &>/dev/null && pkg-config --modversion sqlite3 2>/dev/null || echo 0) |
28 |
|
29 |
%define _use_syshunspell 1 |
30 |
|
31 |
%define release %mkrel -c %prel 2 |
32 |
|
33 |
Summary: Next generation web browser |
34 |
Name: firefox |
35 |
Version: %{realver} |
36 |
Epoch: %{ff_epoch} |
37 |
Release: %{release} |
38 |
License: MPLv1+ |
39 |
Group: Networking/WWW |
40 |
Url: http://www.mozilla.com/firefox/ |
41 |
Source0: ftp://ftp.mozilla.org/pub/mozilla.org/%{name}/releases/%{realver}/source/%{name}-%{realver}%prel.source.tar.bz2 |
42 |
Source1: %{SOURCE0}.asc |
43 |
Source4: %{name}.desktop |
44 |
Source5: firefox-searchengines-jamendo.xml |
45 |
Source6: firefox-searchengines-exalead.xml |
46 |
Source7: firefox-rebuild-databases.pl.in.generatechrome |
47 |
Source8: firefox-searchengines-askcom.xml |
48 |
Source9: kde.js |
49 |
Patch1: mozilla-firefox-3.0.5-lang.patch |
50 |
Patch2: mozilla-firefox-3.0.5-vendor.patch |
51 |
Patch3: mozilla-firefox-1.5.0.6-systemproxy.patch |
52 |
Patch5: firefox-3.0b3-check-default-browser.patch |
53 |
Patch6: mozilla-firefox-run-mozilla.patch |
54 |
Patch14: mozilla-firefox-1.5-software-update.patch |
55 |
#Patch15: firefox-3.0.1-disable-classic-theme.patch |
56 |
Patch16: firefox-3.5.3-default-mail-handler.patch |
57 |
Patch17: firefox-kde.patch |
58 |
# (OpenSuse) add patch to make firefox always use /usr/bin/firefox when "make firefox |
59 |
# the default web browser" is used fix mdv bug#58784 |
60 |
Patch18: firefox-3.6.3-appname.patch |
61 |
BuildRequires: gtk+2-devel |
62 |
BuildRequires: libx11-devel |
63 |
BuildRequires: unzip |
64 |
BuildRequires: zip |
65 |
BuildRequires: libpng-devel >= 1.2.25-2 |
66 |
BuildRequires: libjpeg-devel |
67 |
BuildRequires: zlib-devel |
68 |
BuildRequires: glib2-devel |
69 |
BuildRequires: libIDL2-devel |
70 |
BuildRequires: makedepend |
71 |
BuildRequires: nss-devel >= 2:3.12.7 |
72 |
BuildRequires: nspr-devel >= 2:4.8.7 |
73 |
BuildRequires: startup-notification-devel |
74 |
BuildRequires: dbus-glib-devel |
75 |
BuildRequires: python |
76 |
Requires: %{mklibname sqlite3_ 0} >= %{sqlite3_version} |
77 |
BuildRequires: libsqlite3-devel >= 3.7.0.1-2 |
78 |
BuildRequires: valgrind |
79 |
BuildRequires: rootcerts |
80 |
BuildRequires: libxt-devel |
81 |
%if %_use_syshunspell |
82 |
BuildRequires: hunspell-devel |
83 |
%endif |
84 |
BuildRequires: doxygen |
85 |
BuildRequires: libgnome-vfs2-devel |
86 |
BuildRequires: libgnome2-devel |
87 |
BuildRequires: libgnomeui2-devel |
88 |
BuildRequires: java-rpmbuild |
89 |
BuildRequires: xulrunner-devel >= %xulrunner_version%{?prel:-0.%prel} |
90 |
BuildRequires: wget |
91 |
BuildRequires: libnotify-devel |
92 |
BuildRequires: cairo-devel >= 1.8.8 |
93 |
BuildRequires: yasm |
94 |
BuildRequires: mesagl-devel |
95 |
%if %{prel} |
96 |
Provides: %{name} = %{epoch}:%{realver}-0.%{prel} |
97 |
%endif |
98 |
Provides: webclient |
99 |
Requires: indexhtml |
100 |
Requires: xdg-utils |
101 |
%define ff_deps myspell-en_US nspluginwrapper |
102 |
Suggests: %{ff_deps} |
103 |
Requires(post): desktop-file-utils |
104 |
Requires(postun): desktop-file-utils |
105 |
# fixes bug #42096 |
106 |
Requires: mailcap |
107 |
Provides: mozilla-firefox = %{epoch}:%{version}-%{release} |
108 |
Requires: xulrunner >= %{xulrunner_version}%{?prel:-0.%prel} |
109 |
Requires: %{mklibname xulrunner %xulrunner_version} |
110 |
Obsoletes: firefox-ext-weave-sync |
111 |
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot |
112 |
|
113 |
%description |
114 |
The award-winning Web browser is now faster, more secure, and fully customizable |
115 |
to your online life. With Firefox(R) 3, we've added powerful new features that |
116 |
make your online experience even better. It is an 'open source' product which is |
117 |
freely available, and is acquiring a growing proportion of international web |
118 |
browser usage. |
119 |
|
120 |
Firefox claims to offer a more secure web browsing experience than other products, |
121 |
with better protection against spyware and other Internet-based security threats. |
122 |
It includes all the standard features of a modern web browser, like Internet |
123 |
searching, tracking recently visited sites, setting up shortcuts to favourite |
124 |
sites, customising the software behaviour and so on. Firefox also includes |
125 |
features like 'tabbed browsing' (opening several web sites as sections within the |
126 |
same window) and methods for controlling pop-up windows, cookies and downloaded |
127 |
files. |
128 |
|
129 |
%package devel |
130 |
Summary: Development files for %{name} |
131 |
Group: Development/Other |
132 |
|
133 |
%description devel |
134 |
Files and macros mainly for building Firefox extensions. |
135 |
|
136 |
%prep |
137 |
%setup -qn mozilla-central |
138 |
#%patch1 -p1 -b .lang rediff |
139 |
%patch2 -p1 -b .vendor |
140 |
# Temporary disabled. It prevents firefox from running. |
141 |
#%patch3 -p1 |
142 |
%patch5 -p1 -b .defaultbrowser |
143 |
# It was disabled because firefox3 hangs when using soundwrapper |
144 |
#%patch6 -p1 |
145 |
#%patch14 -p1 -b .disable-software-update rediff |
146 |
# (salem) this patch does not work properly on ff3. |
147 |
#%patch15 -p1 -b .disable-classic-theme |
148 |
%patch16 -p1 -b .default-mail-handler |
149 |
## KDE INTEGRATION |
150 |
# copy current files and patch them later to keep them in sync |
151 |
#%patch17 -p1 |
152 |
# install kde.js |
153 |
install -m 644 %{SOURCE9} browser/app/profile/kde.js |
154 |
%patch18 -p1 -b .appname |
155 |
# (tpg) remove ff bookmarks, use mdv ones |
156 |
rm -rf browser/locales/en-US/profile/bookmarks.html |
157 |
touch browser/locales/en-US/profile/bookmarks.html |
158 |
|
159 |
# needed to regenerate certdata.c |
160 |
pushd security/nss/lib/ckfw/builtins |
161 |
perl ./certdata.perl < /etc/pki/tls/mozilla/certdata.txt |
162 |
popd |
163 |
|
164 |
%build |
165 |
%setup_compile_flags |
166 |
%serverbuild |
167 |
export PREFIX="%{_prefix}" |
168 |
export LIBDIR="%{_libdir}" |
169 |
export MOZILLA_OFFICIAL=1 |
170 |
export BUILD_OFFICIAL=1 |
171 |
|
172 |
# (tpg) don't use macro here |
173 |
# (fhimpe) javaxpcom does not build correctly with xulrunner (is it |
174 |
# actually needed/useful here when enabled already in xulrunner?) |
175 |
# https://bugzilla.mozilla.org/show_bug.cgi?id=448386 |
176 |
./configure --build=%{_target_platform} \ |
177 |
--prefix=%{_prefix} \ |
178 |
--bindir=%{_bindir} \ |
179 |
--libdir=%{_libdir} \ |
180 |
--includedir=%{_includedir} \ |
181 |
--datadir=%{_datadir} \ |
182 |
--enable-application=browser \ |
183 |
--with-pthreads \ |
184 |
--with-system-jpeg \ |
185 |
--with-system-zlib \ |
186 |
--with-system-bz2 \ |
187 |
--enable-system-png \ |
188 |
--with-system-nspr \ |
189 |
--without-system-nss \ |
190 |
--disable-ldap \ |
191 |
--disable-calendar \ |
192 |
--disable-mailnews \ |
193 |
--disable-chatzilla \ |
194 |
--disable-composer \ |
195 |
--disable-profilesharing \ |
196 |
--disable-toolkit-qt \ |
197 |
--disable-installer \ |
198 |
--disable-updater \ |
199 |
--disable-debug \ |
200 |
--disable-pedantic \ |
201 |
--disable-native-uconv \ |
202 |
--disable-elf-dynstr-gc \ |
203 |
--disable-crashreporter \ |
204 |
--disable-strip \ |
205 |
--enable-crypto \ |
206 |
--enable-gnomevfs \ |
207 |
--enable-gnomeui \ |
208 |
--enable-places \ |
209 |
--enable-storage \ |
210 |
--enable-default-toolkit=cairo-gtk2 \ |
211 |
--enable-official-branding \ |
212 |
--enable-svg \ |
213 |
--enable-svg-renderer=cairo \ |
214 |
--enable-single-profile \ |
215 |
--enable-startup-notification \ |
216 |
--enable-system-cairo \ |
217 |
--disable-javaxpcom \ |
218 |
--enable-optimize \ |
219 |
--enable-safe-browsing \ |
220 |
--enable-xinerama \ |
221 |
--enable-canvas \ |
222 |
--enable-pango \ |
223 |
--enable-xtf \ |
224 |
--enable-wave \ |
225 |
--enable-webm \ |
226 |
--enable-ogg \ |
227 |
--enable-xpcom-fastload \ |
228 |
--enable-gio \ |
229 |
--enable-dbus \ |
230 |
--enable-image-encoder=all \ |
231 |
--enable-image-decoders=all \ |
232 |
--enable-extensions=default \ |
233 |
%if %_use_syshunspell |
234 |
--enable-system-hunspell \ |
235 |
%endif |
236 |
--enable-install-strip \ |
237 |
--enable-url-classifier \ |
238 |
--disable-faststart \ |
239 |
--enable-smil \ |
240 |
--disable-tree-freetype \ |
241 |
--enable-canvas3d \ |
242 |
--disable-coretext \ |
243 |
--enable-necko-protocols=all \ |
244 |
--disable-necko-wifi \ |
245 |
--disable-tests \ |
246 |
--disable-mochitest \ |
247 |
--with-distribution-id=com.mageia \ |
248 |
--with-valgrind \ |
249 |
--enable-jemalloc \ |
250 |
--enable-system-sqlite \ |
251 |
--with-system-libxul \ |
252 |
--with-libxul-sdk=`pkg-config --variable=sdkdir libxul` \ |
253 |
--with-java-include-path=%{java_home}/include \ |
254 |
--with-java-bin-path=%{java_home}/bin \ |
255 |
--with-default-mozilla-five-home="%{mozillalibdir}" |
256 |
|
257 |
%__perl -p -i -e 's|\-0|\-9|g' config/make-jars.pl |
258 |
|
259 |
%make |
260 |
|
261 |
%install |
262 |
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot} |
263 |
|
264 |
%makeinstall_std |
265 |
|
266 |
ln -s firefox %{buildroot}%{_bindir}/mozilla-firefox |
267 |
sed -i "s,@LIBDIR@,%{_libdir}," %{buildroot}%{mozillalibdir}/%{name} |
268 |
|
269 |
# Create an own %_libdir/mozilla/plugins |
270 |
%{__mkdir_p} %{buildroot}%{_libdir}/mozilla/plugins |
271 |
|
272 |
# (tpg) desktop entry |
273 |
%{__mkdir_p} %{buildroot}%{_datadir}/applications |
274 |
install -m 644 %{SOURCE4} %{buildroot}%{_datadir}/applications/%{name}.desktop |
275 |
|
276 |
# (tpg) icons |
277 |
%{__cp} other-licenses/branding/%{name}/default16.png %{buildroot}/%{mozillalibdir}/icons/ |
278 |
for i in 16 22 24 32 48 256; do |
279 |
%{__mkdir_p} %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps |
280 |
%{__cp} other-licenses/branding/%{name}/default$i.png %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps/firefox.png ; |
281 |
done |
282 |
|
283 |
install -D -m644 browser/app/profile/prefs.js %{buildroot}%{mozillalibdir}/defaults/profile/prefs.js |
284 |
cat << EOF >> %{buildroot}%{mozillalibdir}/defaults/profile/prefs.js |
285 |
user_pref("browser.search.selectedEngine","Ask.com"); |
286 |
user_pref("browser.search.order.1","Ask.com"); |
287 |
user_pref("browser.search.order.2","Exalead"); |
288 |
user_pref("browser.search.order.3","Google"); |
289 |
user_pref("browser.search.order.4","Yahoo"); |
290 |
user_pref("browser.EULA.override", true); |
291 |
user_pref("browser.shell.checkDefaultBrowser", false); |
292 |
user_pref("browser.startup.homepage", "file:///usr/share/doc/HTML/index.html"); |
293 |
user_pref("browser.ctrlTab.previews", true); |
294 |
user_pref("browser.tabs.insertRelatedAfterCurrent", false); |
295 |
user_pref("app.update.auto", false); |
296 |
user_pref("app.update.enabled", false); |
297 |
user_pref("app.update.autoInstallEnabled", false); |
298 |
user_pref("security.ssl.require_safe_negotiation", false); |
299 |
user_pref("browser.startup.homepage","file:///usr/share/doc/HTML/index.html"); |
300 |
EOF |
301 |
|
302 |
# search engines |
303 |
cp -f %{SOURCE5} %{buildroot}%{mozillalibdir}/searchplugins/jamendo.xml |
304 |
cp -f %{SOURCE6} %{buildroot}%{mozillalibdir}/searchplugins/exalead.xml |
305 |
cp -f %{SOURCE8} %{buildroot}%{mozillalibdir}/searchplugins/askcom.xml |
306 |
|
307 |
sed -i 's/@DISTRO_VALUE@/ffx/' %{buildroot}%{mozillalibdir}/searchplugins/askcom.xml |
308 |
sed -i 's/@DISTRO_VALUE@//' %{buildroot}%{mozillalibdir}/searchplugins/exalead.xml |
309 |
|
310 |
#ghost files |
311 |
touch %{buildroot}%{mozillalibdir}/components/compreg.dat |
312 |
touch %{buildroot}%{mozillalibdir}/components/xpti.dat |
313 |
|
314 |
# firefox update tool |
315 |
cat %{SOURCE7} |\ |
316 |
sed -e "s|FIREFOX_VERSION|%{realver}|g;s|LIBDIR|%{_libdir}|g"\ |
317 |
> %{buildroot}%{mozillalibdir}/firefox-rebuild-databases.pl |
318 |
chmod 755 %{buildroot}%{mozillalibdir}/firefox-rebuild-databases.pl |
319 |
|
320 |
%find_lang %{name} |
321 |
|
322 |
mkdir -p %{buildroot}%{_sys_macros_dir} |
323 |
cat <<FIN >%{buildroot}%{_sys_macros_dir}/%{name}.macros |
324 |
# Macros from %{name} package |
325 |
%%firefox_major %{major} |
326 |
%%firefox_epoch %{ff_epoch} |
327 |
%%firefox_version %{realver}%{?prel:-0.%prel} |
328 |
%%firefox_mozillapath %{mozillalibdir} |
329 |
%%firefox_xulrunner_version %{xulrunner_version} |
330 |
%%firefox_pluginsdir %{pluginsdir} |
331 |
FIN |
332 |
|
333 |
%post |
334 |
unset DISPLAY |
335 |
%{mozillalibdir}/firefox-rebuild-databases.pl |
336 |
if [ ! -r /etc/sysconfig/oem ]; then |
337 |
case `grep META_CLASS /etc/sysconfig/system` in |
338 |
*powerpack) bookmark="mozilla-powerpack.html" ;; |
339 |
*desktop) bookmark="mozilla-one.html";; |
340 |
*) bookmark="mozilla-download.html";; |
341 |
esac |
342 |
ln -s -f ../../../../share/mdk/bookmarks/mozilla/$bookmark %{mozillalibdir}/defaults/profile/bookmarks.html |
343 |
fi |
344 |
|
345 |
%clean |
346 |
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot} |
347 |
|
348 |
%files -f %{name}.lang |
349 |
%defattr(-,root,root) |
350 |
%{_bindir}/%{name} |
351 |
%{_bindir}/mozilla-firefox |
352 |
%{_iconsdir}/hicolor/*/apps/*.png |
353 |
%ghost %{mozillalibdir}/components/compreg.dat |
354 |
%ghost %{mozillalibdir}/components/xpti.dat |
355 |
%{_datadir}/applications/*.desktop |
356 |
%{_libdir}/%{name}-%{realver}* |
357 |
%dir %{_libdir}/mozilla |
358 |
%dir %{pluginsdir} |
359 |
|
360 |
%files devel |
361 |
%{_sys_macros_dir}/%{name}.macros |
362 |
|
363 |
|