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)
21 %define nss_ver 3.13.3
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: 78e641c67dc4a40cb3f48fce3e782d41
35 Patch0: %{name}-install.patch
36 Patch1: %{name}-rpath.patch
37 Patch4: %{name}-paths.patch
38 Patch5: %{name}-pc.patch
39 Patch6: %{name}-prefs.patch
40 Patch7: system-cairo.patch
41 Patch11: idl-parser.patch
42 # Edit patch below and restore --system-site-packages when system virtualenv gets 1.7 upgrade
43 Patch12: system-virtualenv.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.18
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 BuildRequires: libjpeg-devel >= 6b
63 %{!?with_qt:BuildRequires: libnotify-devel >= 0.4}
64 BuildRequires: libpng(APNG)-devel >= 0.10
65 BuildRequires: libpng-devel >= 1.5.9
66 BuildRequires: libstdc++-devel
67 BuildRequires: libvpx-devel >= 1.0.0
68 BuildRequires: nspr-devel >= 1:%{nspr_ver}
69 BuildRequires: nss-devel >= 1:%{nss_ver}
70 BuildRequires: pango-devel >= 1:1.14.0
71 BuildRequires: pkgconfig
72 BuildRequires: pkgconfig(libffi) >= 3.0.9
73 BuildRequires: python >= 1:2.5
74 BuildRequires: python-virtualenv
75 BuildRequires: rpm >= 4.4.9-56
76 BuildRequires: rpmbuild(macros) >= 1.453
77 BuildRequires: sed >= 4.0
78 BuildRequires: sqlite3-devel >= 3.7.10
79 BuildRequires: startup-notification-devel >= 0.8
81 %if "%{pld_release}" == "ac"
82 BuildRequires: xcursor-devel
83 BuildRequires: xft-devel >= 2.1-2
85 BuildRequires: xorg-lib-libXScrnSaver-devel
86 BuildRequires: xorg-lib-libXext-devel
87 BuildRequires: xorg-lib-libXinerama-devel
88 BuildRequires: xorg-lib-libXt-devel
91 BuildRequires: zlib-devel >= 1.2.3
92 BuildConflicts: xulrunner-devel < %{epoch}:%{name}-%{version}
93 Requires(post): mktemp >= 1.5-18
94 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
95 Requires: browser-plugins >= 2.0
96 Requires: myspell-common
97 Requires: nspr >= 1:%{nspr_ver}
98 Requires: nss >= 1:%{nss_ver}
99 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
101 %define filterout_cpp -D_FORTIFY_SOURCE=[0-9]+
103 # no Provides from private modules (don't use %{name} here, it expands to each subpackage name...)
104 %define _noautoprovfiles %{_libdir}/xulrunner/components %{_libdir}/xulrunner/plugins
105 # no need to require them (we have strict deps for these)
106 %define _noautoreq libmozjs.so libxpcom.so libxul.so libmozalloc.so
109 XULRunner is a Mozilla runtime package that can be used to bootstrap
110 XUL+XPCOM applications that are as rich as Firefox and Thunderbird. It
111 will provide mechanisms for installing, upgrading, and uninstalling
112 these applications. XULRunner will also provide libxul, a solution
113 which allows the embedding of Mozilla technologies in other projects
116 %description -l pl.UTF-8
117 XULRunner to pakiet uruchomieniowy Mozilli, którego można użyć do
118 uruchamiania aplikacji XUL+XPCOM, nawet takich jak Firefox czy
119 Thunderbird. Udostępni mechanizmy do instalowania, uaktualniania i
120 odinstalowywania tych aplikacji. XULRunner będzie także dostarczał
121 libxul - rozwiązanie umożliwiające osadzanie technologii Mozilli w
122 innych projektach i produktach.
125 Summary: XULRunner shared libraries
126 Summary(pl.UTF-8): Biblioteki współdzielone XULRunnera
128 Requires: cairo >= 1.10.2-5
129 Requires: dbus-glib >= 0.60
130 Requires: glib2 >= 1:2.18
131 %{!?with_qt:Requires: gtk+2 >= 2:2.14}
132 Requires: libpng >= 1.4.1
133 Requires: libpng(APNG) >= 0.10
134 Requires: pango >= 1:1.14.0
135 Requires: sqlite3 >= %{sqlite_build_version}
136 Requires: startup-notification >= 0.8
139 XULRunner shared libraries.
141 %description libs -l pl.UTF-8
142 Biblioteki współdzielone XULRunnera.
145 Summary: Headers for developing programs that will use XULRunner
146 Summary(pl.UTF-8): Pliki nagłówkowe do tworzenia programów używających XULRunnera
147 Group: X11/Development/Libraries
148 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
149 Requires: nspr-devel >= 1:%{nspr_ver}
150 Requires: nss-devel >= 1:%{nss_ver}
152 Obsoletes: mozilla-devel
153 Obsoletes: mozilla-firefox-devel
154 Obsoletes: seamonkey-devel
157 XULRunner development package.
159 %description devel -l pl.UTF-8
160 Pakiet programistyczny XULRunnera.
163 Summary: GNOME support package for XULRunner
164 Summary(pl.UTF-8): Pakiet wspierający integrację XULRunnera z GNOME
166 Requires: %{name} = %{epoch}:%{version}-%{release}
169 GNOME support package for XULRunner. It integrates GConf, GIO,
170 libnotify%{?with_gnomeui: and GNOME UI}.
172 %description gnome -l pl.UTF-8
173 Pakiet wspierający integrację XULRunnera z GNOME. Obejmuje komponenty
174 GConf, GIO, libnotify%{?with_gnomeui: oraz GNOME UI}.
178 mv -f mozilla-release mozilla
181 # avoid using included headers (-I. is before HUNSPELL_CFLAGS)
182 %{__rm} extensions/spellcheck/hunspell/src/{*.hxx,hunspell.h}
183 # hunspell needed for factory including mozHunspell.h
184 echo 'LOCAL_INCLUDES += $(MOZ_HUNSPELL_CFLAGS)' >> extensions/spellcheck/src/Makefile.in
195 # config/rules.mk is patched by us and js/src/config/rules.mk
196 # is supposed to be exact copy
197 cp -a config/rules.mk js/src/config/rules.mk
200 if [ "$(grep -E '^[0-9]+\.' mozilla/config/milestone.txt)" != "%{version}" ]; then
202 echo >&2 "Version %{version} does not match mozilla/config/milestone.txt!"
208 cp -p %{_datadir}/automake/config.* build/autoconf
210 cat << 'EOF' > .mozconfig
211 . $topsrcdir/xulrunner/config/mozconfig
213 mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-%{_target_cpu}
215 # Options for 'configure' (same as command-line options).
216 ac_add_options --build=%{_target_platform}
217 ac_add_options --host=%{_target_platform}
218 ac_add_options --prefix=%{_prefix}
219 ac_add_options --exec-prefix=%{_exec_prefix}
220 ac_add_options --bindir=%{_bindir}
221 ac_add_options --sbindir=%{_sbindir}
222 ac_add_options --sysconfdir=%{_sysconfdir}
223 ac_add_options --datadir=%{_datadir}
224 ac_add_options --includedir=%{_includedir}
225 ac_add_options --libdir=%{_libdir}
226 ac_add_options --libexecdir=%{_libexecdir}
227 ac_add_options --localstatedir=%{_localstatedir}
228 ac_add_options --sharedstatedir=%{_sharedstatedir}
229 ac_add_options --mandir=%{_mandir}
230 ac_add_options --infodir=%{_infodir}
232 ac_add_options --disable-optimize
233 ac_add_options --enable-debug
234 ac_add_options --enable-debug-modules
235 ac_add_options --enable-debugger-info-modules
236 ac_add_options --enable-crash-on-assert
238 ac_add_options --disable-debug
239 ac_add_options --disable-debug-modules
240 ac_add_options --disable-logging
241 ac_add_options --enable-optimize="%{rpmcflags} -Os"
243 ac_add_options --disable-strip
244 ac_add_options --disable-strip-libs
246 ac_add_options --enable-tests
248 ac_add_options --disable-tests
251 ac_add_options --enable-gnomeui
253 ac_add_options --disable-gnomeui
255 ac_add_options --disable-gnomevfs
256 ac_add_options --disable-crashreporter
257 ac_add_options --disable-installer
258 ac_add_options --disable-javaxpcom
259 ac_add_options --disable-updater
261 ac_add_options --enable-default-toolkit=cairo-qt
263 ac_add_options --enable-default-toolkit=cairo-gtk2
265 ac_add_options --enable-gio
266 ac_add_options --enable-libxul
267 ac_add_options --enable-pango
268 ac_add_options --enable-shared-js
269 ac_add_options --enable-startup-notification
270 ac_add_options --enable-system-cairo
271 ac_add_options --enable-system-ffi
272 ac_add_options --enable-system-hunspell
273 ac_add_options --enable-system-sqlite
274 ac_add_options --with-distribution-id=org.pld-linux
275 ac_add_options --with-pthreads
276 ac_add_options --with-system-bz2
277 ac_add_options --with-system-jpeg
278 ac_add_options --with-system-libevent
279 ac_add_options --with-system-libvpx
280 ac_add_options --with-system-nspr
281 ac_add_options --with-system-nss
282 ac_add_options --with-system-png
283 ac_add_options --with-system-zlib
284 ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
285 ac_add_options --disable-pedantic
286 ac_add_options --disable-xterm-updates
287 ac_add_options --enable-extensions="default,cookie,permissions,spellcheck"
288 ac_add_options --with-x
291 %{__make} -j1 -f client.mk build \
296 rm -rf $RPM_BUILD_ROOT
299 # work around broken build system
300 touch obj-%{_target_cpu}/dist/sdk/empty.pyc
302 %{__make} -C obj-%{_target_cpu}/xulrunner/installer install \
303 DESTDIR=$RPM_BUILD_ROOT \
304 MOZ_PKG_APPDIR=%{_libdir}/%{name} \
308 # fix for halfway done xulrunner-bin -> xulrunner rename
309 ln -sf %{_libdir}/%{name}/xulrunner $RPM_BUILD_ROOT%{_bindir}/xulrunner
312 $RPM_BUILD_ROOT%{_datadir}/%{name}/components \
313 $RPM_BUILD_ROOT%{_sbindir}
315 # move arch independant ones to datadir
316 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome $RPM_BUILD_ROOT%{_datadir}/%{name}/chrome
317 ln -s ../../share/%{name}/chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome
318 %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
319 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
321 # files created by regxpcom
322 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/compreg.dat
323 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/xpti.dat
325 %{__make} -C obj-%{_target_cpu}/build/unix install \
326 DESTDIR=$RPM_BUILD_ROOT
328 # Install xpcshell and run-mozilla.sh
329 %{__cp} -pL obj-%{_target_cpu}/dist/bin/xpcshell $RPM_BUILD_ROOT/%{_libdir}/%{name}
330 %{__cp} -pL obj-%{_target_cpu}/dist/bin/run-mozilla.sh $RPM_BUILD_ROOT/%{_libdir}/%{name}
332 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins
334 # remove unecessary stuff
335 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/LICENSE
336 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list
339 rm -rf $RPM_BUILD_ROOT
342 %update_browser_plugins
345 if [ "$1" = 0 ]; then
346 %update_browser_plugins
349 %post libs -p /sbin/ldconfig
350 %postun libs -p /sbin/ldconfig
353 %defattr(644,root,root,755)
354 %attr(755,root,root) %{_bindir}/xulrunner
355 %attr(755,root,root) %{_libdir}/%{name}/xulrunner
358 %{_libdir}/%{name}/chrome
359 %{_libdir}/%{name}/dictionaries
361 %{_browserpluginsconfdir}/browsers.d/%{name}.*
362 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
364 %dir %{_libdir}/%{name}/plugins
365 %dir %{_libdir}/%{name}/components
367 %{_libdir}/%{name}/chrome.manifest
368 %{_libdir}/%{name}/omni.ja
370 %attr(755,root,root) %{_libdir}/%{name}/*.sh
371 %attr(755,root,root) %{_libdir}/%{name}/mozilla-xremote-client
372 %attr(755,root,root) %{_libdir}/%{name}/plugin-container
374 %attr(755,root,root) %{_libdir}/%{name}/components/libdbusservice.so
375 %{_libdir}/%{name}/components/binary.manifest
377 # do not use *.dat here, so check-files can catch any new files
378 # (and they won't be just silently placed empty in rpm)
379 %ghost %{_libdir}/%{name}/components/compreg.dat
380 %ghost %{_libdir}/%{name}/components/xpti.dat
382 %dir %{_datadir}/%{name}
383 %{_datadir}/%{name}/chrome
386 %defattr(644,root,root,755)
387 %dir %{_libdir}/%{name}
388 %{_libdir}/%{name}/platform.ini
389 %attr(755,root,root) %{_libdir}/%{name}/libmozalloc.so
390 %attr(755,root,root) %{_libdir}/%{name}/libmozjs.so
391 %attr(755,root,root) %{_libdir}/%{name}/libxpcom.so
392 %attr(755,root,root) %{_libdir}/%{name}/libxul.so
395 %defattr(644,root,root,755)
396 %attr(755,root,root) %{_libdir}/%{name}/xpcshell
397 %attr(755,root,root) %{_libdir}/%{name}/xulrunner-stub
398 %{_includedir}/%{name}
399 %{_datadir}/idl/%{name}
400 %dir %{_libdir}/%{name}-devel
401 %{_libdir}/%{name}-devel/bin
402 %{_libdir}/%{name}-devel/idl
403 %{_libdir}/%{name}-devel/lib
404 %{_libdir}/%{name}-devel/include
405 %{_libdir}/%{name}-devel/*.h
406 %dir %{_libdir}/%{name}-devel/sdk
407 %{_libdir}/%{name}-devel/sdk/lib
408 %dir %{_libdir}/%{name}-devel/sdk/bin
409 %attr(755,root,root) %{_libdir}/%{name}-devel/sdk/bin/*
410 %{_pkgconfigdir}/libxul.pc
411 %{_pkgconfigdir}/libxul-embedding.pc
412 %{_pkgconfigdir}/mozilla-js.pc
413 %{_pkgconfigdir}/mozilla-plugin.pc
417 %defattr(644,root,root,755)
418 %attr(755,root,root) %{_libdir}/%{name}/components/libmozgnome.so