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 |
# (tpg) DO NOT FORGET TO SET EXACT XULRUNNER and FIREFOX VERSIONS ! |
11 |
%define ffver 4.0 |
12 |
%define version_internal 2.0 |
13 |
|
14 |
%define prel b8 |
15 |
|
16 |
# (tpg) define release here |
17 |
#if %mageia_branch == Cauldron |
18 |
# Cauldron |
19 |
%define release %mkrel -c %prel 3 |
20 |
#else |
21 |
# Old distros |
22 |
#define subrel 1 |
23 |
#define release %mkrel 0 |
24 |
#endif |
25 |
|
26 |
# (tpg) DO NOT FORGET TO SET EXACT MAJOR! |
27 |
# in this case %{major} == %{version_internal} |
28 |
%define major %{version_internal} |
29 |
%define libname %mklibname %{name} %{major} |
30 |
%define develname %mklibname %{name} -d |
31 |
%define develunstname %mklibname %{name}-unstable -d |
32 |
%define sname firefox |
33 |
|
34 |
# (tpg) various directory defines |
35 |
%define mozappdir %{_libdir}/%{name}-%{version_internal} |
36 |
|
37 |
# (salem) ugly but avoids hardcoding package versions (#42745) |
38 |
# TODO: needs a better solution. (%__isa macro)? |
39 |
%define hunspellver %(rpm -q --whatprovides libhunspell --queryformat %{NAME}) |
40 |
%define nss_libname %mklibname nss 3 |
41 |
%define nspr_libname %mklibname nspr 4 |
42 |
|
43 |
# this seems fragile, so require the exact version or later (#58754) |
44 |
%define sqlite3_version %(pkg-config --modversion sqlite3 &>/dev/null && pkg-config --modversion sqlite3 2>/dev/null || echo 0) |
45 |
%define nss_version %(pkg-config --modversion nss &>/dev/null && pkg-config --modversion nss 2>/dev/null || echo 0) |
46 |
|
47 |
%define _use_syshunspell 1 |
48 |
|
49 |
Summary: XUL Runtime for Gecko Applications |
50 |
Name: xulrunner |
51 |
Version: %{version_internal} |
52 |
Release: %{release} |
53 |
License: MPLv1.1 or GPLv2+ or LGPLv2+ |
54 |
Group: Development/Other |
55 |
Url: http://developer.mozilla.org/en/docs/XULRunner |
56 |
Source0: ftp://ftp.mozilla.org/pub/mozilla.org/%{sname}/releases/%{ffver}/source/%{sname}-%{ffver}%prel.source.tar.bz2 |
57 |
Source1: %{SOURCE0}.asc |
58 |
Patch1: xulrunner-1.9.1-max-path-len.patch |
59 |
Patch5: mozilla-nongnome-proxies.patch |
60 |
Patch7: %{name}-1.9.1-pluginsdir2.patch |
61 |
# Fedora patches: |
62 |
# use 1.9 as xulrunner version in the dirname and not the complete version string |
63 |
Patch8: xulrunner-1.9.0.1-version.patch |
64 |
Patch9: xulrunner-ipc-stl.patch |
65 |
Patch10: xulrunner-1.9.2-pkgconfig.patch |
66 |
# (salem) this patch does not work properly on ff3 |
67 |
#Patch11: xulrunner-1.9.0.1-theme-selection.patch |
68 |
Patch12: xulrunner-1.9.0.5-fix-string-format.patch |
69 |
Patch14: xulrunner-1.9.1-jemalloc.patch |
70 |
Patch15: xulrunner-1.9.1-gtk2.patch |
71 |
Patch16: xulrunner-1.9.1-java-make-j1.patch |
72 |
Patch17: xulrunner-1.9.2-public-opearator-delete.patch |
73 |
Patch19: xulrunner-1.9.2-fix-plugins-cflags.patch |
74 |
Patch20: xulrunner-1.9.2-helper-app.patch |
75 |
Patch21: xulrunner-1.9.2-kde-integration.patch |
76 |
Patch25: xulrunner-1.9.2-realpath.patch |
77 |
Patch26: mozilla-1.9.2-gtk2.diff |
78 |
Patch27: xulrunner-2.0b4-missing-linking-libraries.patch |
79 |
BuildRequires: zlib-devel |
80 |
BuildRequires: bzip2-devel |
81 |
BuildRequires: libpng-devel >= 1.2.25-2 |
82 |
%if %_use_syshunspell |
83 |
BuildRequires: libhunspell-devel |
84 |
%endif |
85 |
BuildRequires: libIDL2-devel |
86 |
BuildRequires: gtk+2-devel |
87 |
BuildRequires: startup-notification-devel |
88 |
BuildRequires: dbus-glib-devel |
89 |
BuildRequires: libsqlite3-devel >= 3.7.0.1-2 |
90 |
BuildRequires: libgnome-vfs2-devel |
91 |
BuildRequires: libgnome2-devel |
92 |
BuildRequires: libgnomeui2-devel |
93 |
BuildRequires: java-rpmbuild |
94 |
BuildRequires: java-1.5.0-devel |
95 |
BuildRequires: zip |
96 |
BuildRequires: doxygen |
97 |
BuildRequires: makedepend |
98 |
BuildRequires: valgrind |
99 |
BuildRequires: rootcerts |
100 |
BuildRequires: python |
101 |
BuildRequires: python-devel |
102 |
BuildRequires: nspr-devel >= 2:4.8.7 |
103 |
BuildRequires: nss-static-devel >= 2:3.12.7 |
104 |
BuildRequires: pango-devel |
105 |
BuildRequires: libalsa-devel |
106 |
BuildRequires: libnotify-devel |
107 |
BuildRequires: mesagl-devel |
108 |
BuildRequires: cairo-devel >= 1.8.8 |
109 |
BuildRequires: yasm |
110 |
BuildRequires: libproxy-devel |
111 |
Requires: %{libname} = %{version}-%{release} |
112 |
Conflicts: xulrunner < %{version} |
113 |
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot |
114 |
|
115 |
%description |
116 |
XULRunner is a Mozilla runtime package that can be used to |
117 |
bootstrap XUL+XPCOM applications that are as rich as Firefox |
118 |
and Thunderbird. It will provide mechanisms for installing, |
119 |
upgrading, and uninstalling these applications. XULRunner will |
120 |
also provide libxul, a solution which allows the embedding of |
121 |
Mozilla technologies in other projects and products. |
122 |
|
123 |
%package -n %{libname} |
124 |
Summary: Dynamic libraries for %{name} |
125 |
Group: System/Libraries |
126 |
Requires: %{libname} = %{version}-%{release} |
127 |
Conflicts: xulrunner < %{version} |
128 |
Obsoletes: %{mklibname xulrunner 1.9.2} < %{version}-%{release} |
129 |
Requires: rootcerts |
130 |
# (tpg) manually pull dependancies on libnss3 and libnspr4, why ? see above |
131 |
Requires: %{nss_libname} >= 2:%{nss_version} |
132 |
Requires: %{nspr_libname} >= 2:4.8.7 |
133 |
%if %_use_syshunspell |
134 |
# (salem) fixes #42745 |
135 |
Requires: %{hunspellver} |
136 |
%endif |
137 |
# (salem) bug #42680 for noarch packages |
138 |
Provides: libxulrunner = %{version}-%{release} |
139 |
Requires: %{mklibname sqlite3_ 0} >= %{sqlite3_version} |
140 |
|
141 |
%description -n %{libname} |
142 |
Dynamic libraries for %{name}. |
143 |
|
144 |
%package -n %{develname} |
145 |
Summary: Development files for %{name} |
146 |
Group: Development/Other |
147 |
Requires: %{name} = %{version}-%{release} |
148 |
Obsoletes: xulrunner-devel < 1.9.2 |
149 |
Obsoletes: %{mklibname mozilla-firefox -d} < 0:3 |
150 |
Obsoletes: %{mklibname %{name}-unstable -d} |
151 |
Provides: %{name}-devel = %{version}-%{release} |
152 |
# (tpg) see above why |
153 |
Requires: nss-devel |
154 |
Requires: libalsa-devel |
155 |
|
156 |
%description -n %{develname} |
157 |
Development files and headers for %{name}. |
158 |
|
159 |
%prep |
160 |
%setup -qn mozilla-central |
161 |
#%patch1 -p1 -b .pathlen rediff |
162 |
%patch5 -p0 -b .proxy |
163 |
%patch7 -p1 -b .plugins |
164 |
%patch8 -p1 -b .version |
165 |
|
166 |
#%patch10 -p1 -b .pkgconfig rediff |
167 |
#%patch12 -p0 -b .strformat rediff |
168 |
#%patch14 -p1 -b .jemalloc rediff |
169 |
#%patch15 -p1 -b .gtk2 |
170 |
%patch16 -p1 -b .java_make-j1 |
171 |
%patch17 -p1 |
172 |
#%patch19 -p1 rediff |
173 |
#%patch20 -p1 rediff |
174 |
#%patch21 -p1 -b .kde-integration rediff? |
175 |
%patch25 -p1 |
176 |
|
177 |
%patch27 -p0 |
178 |
|
179 |
# needed to regenerate certdata.c |
180 |
pushd security/nss/lib/ckfw/builtins |
181 |
perl ./certdata.perl < /etc/pki/tls/mozilla/certdata.txt |
182 |
popd |
183 |
|
184 |
#(tpg) correct the xulrunner version |
185 |
sed -i -e 's#INTERNAL_VERSION#%{version_internal}#g' xulrunner/installer/Makefile.in |
186 |
|
187 |
%build |
188 |
%serverbuild |
189 |
export PREFIX="%{_prefix}" |
190 |
export LIBDIR="%{_libdir}" |
191 |
export CFLAGS="$(echo %{optflags} | sed -e 's/-Wall//')" |
192 |
export CXXFLAGS="$CFLAGS" |
193 |
%if %mdkversion >= 200900 |
194 |
export LDFLAGS="%ldflags -Wl,-rpath,%{mozappdir}" |
195 |
%else |
196 |
# macro ldflags is nonexisting in older distro versions |
197 |
export LDFLAGS="$LDFLAGS -Wl,-rpath,%{mozappdir}" |
198 |
%endif |
199 |
|
200 |
# (tpg) don't use macro here |
201 |
# (fhimpe) Starting from Firefox 3.0.1, at least sqlite 3.5.9 is needed |
202 |
# so don't use system sqlite on Mandriva older than 2009.0 |
203 |
./configure --build=%{_target_platform} \ |
204 |
--host=%_host --target=%_target_platform \ |
205 |
--prefix=%{_prefix} \ |
206 |
--bindir=%{_bindir} \ |
207 |
--libdir=%{_libdir} \ |
208 |
--includedir=%{_includedir} \ |
209 |
--datadir=%{_datadir} \ |
210 |
--sysconfdir=%{_sysconfdir} \ |
211 |
--enable-application=xulrunner \ |
212 |
--with-pthreads \ |
213 |
--with-system-jpeg \ |
214 |
--with-system-zlib \ |
215 |
--with-system-bz2 \ |
216 |
--enable-system-png \ |
217 |
--with-system-nspr \ |
218 |
--without-system-nss \ |
219 |
--enable-system-sqlite \ |
220 |
--enable-system-cairo \ |
221 |
%if %_use_syshunspell |
222 |
--enable-system-hunspell \ |
223 |
%endif |
224 |
--disable-javaxpcom \ |
225 |
--enable-pango \ |
226 |
--enable-svg \ |
227 |
--enable-canvas \ |
228 |
--enable-crypto \ |
229 |
--disable-crashreporter \ |
230 |
--disable-installer \ |
231 |
--disable-updater \ |
232 |
--enable-optimize \ |
233 |
--enable-jemalloc \ |
234 |
--disable-wrap-malloc \ |
235 |
--enable-valgrind \ |
236 |
--disable-strip \ |
237 |
--enable-install-strip \ |
238 |
--enable-startup-notification \ |
239 |
--enable-default-toolkit=cairo-gtk2 \ |
240 |
--enable-shared-js \ |
241 |
--with-java-include-path=%{java_home}/include \ |
242 |
--with-java-bin-path=%{java_home}/bin \ |
243 |
--enable-image-encoder=all \ |
244 |
--enable-image-decoders=all \ |
245 |
--enable-places \ |
246 |
--enable-storage \ |
247 |
--enable-safe-browsing \ |
248 |
--enable-url-classifier \ |
249 |
--enable-gnomevfs \ |
250 |
--enable-gnomeui \ |
251 |
--disable-faststart \ |
252 |
--enable-smil \ |
253 |
--disable-tree-freetype \ |
254 |
--enable-canvas3d \ |
255 |
--disable-coretext \ |
256 |
--enable-extensions=default \ |
257 |
--enable-necko-protocols=all \ |
258 |
--disable-necko-wifi \ |
259 |
--disable-tests \ |
260 |
--disable-mochitest \ |
261 |
--enable-xtf \ |
262 |
--enable-wave \ |
263 |
--enable-webm \ |
264 |
--enable-ogg \ |
265 |
--enable-xpcom-fastload \ |
266 |
--enable-gio \ |
267 |
--enable-dbus \ |
268 |
--enable-libproxy \ |
269 |
--with-distribution-id=com.mandriva |
270 |
|
271 |
%__perl -p -i -e 's|\-0|\-9|g' config/make-jars.pl |
272 |
|
273 |
# (tpg) on x86_64 fails when parallel compiling is on |
274 |
# java.lang.OutOfMemoryError |
275 |
# since 3.6 it does not |
276 |
%make |
277 |
|
278 |
%install |
279 |
rm -rf %{buildroot} |
280 |
|
281 |
%makeinstall_std |
282 |
|
283 |
#install -p dist/sdk/bin/regxpcom %{buildroot}%{mozappdir} |
284 |
|
285 |
rm -rf %{buildroot}%{_libdir}/%{name}-devel-%{version_internal}/sdk/lib/*.so |
286 |
pushd %{buildroot}%{mozappdir} |
287 |
for i in *.so; do |
288 |
ln -s %{mozappdir}/$i %{buildroot}%{_libdir}/%{name}-devel-%{version_internal}/sdk/lib/$i |
289 |
done |
290 |
popd |
291 |
|
292 |
# GRE stuff |
293 |
%ifarch x86_64 ia64 ppc64 s390x |
294 |
%define gre_conf_file %{version_internal}-64.system.conf |
295 |
mv %{buildroot}%{_sysconfdir}/gre.d/*.system.conf %{buildroot}%{_sysconfdir}/gre.d/%{gre_conf_file} |
296 |
%else |
297 |
%define gre_conf_file %{version_internal}.system.conf |
298 |
%endif |
299 |
|
300 |
# Don't install these in appdir |
301 |
rm %{buildroot}%{mozappdir}/LICENSE |
302 |
rm %{buildroot}%{mozappdir}/README.txt |
303 |
|
304 |
# when not building with system nspr: |
305 |
#rm -f %{buildroot}%_libdir/xulrunner-2.0/nspr-config |
306 |
|
307 |
%if %_use_syshunspell |
308 |
# Use the system hunspell dictionaries |
309 |
rm -rf %{buildroot}%{mozappdir}/dictionaries |
310 |
ln -s %{_datadir}/dict/mozilla %{buildroot}%{mozappdir}/dictionaries |
311 |
%endif |
312 |
|
313 |
# ghost files |
314 |
mkdir -p %{buildroot}%{mozappdir}/components |
315 |
touch %{buildroot}%{mozappdir}/components/compreg.dat |
316 |
touch %{buildroot}%{mozappdir}/components/xpti.dat |
317 |
|
318 |
# set up our default preferences |
319 |
cat << EOF > %{buildroot}%{mozappdir}/defaults/pref/vendor.js |
320 |
pref("general.useragent.vendor", "%{distribution}"); |
321 |
pref("general.useragent.vendorSub", "%{version}-%{release}"); |
322 |
pref("general.useragent.vendorComment", "%{mandriva_release}"); |
323 |
pref("general.smoothScroll", true); |
324 |
pref("mousewheel.horizscroll.withnokey.action", 0); |
325 |
pref("mousewheel.horizscroll.withnokey.numlines", 3); |
326 |
pref("mousewheel.horizscroll.withnokey.sysnumlines", false); |
327 |
pref("mousewheel.withnokey.action", 0); |
328 |
pref("mousewheel.withnokey.numlines", 7); |
329 |
pref("mousewheel.withnokey.sysnumlines", false); |
330 |
pref("network.protocol-handler.app.mailto", "/usr/bin/xdg-email"); |
331 |
pref("network.protocol-handler.app.mms", "/usr/bin/xdg-open"); |
332 |
pref("network.http.pipelining", true); |
333 |
pref("network.http.proxy.pipelining", true); |
334 |
pref("network.http.pipelining.maxrequests", 8); |
335 |
pref("browser.display.use_system_colors", true); |
336 |
pref("browser.tabs.loadDivertedInBackground", true); |
337 |
pref("browser.startup.homepage_override.mstone", "ignore"); |
338 |
pref("browser.backspace_action", 2); |
339 |
pref("browser.tabs.loadFolderAndReplace", false); |
340 |
pref("browser.EULA.override", true); |
341 |
pref("browser.safebrowsing.enabled", true); |
342 |
pref("browser.shell.checkDefaultBrowser", false); |
343 |
pref("browser.startup.homepage", "file:///usr/share/doc/HTML/index.html"); |
344 |
pref("browser.ctrlTab.previews", true); |
345 |
pref("browser.tabs.insertRelatedAfterCurrent", false); |
346 |
pref("print.print_edge_top", 14); // 1/100 of an inch |
347 |
pref("print.print_edge_left", 16); // 1/100 of an inch |
348 |
pref("print.print_edge_right", 16); // 1/100 of an inch |
349 |
pref("print.print_edge_bottom", 14); // 1/100 of an inch |
350 |
pref("app.update.enabled", false); |
351 |
pref("app.update.auto", false); |
352 |
pref("app.update.autoInstallEnabled", false); |
353 |
pref("intl.locale.matchOS", true); |
354 |
pref("toolkit.storage.synchronous", 0); |
355 |
pref("layout.css.visited_links_enabled", false); |
356 |
pref("security.ssl.require_safe_negotiation", false); |
357 |
EOF |
358 |
|
359 |
%find_lang %{name} |
360 |
|
361 |
mkdir -p %{buildroot}%{_sys_macros_dir} |
362 |
cat <<FIN >%{buildroot}%{_sys_macros_dir}/%{name}.macros |
363 |
# Macros from %{name} package |
364 |
%%xulrunner_major %{major} |
365 |
%%xulrunner_version %{version} |
366 |
%%xulrunner_libname %{libname} |
367 |
%%xulrunner_mozappdir %{mozappdir} |
368 |
FIN |
369 |
|
370 |
%clean |
371 |
rm -rf %{buildroot} |
372 |
|
373 |
%files |
374 |
%defattr(-,root,root) |
375 |
%doc LICENSE README.txt |
376 |
%dir %{mozappdir} |
377 |
%{_bindir}/xulrunner |
378 |
|
379 |
%files -n %{libname} |
380 |
%defattr(-,root,root) |
381 |
%dir %{mozappdir} |
382 |
%{mozappdir}/chrome |
383 |
%{mozappdir}/dictionaries |
384 |
%dir %{mozappdir}/components |
385 |
%ghost %{mozappdir}/components/compreg.dat |
386 |
%ghost %{mozappdir}/components/xpti.dat |
387 |
%{mozappdir}/components/*.so |
388 |
%{mozappdir}/components/*.xpt |
389 |
%{mozappdir}/components/*.manifest |
390 |
%{mozappdir}/*.manifest |
391 |
%attr(644, root, root) %{mozappdir}/components/*.js |
392 |
%{mozappdir}/defaults |
393 |
#%{mozappdir}/greprefs |
394 |
%dir %{mozappdir}/icons |
395 |
%attr(644, root, root) %{mozappdir}/icons/* |
396 |
%{mozappdir}/modules |
397 |
%{mozappdir}/plugins |
398 |
%{mozappdir}/res |
399 |
%{mozappdir}/*.so |
400 |
%{mozappdir}/mozilla-xremote-client |
401 |
%{mozappdir}/run-mozilla.sh |
402 |
#%{mozappdir}/regxpcom |
403 |
%{mozappdir}/greprefs.js |
404 |
%{mozappdir}/*.chk |
405 |
%{mozappdir}/xulrunner |
406 |
%{mozappdir}/xulrunner-bin |
407 |
%{mozappdir}/xulrunner-stub |
408 |
%{mozappdir}/platform.ini |
409 |
%{mozappdir}/dependentlibs.list |
410 |
#%{mozappdir}/javaxpcom.jar |
411 |
%{mozappdir}/plugin-container |
412 |
%dir %{_sysconfdir}/gre.d |
413 |
%{_sysconfdir}/gre.d/*.conf |
414 |
|
415 |
%files -n %{develname} |
416 |
%defattr(-,root,root) |
417 |
%{_includedir}/%{name}-%{version_internal} |
418 |
%{mozappdir}/xpcshell |
419 |
%{mozappdir}/xpidl |
420 |
%{mozappdir}/xpt_dump |
421 |
%{mozappdir}/xpt_link |
422 |
%{_libdir}/%{name}-devel-%{version_internal} |
423 |
%{_libdir}/pkgconfig/*.pc |
424 |
%{_datadir}/idl/%{name}-%{version_internal} |
425 |
%{_sys_macros_dir}/%{name}.macros |
426 |
|
427 |
|