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 # http://pkgs.fedoraproject.org/gitweb/?p=xulrunner.git;a=tree
42 Patch9: %{name}-gtkmozembed.patch
43 Patch11: idl-parser.patch
44 # Edit patch below and restore --system-site-packages when system virtualenv gets 1.7 upgrade
45 Patch12: system-virtualenv.patch
46 URL: https://developer.mozilla.org/en/XULRunner
47 %{!?with_qt:BuildRequires: GConf2-devel >= 1.2.1}
48 BuildRequires: alsa-lib-devel
49 BuildRequires: automake
50 BuildRequires: bzip2-devel
51 BuildRequires: cairo-devel >= 1.10.2-5
52 BuildRequires: dbus-glib-devel >= 0.60
53 BuildRequires: freetype-devel >= 1:2.1.8
54 BuildRequires: glib2-devel >= 1:2.18
55 %{!?with_qt:BuildRequires: gtk+2-devel >= 2:2.14}
56 BuildRequires: hunspell-devel >= 1.2.3
57 BuildRequires: libIDL-devel >= 0.8.0
58 BuildRequires: libdnet-devel
59 BuildRequires: libevent-devel >= 1.4.7
60 # standalone libffi 3.0.9 or gcc's from 4.5(?)+
61 BuildRequires: libffi-devel >= 6:3.0.9
62 %{?with_gnomeui:BuildRequires: libgnomeui-devel >= 2.2.0}
63 BuildRequires: libiw-devel
64 BuildRequires: libjpeg-devel >= 6b
65 %{!?with_qt:BuildRequires: libnotify-devel >= 0.4}
66 BuildRequires: libpng(APNG)-devel >= 0.10
67 BuildRequires: libpng-devel >= 1.5.9
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-virtualenv
77 BuildRequires: rpm >= 4.4.9-56
78 BuildRequires: rpmbuild(macros) >= 1.453
79 BuildRequires: sed >= 4.0
80 BuildRequires: sqlite3-devel >= 3.7.10
81 BuildRequires: startup-notification-devel >= 0.8
83 %if "%{pld_release}" == "ac"
84 BuildRequires: xcursor-devel
85 BuildRequires: xft-devel >= 2.1-2
87 BuildRequires: xorg-lib-libXScrnSaver-devel
88 BuildRequires: xorg-lib-libXext-devel
89 BuildRequires: xorg-lib-libXinerama-devel
90 BuildRequires: xorg-lib-libXt-devel
93 BuildRequires: zlib-devel >= 1.2.3
94 BuildConflicts: xulrunner-devel < %{epoch}:%{name}-%{version}
95 Requires(post): mktemp >= 1.5-18
96 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
97 Requires: browser-plugins >= 2.0
98 Requires: myspell-common
99 Requires: nspr >= 1:%{nspr_ver}
100 Requires: nss >= 1:%{nss_ver}
101 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
103 %define filterout_cpp -D_FORTIFY_SOURCE=[0-9]+
105 # no Provides from private modules (don't use %{name} here, it expands to each subpackage name...)
106 %define _noautoprovfiles %{_libdir}/xulrunner/components %{_libdir}/xulrunner/plugins
107 # no need to require them (we have strict deps for these)
108 %define _noautoreq libmozjs.so libxpcom.so libxul.so libmozalloc.so
111 XULRunner is a Mozilla runtime package that can be used to bootstrap
112 XUL+XPCOM applications that are as rich as Firefox and Thunderbird. It
113 will provide mechanisms for installing, upgrading, and uninstalling
114 these applications. XULRunner will also provide libxul, a solution
115 which allows the embedding of Mozilla technologies in other projects
118 %description -l pl.UTF-8
119 XULRunner to pakiet uruchomieniowy Mozilli, którego można użyć do
120 uruchamiania aplikacji XUL+XPCOM, nawet takich jak Firefox czy
121 Thunderbird. Udostępni mechanizmy do instalowania, uaktualniania i
122 odinstalowywania tych aplikacji. XULRunner będzie także dostarczał
123 libxul - rozwiązanie umożliwiające osadzanie technologii Mozilli w
124 innych projektach i produktach.
127 Summary: XULRunner shared libraries
128 Summary(pl.UTF-8): Biblioteki współdzielone XULRunnera
130 Requires: cairo >= 1.10.2-5
131 Requires: dbus-glib >= 0.60
132 Requires: glib2 >= 1:2.18
133 %{!?with_qt:Requires: gtk+2 >= 2:2.14}
134 Requires: libpng >= 1.4.1
135 Requires: libpng(APNG) >= 0.10
136 Requires: pango >= 1:1.14.0
137 Requires: sqlite3 >= %{sqlite_build_version}
138 Requires: startup-notification >= 0.8
141 XULRunner shared libraries.
143 %description libs -l pl.UTF-8
144 Biblioteki współdzielone XULRunnera.
147 Summary: Headers for developing programs that will use XULRunner
148 Summary(pl.UTF-8): Pliki nagłówkowe do tworzenia programów używających XULRunnera
149 Group: X11/Development/Libraries
150 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
151 Requires: nspr-devel >= 1:%{nspr_ver}
152 Requires: nss-devel >= 1:%{nss_ver}
154 Obsoletes: mozilla-devel
155 Obsoletes: mozilla-firefox-devel
156 Obsoletes: seamonkey-devel
159 XULRunner development package.
161 %description devel -l pl.UTF-8
162 Pakiet programistyczny XULRunnera.
165 Summary: GNOME support package for XULRunner
166 Summary(pl.UTF-8): Pakiet wspierający integrację XULRunnera z GNOME
168 Requires: %{name} = %{epoch}:%{version}-%{release}
171 GNOME support package for XULRunner. It integrates GConf, GIO,
172 libnotify%{?with_gnomeui: and GNOME UI}.
174 %description gnome -l pl.UTF-8
175 Pakiet wspierający integrację XULRunnera z GNOME. Obejmuje komponenty
176 GConf, GIO, libnotify%{?with_gnomeui: oraz GNOME UI}.
180 mv -f mozilla-release mozilla
183 # avoid using included headers (-I. is before HUNSPELL_CFLAGS)
184 %{__rm} extensions/spellcheck/hunspell/src/{*.hxx,hunspell.h}
185 # hunspell needed for factory including mozHunspell.h
186 echo 'LOCAL_INCLUDES += $(MOZ_HUNSPELL_CFLAGS)' >> extensions/spellcheck/src/Makefile.in
198 # config/rules.mk is patched by us and js/src/config/rules.mk
199 # is supposed to be exact copy
200 cp -a config/rules.mk js/src/config/rules.mk
203 if [ "$(grep -E '^[0-9]+\.' mozilla/config/milestone.txt)" != "%{version}" ]; then
205 echo >&2 "Version %{version} does not match mozilla/config/milestone.txt!"
211 cp -p %{_datadir}/automake/config.* build/autoconf
213 cat << 'EOF' > .mozconfig
214 . $topsrcdir/xulrunner/config/mozconfig
216 mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-%{_target_cpu}
218 # Options for 'configure' (same as command-line options).
219 ac_add_options --build=%{_target_platform}
220 ac_add_options --host=%{_target_platform}
221 ac_add_options --prefix=%{_prefix}
222 ac_add_options --exec-prefix=%{_exec_prefix}
223 ac_add_options --bindir=%{_bindir}
224 ac_add_options --sbindir=%{_sbindir}
225 ac_add_options --sysconfdir=%{_sysconfdir}
226 ac_add_options --datadir=%{_datadir}
227 ac_add_options --includedir=%{_includedir}
228 ac_add_options --libdir=%{_libdir}
229 ac_add_options --libexecdir=%{_libexecdir}
230 ac_add_options --localstatedir=%{_localstatedir}
231 ac_add_options --sharedstatedir=%{_sharedstatedir}
232 ac_add_options --mandir=%{_mandir}
233 ac_add_options --infodir=%{_infodir}
235 ac_add_options --disable-optimize
236 ac_add_options --enable-debug
237 ac_add_options --enable-debug-modules
238 ac_add_options --enable-debugger-info-modules
239 ac_add_options --enable-crash-on-assert
241 ac_add_options --disable-debug
242 ac_add_options --disable-debug-modules
243 ac_add_options --disable-logging
244 ac_add_options --enable-optimize="%{rpmcflags} -Os"
246 ac_add_options --disable-strip
247 ac_add_options --disable-strip-libs
249 ac_add_options --enable-tests
251 ac_add_options --disable-tests
254 ac_add_options --enable-gnomeui
256 ac_add_options --disable-gnomeui
258 ac_add_options --disable-gnomevfs
259 ac_add_options --disable-crashreporter
260 ac_add_options --disable-installer
261 ac_add_options --disable-javaxpcom
262 ac_add_options --disable-updater
264 ac_add_options --enable-default-toolkit=cairo-qt
266 ac_add_options --enable-default-toolkit=cairo-gtk2
268 ac_add_options --enable-gio
269 ac_add_options --enable-libxul
270 ac_add_options --enable-pango
271 ac_add_options --enable-shared-js
272 ac_add_options --enable-startup-notification
273 ac_add_options --enable-system-cairo
274 ac_add_options --enable-system-ffi
275 ac_add_options --enable-system-hunspell
276 ac_add_options --enable-system-sqlite
277 ac_add_options --with-distribution-id=org.pld-linux
278 ac_add_options --with-pthreads
279 ac_add_options --with-system-bz2
280 ac_add_options --with-system-jpeg
281 ac_add_options --with-system-libevent
282 ac_add_options --with-system-libvpx
283 ac_add_options --with-system-nspr
284 ac_add_options --with-system-nss
285 ac_add_options --with-system-png
286 ac_add_options --with-system-zlib
287 ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
288 ac_add_options --disable-pedantic
289 ac_add_options --disable-xterm-updates
290 ac_add_options --enable-extensions="default,cookie,permissions,spellcheck"
291 ac_add_options --with-x
294 %{__make} -j1 -f client.mk build \
299 rm -rf $RPM_BUILD_ROOT
302 # work around broken build system
303 touch obj-%{_target_cpu}/dist/sdk/empty.pyc
305 %{__make} -C obj-%{_target_cpu}/xulrunner/installer install \
306 DESTDIR=$RPM_BUILD_ROOT \
307 MOZ_PKG_APPDIR=%{_libdir}/%{name} \
311 # fix for halfway done xulrunner-bin -> xulrunner rename
312 ln -sf %{_libdir}/%{name}/xulrunner $RPM_BUILD_ROOT%{_bindir}/xulrunner
315 $RPM_BUILD_ROOT%{_datadir}/%{name}/components \
316 $RPM_BUILD_ROOT%{_sbindir}
318 # move arch independant ones to datadir
319 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome $RPM_BUILD_ROOT%{_datadir}/%{name}/chrome
320 ln -s ../../share/%{name}/chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome
321 %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
322 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
324 # files created by regxpcom
325 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/compreg.dat
326 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/xpti.dat
328 %{__make} -C obj-%{_target_cpu}/build/unix install \
329 DESTDIR=$RPM_BUILD_ROOT
331 # Install xpcshell and run-mozilla.sh
332 %{__cp} -pL obj-%{_target_cpu}/dist/bin/xpcshell $RPM_BUILD_ROOT/%{_libdir}/%{name}
333 %{__cp} -pL obj-%{_target_cpu}/dist/bin/run-mozilla.sh $RPM_BUILD_ROOT/%{_libdir}/%{name}
335 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins
337 # remove unecessary stuff
338 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/LICENSE
339 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list
342 rm -rf $RPM_BUILD_ROOT
345 %update_browser_plugins
348 if [ "$1" = 0 ]; then
349 %update_browser_plugins
352 %post libs -p /sbin/ldconfig
353 %postun libs -p /sbin/ldconfig
356 %defattr(644,root,root,755)
357 %attr(755,root,root) %{_bindir}/xulrunner
358 %attr(755,root,root) %{_libdir}/%{name}/xulrunner
361 %{_libdir}/%{name}/chrome
362 %{_libdir}/%{name}/dictionaries
364 %{_browserpluginsconfdir}/browsers.d/%{name}.*
365 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
367 %dir %{_libdir}/%{name}/plugins
368 %dir %{_libdir}/%{name}/components
370 %{_libdir}/%{name}/chrome.manifest
371 %{_libdir}/%{name}/omni.ja
373 %attr(755,root,root) %{_libdir}/%{name}/*.sh
374 %attr(755,root,root) %{_libdir}/%{name}/mozilla-xremote-client
375 %attr(755,root,root) %{_libdir}/%{name}/plugin-container
377 %attr(755,root,root) %{_libdir}/%{name}/components/libdbusservice.so
378 %{_libdir}/%{name}/components/binary.manifest
380 # do not use *.dat here, so check-files can catch any new files
381 # (and they won't be just silently placed empty in rpm)
382 %ghost %{_libdir}/%{name}/components/compreg.dat
383 %ghost %{_libdir}/%{name}/components/xpti.dat
385 %dir %{_datadir}/%{name}
386 %{_datadir}/%{name}/chrome
389 %defattr(644,root,root,755)
390 %dir %{_libdir}/%{name}
391 %{_libdir}/%{name}/platform.ini
392 %attr(755,root,root) %{_libdir}/%{name}/libmozalloc.so
393 %attr(755,root,root) %{_libdir}/%{name}/libmozjs.so
394 %attr(755,root,root) %{_libdir}/%{name}/libxpcom.so
395 %attr(755,root,root) %{_libdir}/%{name}/libxul.so
398 %defattr(644,root,root,755)
399 %attr(755,root,root) %{_libdir}/%{name}/xpcshell
400 %attr(755,root,root) %{_libdir}/%{name}/xulrunner-stub
401 %{_includedir}/%{name}
402 %{_datadir}/idl/%{name}
403 %dir %{_libdir}/%{name}-devel
404 %{_libdir}/%{name}-devel/bin
405 %{_libdir}/%{name}-devel/idl
406 %{_libdir}/%{name}-devel/lib
407 %{_libdir}/%{name}-devel/include
408 %{_libdir}/%{name}-devel/*.h
409 %dir %{_libdir}/%{name}-devel/sdk
410 %{_libdir}/%{name}-devel/sdk/lib
411 %dir %{_libdir}/%{name}-devel/sdk/bin
412 %attr(755,root,root) %{_libdir}/%{name}-devel/sdk/bin/*
413 %{_pkgconfigdir}/libxul.pc
414 %{_pkgconfigdir}/libxul-embedding.pc
415 %{_pkgconfigdir}/mozilla-js.pc
416 %{_pkgconfigdir}/mozilla-plugin.pc
417 %{_pkgconfigdir}/mozilla-gtkmozembed.pc
418 %{_pkgconfigdir}/mozilla-gtkmozembed-embedding.pc
422 %defattr(644,root,root,755)
423 %attr(755,root,root) %{_libdir}/%{name}/components/libmozgnome.so