2 # - consider --enable-libproxy
5 %bcond_with tests # enable tests (whatever they check)
6 %bcond_without gnomeui # disable gnomeui support
7 %bcond_without gnome # synonym for gnomeui (gconf, libnotify and gio are still enabled)
8 %bcond_with qt # build with qt toolkit
11 %undefine with_gnomeui
14 # On updating version, grab CVE links from:
15 # https://www.mozilla.org/security/known-vulnerabilities/firefox.html
17 # The actual sqlite version (see RHBZ#480989):
18 %define sqlite_build_version %(pkg-config --silence-errors --modversion sqlite3 2>/dev/null || echo ERROR)
20 %define nspr_ver 4.9.6
21 %define nss_ver 3.14.1
23 Summary: XULRunner - Mozilla Runtime Environment for XUL+XPCOM applications
24 Summary(pl.UTF-8): XULRunner - środowisko uruchomieniowe Mozilli dla aplikacji XUL+XPCOM
29 License: MPL v1.1 or GPL v2+ or LGPL v2.1+
30 Group: X11/Applications
31 # Source tarball for xulrunner is in fact firefox tarball (checked on 1.9), so lets use it
32 # instead of waiting for mozilla to copy file on ftp.
33 Source0: http://releases.mozilla.org/pub/mozilla.org/firefox/releases/%{version}/source/firefox-%{version}.source.tar.bz2
34 # Source0-md5: 794e0139c4df0392146353c655d94bb9
35 Patch1: %{name}-rpath.patch
36 Patch2: %{name}-paths.patch
37 Patch3: %{name}-pc.patch
38 Patch4: %{name}-prefs.patch
39 Patch5: system-cairo.patch
40 Patch6: idl-parser.patch
41 # Edit patch below and restore --system-site-packages when system virtualenv gets 1.7 upgrade
42 Patch7: system-virtualenv.patch
43 Patch8: %{name}-gyp-slashism.patch
44 URL: https://developer.mozilla.org/en/XULRunner
45 %{!?with_qt:BuildRequires: GConf2-devel >= 1.2.1}
46 BuildRequires: alsa-lib-devel
47 BuildRequires: automake
48 BuildRequires: bzip2-devel
49 BuildRequires: cairo-devel >= 1.10.2-5
50 BuildRequires: dbus-glib-devel >= 0.60
51 BuildRequires: freetype-devel >= 1:2.1.8
52 BuildRequires: glib2-devel >= 1:2.20
53 %{!?with_qt:BuildRequires: gtk+2-devel >= 2:2.14}
54 BuildRequires: hunspell-devel >= 1.2.3
55 BuildRequires: libIDL-devel >= 0.8.0
56 BuildRequires: libdnet-devel
57 BuildRequires: libevent-devel >= 1.4.7
58 # standalone libffi 3.0.9 or gcc's from 4.5(?)+
59 BuildRequires: libffi-devel >= 6:3.0.9
60 %{?with_gnomeui:BuildRequires: libgnomeui-devel >= 2.2.0}
61 BuildRequires: libiw-devel
62 # requires libjpeg-turbo implementing at least libjpeg 6b API
63 BuildRequires: libjpeg-devel >= 6b
64 BuildRequires: libjpeg-turbo-devel
65 %{!?with_qt:BuildRequires: libnotify-devel >= 0.4}
66 BuildRequires: libpng(APNG)-devel >= 0.10
67 BuildRequires: libpng-devel >= 1.5.13
68 BuildRequires: libstdc++-devel
69 BuildRequires: libvpx-devel >= 1.0.0
70 BuildRequires: nspr-devel >= 1:%{nspr_ver}
71 BuildRequires: nss-devel >= 1:%{nss_ver}
72 BuildRequires: pango-devel >= 1:1.14.0
73 BuildRequires: pkgconfig
74 BuildRequires: pkgconfig(libffi) >= 3.0.9
75 BuildRequires: python >= 1:2.5
76 BuildRequires: python-simplejson
77 BuildRequires: python-virtualenv >= 1.9.1-4
78 BuildRequires: rpm >= 4.4.9-56
79 BuildRequires: rpmbuild(macros) >= 1.453
80 BuildRequires: sed >= 4.0
81 BuildRequires: sqlite3-devel >= 3.7.15.2
82 BuildRequires: startup-notification-devel >= 0.8
84 %if "%{pld_release}" == "ac"
85 BuildRequires: xcursor-devel
86 BuildRequires: xft-devel >= 2.1-2
88 BuildRequires: xorg-lib-libXScrnSaver-devel
89 BuildRequires: xorg-lib-libXext-devel
90 BuildRequires: xorg-lib-libXinerama-devel
91 BuildRequires: xorg-lib-libXt-devel
94 BuildRequires: zlib-devel >= 1.2.3
95 BuildConflicts: xulrunner-devel < %{epoch}:%{name}-%{version}
96 BuildConflicts: xulrunner-libs < %{epoch}:%{name}-%{version}
97 Requires(post): mktemp >= 1.5-18
98 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
99 Requires: browser-plugins >= 2.0
100 Requires: myspell-common
101 Requires: nspr >= 1:%{nspr_ver}
102 Requires: nss >= 1:%{nss_ver}
103 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
105 %define filterout_cpp -D_FORTIFY_SOURCE=[0-9]+
107 # no Provides from private modules (don't use %{name} here, it expands to each subpackage name...)
108 %define _noautoprovfiles %{_libdir}/xulrunner/components %{_libdir}/xulrunner/plugins
109 # no need to require them (we have strict deps for these)
110 %define _noautoreq libmozjs.so libxul.so libmozalloc.so
113 XULRunner is a Mozilla runtime package that can be used to bootstrap
114 XUL+XPCOM applications that are as rich as Firefox and Thunderbird. It
115 will provide mechanisms for installing, upgrading, and uninstalling
116 these applications. XULRunner will also provide libxul, a solution
117 which allows the embedding of Mozilla technologies in other projects
120 %description -l pl.UTF-8
121 XULRunner to pakiet uruchomieniowy Mozilli, którego można użyć do
122 uruchamiania aplikacji XUL+XPCOM, nawet takich jak Firefox czy
123 Thunderbird. Udostępni mechanizmy do instalowania, uaktualniania i
124 odinstalowywania tych aplikacji. XULRunner będzie także dostarczał
125 libxul - rozwiązanie umożliwiające osadzanie technologii Mozilli w
126 innych projektach i produktach.
129 Summary: XULRunner shared libraries
130 Summary(pl.UTF-8): Biblioteki współdzielone XULRunnera
132 Requires: cairo >= 1.10.2-5
133 Requires: dbus-glib >= 0.60
134 Requires: glib2 >= 1:2.20
135 %{!?with_qt:Requires: gtk+2 >= 2:2.14}
136 Requires: libjpeg-turbo
137 Requires: libpng >= 1.5.13
138 Requires: libpng(APNG) >= 0.10
139 Requires: pango >= 1:1.14.0
140 Requires: sqlite3 >= %{sqlite_build_version}
141 Requires: startup-notification >= 0.8
144 XULRunner shared libraries.
146 %description libs -l pl.UTF-8
147 Biblioteki współdzielone XULRunnera.
150 Summary: Headers for developing programs that will use XULRunner
151 Summary(pl.UTF-8): Pliki nagłówkowe do tworzenia programów używających XULRunnera
152 Group: X11/Development/Libraries
153 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
154 Requires: nspr-devel >= 1:%{nspr_ver}
155 Requires: nss-devel >= 1:%{nss_ver}
157 Obsoletes: mozilla-devel
158 Obsoletes: mozilla-firefox-devel
159 Obsoletes: seamonkey-devel
162 XULRunner development package.
164 %description devel -l pl.UTF-8
165 Pakiet programistyczny XULRunnera.
168 Summary: GNOME support package for XULRunner
169 Summary(pl.UTF-8): Pakiet wspierający integrację XULRunnera z GNOME
171 Requires: %{name} = %{epoch}:%{version}-%{release}
174 GNOME support package for XULRunner. It integrates GConf, GIO,
175 libnotify%{?with_gnomeui: and GNOME UI}.
177 %description gnome -l pl.UTF-8
178 Pakiet wspierający integrację XULRunnera z GNOME. Obejmuje komponenty
179 GConf, GIO, libnotify%{?with_gnomeui: oraz GNOME UI}.
183 mv -f mozilla-release mozilla
186 # avoid using included headers (-I. is before HUNSPELL_CFLAGS)
187 %{__rm} extensions/spellcheck/hunspell/src/{*.hxx,hunspell.h}
188 # hunspell needed for factory including mozHunspell.h
189 echo 'LOCAL_INCLUDES += $(MOZ_HUNSPELL_CFLAGS)' >> extensions/spellcheck/src/Makefile.in
200 # config/rules.mk is patched by us and js/src/config/rules.mk
201 # is supposed to be exact copy
202 cp -a config/rules.mk js/src/config/rules.mk
205 if [ "$(grep -E '^[0-9]+\.' mozilla/config/milestone.txt)" != "%{version}" ]; then
207 echo >&2 "Version %{version} does not match mozilla/config/milestone.txt!"
213 cp -p %{_datadir}/automake/config.* build/autoconf
215 cat << 'EOF' > .mozconfig
216 . $topsrcdir/xulrunner/config/mozconfig
218 mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-%{_target_cpu}
220 # Options for 'configure' (same as command-line options).
221 ac_add_options --build=%{_target_platform}
222 ac_add_options --host=%{_target_platform}
223 ac_add_options --prefix=%{_prefix}
224 ac_add_options --exec-prefix=%{_exec_prefix}
225 ac_add_options --bindir=%{_bindir}
226 ac_add_options --sbindir=%{_sbindir}
227 ac_add_options --sysconfdir=%{_sysconfdir}
228 ac_add_options --datadir=%{_datadir}
229 ac_add_options --includedir=%{_includedir}
230 ac_add_options --libdir=%{_libdir}
231 ac_add_options --libexecdir=%{_libexecdir}
232 ac_add_options --localstatedir=%{_localstatedir}
233 ac_add_options --sharedstatedir=%{_sharedstatedir}
234 ac_add_options --mandir=%{_mandir}
235 ac_add_options --infodir=%{_infodir}
237 ac_add_options --disable-optimize
238 ac_add_options --enable-debug
239 ac_add_options --enable-debug-modules
240 ac_add_options --enable-debugger-info-modules
241 ac_add_options --enable-crash-on-assert
243 ac_add_options --disable-debug
244 ac_add_options --disable-debug-modules
245 ac_add_options --disable-logging
246 ac_add_options --enable-optimize="%{rpmcflags} -Os"
248 ac_add_options --disable-strip
249 ac_add_options --disable-strip-libs
251 ac_add_options --enable-tests
253 ac_add_options --disable-tests
256 ac_add_options --enable-gnomeui
258 ac_add_options --disable-gnomeui
260 ac_add_options --disable-gnomevfs
261 ac_add_options --disable-crashreporter
262 ac_add_options --disable-installer
263 ac_add_options --disable-javaxpcom
264 ac_add_options --disable-updater
266 ac_add_options --enable-default-toolkit=cairo-qt
268 ac_add_options --enable-default-toolkit=cairo-gtk2
270 ac_add_options --enable-gio
271 ac_add_options --enable-libxul
272 ac_add_options --enable-pango
273 ac_add_options --enable-shared-js
274 ac_add_options --enable-startup-notification
275 ac_add_options --enable-system-cairo
276 ac_add_options --enable-system-ffi
277 ac_add_options --enable-system-hunspell
278 ac_add_options --enable-system-sqlite
279 ac_add_options --with-distribution-id=org.pld-linux
280 ac_add_options --with-pthreads
281 ac_add_options --with-system-bz2
282 ac_add_options --with-system-jpeg
283 ac_add_options --with-system-libevent
284 ac_add_options --with-system-libvpx
285 ac_add_options --with-system-nspr
286 ac_add_options --with-system-nss
287 ac_add_options --with-system-png
288 ac_add_options --with-system-zlib
289 ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
290 ac_add_options --disable-pedantic
291 ac_add_options --disable-xterm-updates
292 ac_add_options --enable-extensions="default,cookie,permissions,spellcheck"
293 ac_add_options --with-x
296 %{__make} -j1 -f client.mk build \
301 rm -rf $RPM_BUILD_ROOT
302 install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins \
303 $RPM_BUILD_ROOT%{_datadir}/%{name}/components \
304 $RPM_BUILD_ROOT%{_bindir} \
305 $RPM_BUILD_ROOT%{_libdir}/%{name}-devel/sdk/{lib,bin} \
306 $RPM_BUILD_ROOT%{_includedir}/%{name} \
307 $RPM_BUILD_ROOT%{_datadir}/idl/%{name} \
308 $RPM_BUILD_ROOT%{_pkgconfigdir}
310 cd mozilla/obj-%{_target_cpu}
311 %{__make} -C xulrunner/installer stage-package libxul.pc libxul-embedding.pc mozilla-js.pc mozilla-plugin.pc\
312 DESTDIR=$RPM_BUILD_ROOT \
313 installdir=%{_libdir}/%{name} \
317 cp -aL xulrunner/installer/*.pc $RPM_BUILD_ROOT%{_pkgconfigdir}
318 cp -aL dist/xulrunner/* $RPM_BUILD_ROOT%{_libdir}/%{name}
319 cp -aL dist/include/* $RPM_BUILD_ROOT%{_includedir}/%{name}
320 cp -aL dist/include/xpcom-config.h $RPM_BUILD_ROOT%{_libdir}/%{name}-devel
321 cp -aL dist/idl/* $RPM_BUILD_ROOT%{_datadir}/idl/%{name}
322 cp -aL dist/sdk/lib/* $RPM_BUILD_ROOT%{_libdir}/%{name}-devel/sdk/lib
323 cp -aL dist/sdk/bin/* $RPM_BUILD_ROOT%{_libdir}/%{name}-devel/sdk/bin
324 find $RPM_BUILD_ROOT%{_libdir}/%{name}-devel/sdk -name "*.pyc" | xargs rm -f
326 ln -s %{_libdir}/%{name} $RPM_BUILD_ROOT%{_libdir}/%{name}-devel/bin
327 ln -s %{_includedir}/%{name} $RPM_BUILD_ROOT%{_libdir}/%{name}-devel/include
328 ln -s %{_datadir}/idl/%{name} $RPM_BUILD_ROOT%{_libdir}/%{name}-devel/idl
329 ln -s %{_libdir}/%{name}-devel/sdk/lib $RPM_BUILD_ROOT%{_libdir}/%{name}-devel/lib
331 # replace copies with symlinks
332 ln -sf %{_libdir}/%{name}/libmozjs.so $RPM_BUILD_ROOT%{_libdir}/%{name}-devel/sdk/lib/libmozjs.so
333 ln -sf %{_libdir}/%{name}/libxul.so $RPM_BUILD_ROOT%{_libdir}/%{name}-devel/sdk/lib/libxul.so
334 ln -sf %{_libdir}/%{name}/libmozalloc.so $RPM_BUILD_ROOT%{_libdir}/%{name}-devel/sdk/lib/libmozalloc.so
335 # temp fix for https://bugzilla.mozilla.org/show_bug.cgi?id=63955
336 chmod a+rx $RPM_BUILD_ROOT%{_libdir}/%{name}-devel/sdk/bin/xpt.py
338 ln -sf %{_libdir}/%{name}/xulrunner $RPM_BUILD_ROOT%{_bindir}/xulrunner
340 # move arch independant ones to datadir
341 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome $RPM_BUILD_ROOT%{_datadir}/%{name}/chrome
342 ln -s ../../share/%{name}/chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome
343 %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
344 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
346 # files created by regxpcom
347 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/compreg.dat
348 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/xpti.dat
350 # Install xpcshell and run-mozilla.sh
351 %{__cp} -pL dist/bin/xpcshell $RPM_BUILD_ROOT%{_libdir}/%{name}
352 %{__cp} -pL dist/bin/run-mozilla.sh $RPM_BUILD_ROOT%{_libdir}/%{name}
354 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins
356 # remove unecessary stuff
357 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/LICENSE
360 rm -rf $RPM_BUILD_ROOT
363 %update_browser_plugins
366 if [ "$1" = 0 ]; then
367 %update_browser_plugins
370 %post libs -p /sbin/ldconfig
371 %postun libs -p /sbin/ldconfig
374 %defattr(644,root,root,755)
375 %attr(755,root,root) %{_bindir}/xulrunner
376 %attr(755,root,root) %{_libdir}/%{name}/xulrunner
379 %{_libdir}/%{name}/chrome
380 %{_libdir}/%{name}/dictionaries
382 %{_browserpluginsconfdir}/browsers.d/%{name}.*
383 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
385 %dir %{_libdir}/%{name}/plugins
386 %dir %{_libdir}/%{name}/components
388 %{_libdir}/%{name}/chrome.manifest
390 %attr(755,root,root) %{_libdir}/%{name}/*.sh
391 %attr(755,root,root) %{_libdir}/%{name}/mozilla-xremote-client
392 %attr(755,root,root) %{_libdir}/%{name}/plugin-container
394 %attr(755,root,root) %{_libdir}/%{name}/components/libdbusservice.so
395 %{_libdir}/%{name}/components/components.manifest
397 # do not use *.dat here, so check-files can catch any new files
398 # (and they won't be just silently placed empty in rpm)
399 %ghost %{_libdir}/%{name}/components/compreg.dat
400 %ghost %{_libdir}/%{name}/components/xpti.dat
402 %dir %{_datadir}/%{name}
403 %{_datadir}/%{name}/chrome
406 %defattr(644,root,root,755)
407 %dir %{_libdir}/%{name}
408 %{_libdir}/%{name}/platform.ini
409 %attr(755,root,root) %{_libdir}/%{name}/libmozalloc.so
410 %attr(755,root,root) %{_libdir}/%{name}/libmozjs.so
411 %attr(755,root,root) %{_libdir}/%{name}/libxul.so
412 %{_libdir}/%{name}/dependentlibs.list
413 %{_libdir}/%{name}/omni.ja
416 %defattr(644,root,root,755)
417 %attr(755,root,root) %{_libdir}/%{name}/xpcshell
418 %attr(755,root,root) %{_libdir}/%{name}/xulrunner-stub
419 %{_includedir}/%{name}
420 %{_datadir}/idl/%{name}
421 %dir %{_libdir}/%{name}-devel
422 %{_libdir}/%{name}-devel/bin
423 %{_libdir}/%{name}-devel/idl
424 %{_libdir}/%{name}-devel/lib
425 %{_libdir}/%{name}-devel/include
426 %{_libdir}/%{name}-devel/*.h
427 %dir %{_libdir}/%{name}-devel/sdk
428 %{_libdir}/%{name}-devel/sdk/lib
429 %dir %{_libdir}/%{name}-devel/sdk/bin
430 %attr(755,root,root) %{_libdir}/%{name}-devel/sdk/bin/*
431 %{_pkgconfigdir}/libxul.pc
432 %{_pkgconfigdir}/libxul-embedding.pc
433 %{_pkgconfigdir}/mozilla-js.pc
434 %{_pkgconfigdir}/mozilla-plugin.pc
438 %defattr(644,root,root,755)
439 %attr(755,root,root) %{_libdir}/%{name}/components/libmozgnome.so