]> git.pld-linux.org Git - packages/firefox.git/blob - mozilla-firefox.spec
- BR: python-modules
[packages/firefox.git] / mozilla-firefox.spec
1 #
2 # TODO:
3 # - handle locales differently (runtime, since it's possible to do)
4 # - see ftp://ftp.debian.org/debian/pool/main/m/mozilla-firefox/*diff*
5 #   for hints how to make locales
6 # - (12:22:58)  patrys:  can you also move _libdir/mozilla-firefox to just _libdir/firefox?
7 #   (12:23:25)  patrys:  it's not like we ship official firefox
8 #
9 # Conditional build:
10 %bcond_with     tests           # enable tests (whatever they check)
11 %bcond_without  gnomeui         # disable gnomeui support
12 %bcond_without  gnomevfs        # disable GNOME comp. (gconf+libgnome+gnomevfs) and gnomevfs ext.
13 %bcond_without  gnome           # disable all GNOME components (gnome+gnomeui+gnomevfs)
14 %bcond_without  kerberos        # disable krb5 support
15 %bcond_with     xulrunner       # build with system xulrunner
16
17 %if %{without gnome}
18 %undefine       with_gnomeui
19 %undefine       with_gnomevfs
20 %endif
21
22 Summary:        Firefox Community Edition web browser
23 Summary(pl.UTF-8):      Firefox Community Edition - przeglądarka WWW
24 Name:           mozilla-firefox
25 Version:        3.0.1
26 Release:        1
27 License:        MPL 1.1 or GPL v2+ or LGPL v2.1+
28 Group:          X11/Applications/Networking
29 Source0:        ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/%{version}/source/firefox-%{version}-source.tar.bz2
30 # Source0-md5:  406d67174f8f74ab154a1b17d0881b27
31 Source1:        %{name}.desktop
32 Source2:        %{name}.sh
33 Patch0:         %{name}-install.patch
34 Patch1:         %{name}-gcc3.patch
35 Patch2:         %{name}-agent.patch
36 Patch3:         %{name}-agent-ac.patch
37 Patch4:         %{name}-ti-agent.patch
38 Patch5:         %{name}-branding.patch
39 Patch6:         %{name}-prefs.patch
40 Patch7:         %{name}-nss_cflags.patch
41 URL:            http://www.mozilla.org/projects/firefox/
42 %{?with_gnomevfs:BuildRequires: GConf2-devel >= 1.2.1}
43 BuildRequires:  automake
44 BuildRequires:  cairo-devel >= 1.6.0
45 BuildRequires:  dbus-glib-devel >= 0.60
46 BuildRequires:  glib2-devel
47 %{?with_gnomevfs:BuildRequires: gnome-vfs2-devel >= 2.0}
48 BuildRequires:  gtk+2-devel >= 2:2.10
49 %if "%{pld_release}" == "ac"
50 %{?with_kerberos:BuildRequires: heimdal-devel >= 0.7.1}
51 %else
52 %{?with_kerberos:BuildRequires: krb5-devel}
53 %endif
54 BuildRequires:  libIDL-devel >= 0.8.0
55 %{?with_gnomevfs:BuildRequires: libgnome-devel >= 2.0}
56 %{?with_gnomeui:BuildRequires:  libgnomeui-devel >= 2.2.0}
57 BuildRequires:  libjpeg-devel >= 6b
58 BuildRequires:  libpng(APNG)-devel >= 0.10
59 BuildRequires:  libpng-devel >= 1.2.7
60 BuildRequires:  libstdc++-devel
61 BuildRequires:  nspr-devel >= 1:4.7
62 BuildRequires:  nss-devel >= 1:3.12-2
63 BuildRequires:  pango-devel >= 1:1.10.0
64 BuildRequires:  perl-modules >= 5.004
65 BuildRequires:  pkgconfig
66 BuildRequires:  python-modules
67 BuildRequires:  sqlite3-devel >= 3.5.9
68 BuildRequires:  rpm >= 4.4.9-56
69 BuildRequires:  rpmbuild(macros) >= 1.453
70 BuildRequires:  startup-notification-devel
71 BuildRequires:  xorg-lib-libXext-devel
72 BuildRequires:  xorg-lib-libXft-devel >= 2.1
73 BuildRequires:  xorg-lib-libXinerama-devel
74 BuildRequires:  xorg-lib-libXp-devel
75 BuildRequires:  xorg-lib-libXt-devel
76 %if %{with xulrunner}
77 BuildRequires:  xulrunner-devel >= 1.9-2
78 %endif
79 BuildRequires:  zip
80 BuildRequires:  zlib-devel >= 1.2.3
81 Requires(post): mktemp >= 1.5-18
82 %if %{without xulrunner}
83 Requires:       browser-plugins >= 2.0
84 %endif
85 Requires:       cairo >= 1.6.0
86 Requires:       gtk+2 >= 2:2.10
87 Requires:       libpng(APNG) >= 0.10
88 Requires:       nspr >= 1:4.7
89 Requires:       nss >= 1:3.12-2
90 Requires:       pango >= 1:1.10.0
91 Requires:       sqlite3 >= 3.5.9
92 %if %{with xulrunner}
93 %requires_eq_to xulrunner xulrunner-devel
94 %endif
95 Provides:       wwwbrowser
96 Obsoletes:      mozilla-firebird
97 Obsoletes:      mozilla-firefox-lang-en < 2.0.0.8-3
98 Obsoletes:      mozilla-firefox-libs
99 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
100
101 # don't satisfy other packages (don't use %{name} here)
102 %define         _noautoprovfiles        %{_libdir}/mozilla-firefox
103 # and as we don't provide them, don't require either
104 %define         _noautoreq      libmozjs.so libxpcom.so libxul.so
105
106 %if "%{cc_version}" >= "3.4"
107 %define         specflags       -fno-strict-aliasing -fno-tree-vrp -fno-stack-protector
108 %else
109 %define         specflags       -fno-strict-aliasing
110 %endif
111
112 %description
113 Firefox Community Edition is an open-source web browser, designed for
114 standards compliance, performance and portability.
115
116 %description -l pl.UTF-8
117 Firefox Community Edition jest przeglądarką WWW rozpowszechnianą
118 zgodnie z ideami ruchu otwartego oprogramowania oraz tworzoną z myślą
119 o zgodności ze standardami, wydajnością i przenośnością.
120
121 %prep
122 %setup -qc -n %{name}-%{version}
123 cd mozilla
124 %patch0 -p1
125
126 %if "%{cc_version}" < "3.4"
127 %patch1 -p2
128 %endif
129
130 %if "%{pld_release}" == "th"
131 %patch2 -p1
132 %endif
133
134 %if "%{pld_release}" == "ac"
135 %patch3 -p1
136 %endif
137
138 %if "%{pld_release}" == "ti"
139 %patch4 -p1
140 %endif
141
142 %patch5 -p1
143 %patch6 -p1
144 %patch7 -p1
145
146 %build
147 cd mozilla
148 cp -f %{_datadir}/automake/config.* build/autoconf
149 cp -f %{_datadir}/automake/config.* nsprpub/build/autoconf
150
151 cat << 'EOF' > .mozconfig
152 . $topsrcdir/browser/config/mozconfig
153
154 mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-%{_target_cpu}
155
156 # Options for 'configure' (same as command-line options).
157 ac_add_options --prefix=%{_prefix}
158 ac_add_options --exec-prefix=%{_exec_prefix}
159 ac_add_options --bindir=%{_bindir}
160 ac_add_options --sbindir=%{_sbindir}
161 ac_add_options --sysconfdir=%{_sysconfdir}
162 ac_add_options --datadir=%{_datadir}
163 ac_add_options --includedir=%{_includedir}
164 ac_add_options --libdir=%{_libdir}
165 ac_add_options --libexecdir=%{_libexecdir}
166 ac_add_options --localstatedir=%{_localstatedir}
167 ac_add_options --sharedstatedir=%{_sharedstatedir}
168 ac_add_options --mandir=%{_mandir}
169 ac_add_options --infodir=%{_infodir}
170 %if %{?debug:1}0
171 ac_add_options --disable-optimize
172 ac_add_options --enable-debug
173 ac_add_options --enable-debug-modules
174 ac_add_options --enable-debugger-info-modules
175 ac_add_options --enable-crash-on-assert
176 %else
177 ac_add_options --disable-debug
178 ac_add_options --disable-debug-modules
179 ac_add_options --disable-logging
180 ac_add_options --enable-optimize="%{rpmcflags} -Os"
181 %endif
182 %if %{with tests}
183 ac_add_options --enable-tests
184 %else
185 ac_add_options --disable-tests
186 %endif
187 %if %{with gnomeui}
188 ac_add_options --enable-gnomeui
189 %else
190 ac_add_options --disable-gnomeui
191 %endif
192 %if %{with gnomevfs}
193 ac_add_options --enable-gnomevfs
194 %else
195 ac_add_options --disable-gnomevfs
196 %endif
197 ac_add_options --disable-crashreporter
198 ac_add_options --disable-installer
199 ac_add_options --disable-javaxpcom
200 ac_add_options --disable-updater
201 ac_add_options --disable-strip
202 ac_add_options --disable-xprint
203 ac_add_options --enable-startup-notification
204 ac_add_options --enable-svg
205 ac_add_options --enable-system-cairo
206 ac_add_options --enable-system-sqlite
207 ac_add_options --enable-libxul
208 ac_add_options --enable-xinerama
209 ac_add_options --with-distribution-id=org.pld-linux
210 %if %{with xulrunner}
211 ac_add_options --with-libxul-sdk=%{_libdir}/xulrunner-sdk
212 %endif
213 ac_add_options --with-pthreads
214 ac_add_options --with-system-jpeg
215 ac_add_options --with-system-nspr
216 ac_add_options --with-system-nss
217 ac_add_options --with-system-png
218 ac_add_options --with-system-zlib
219 ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
220 EOF
221
222 %{__make} -j1 -f client.mk build \
223         STRIP="/bin/true" \
224         CC="%{__cc}" \
225         CXX="%{__cxx}"
226
227 %install
228 rm -rf $RPM_BUILD_ROOT
229 cd mozilla
230 install -d \
231         $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}} \
232         $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir}} \
233         $RPM_BUILD_ROOT%{_datadir}/%{name}
234
235 %if %{without xulrunner}
236 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins
237 %endif
238
239 %{__make} -C obj-%{_target_cpu}/browser/installer stage-package \
240         DESTDIR=$RPM_BUILD_ROOT \
241         MOZ_PKG_APPDIR=%{_libdir}/%{name} \
242         PKG_SKIP_STRIP=1
243
244 # move arch independant ones to datadir
245 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome $RPM_BUILD_ROOT%{_datadir}/%{name}/chrome
246 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults $RPM_BUILD_ROOT%{_datadir}/%{name}/defaults
247 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/extensions $RPM_BUILD_ROOT%{_datadir}/%{name}/extensions
248 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/icons $RPM_BUILD_ROOT%{_datadir}/%{name}/icons
249 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/modules $RPM_BUILD_ROOT%{_datadir}/%{name}/modules
250 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins $RPM_BUILD_ROOT%{_datadir}/%{name}/searchplugins
251 %if %{without xulrunner}
252 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/greprefs $RPM_BUILD_ROOT%{_datadir}/%{name}/greprefs
253 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/res $RPM_BUILD_ROOT%{_datadir}/%{name}/res
254 %endif
255 ln -s ../../share/%{name}/chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome
256 ln -s ../../share/%{name}/defaults $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults
257 ln -s ../../share/%{name}/extensions $RPM_BUILD_ROOT%{_libdir}/%{name}/extensions
258 ln -s ../../share/%{name}/modules $RPM_BUILD_ROOT%{_libdir}/%{name}/modules
259 ln -s ../../share/%{name}/icons $RPM_BUILD_ROOT%{_libdir}/%{name}/icons
260 ln -s ../../share/%{name}/searchplugins $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins
261 %if %{without xulrunner}
262 ln -s ../../share/%{name}/greprefs $RPM_BUILD_ROOT%{_libdir}/%{name}/greprefs
263 ln -s ../../share/%{name}/res $RPM_BUILD_ROOT%{_libdir}/%{name}/res
264 %endif
265
266 %if %{without xulrunner}
267 rm -rf $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
268 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
269 %endif
270
271 sed 's,@LIBDIR@,%{_libdir},' %{SOURCE2} > $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox
272 ln -s mozilla-firefox $RPM_BUILD_ROOT%{_bindir}/firefox
273
274 install browser/base/branding/icon64.png $RPM_BUILD_ROOT%{_pixmapsdir}/mozilla-firefox.png
275
276 install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
277
278 # files created by regxpcom and firefox -register
279 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/compreg.dat
280 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/xpti.dat
281
282 # what's this? it's content is invalid anyway.
283 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list
284 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/old-homepage-default.properties
285
286 cat << 'EOF' > $RPM_BUILD_ROOT%{_sbindir}/%{name}-chrome+xpcom-generate
287 #!/bin/sh
288 umask 022
289 rm -f %{_libdir}/%{name}/components/{compreg,xpti}.dat
290
291 # it attempts to touch files in $HOME/.mozilla
292 # beware if you run this with sudo!!!
293 export HOME=$(mktemp -d)
294 # also TMPDIR could be pointing to sudo user's homedir
295 unset TMPDIR TMP || :
296
297 #LD_LIBRARY_PATH=%{_libdir}/%{name}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} %{_libdir}/%{name}/regxpcom
298 %{_libdir}/%{name}/firefox -register
299
300 rm -rf $HOME
301 EOF
302
303 %clean
304 rm -rf $RPM_BUILD_ROOT
305
306 %pretrans
307 if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then
308         mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave}
309 fi
310 for d in chrome defaults extensions greprefs icons res searchplugins; do
311         if [ -d %{_libdir}/%{name}/$d ] && [ ! -L %{_libdir}/%{name}/$d ]; then
312                 install -d %{_datadir}/%{name}
313                 mv %{_libdir}/%{name}/$d %{_datadir}/%{name}/$d
314         fi
315 done
316 exit 0
317
318 %post
319 %{_sbindir}/%{name}-chrome+xpcom-generate
320 %if %{without xulrunner}
321 %update_browser_plugins
322 %endif
323
324 %postun
325 %if %{without xulrunner}
326 if [ "$1" = 0 ]; then
327         %update_browser_plugins
328 fi
329 %endif
330
331 %files
332 %defattr(644,root,root,755)
333 %attr(755,root,root) %{_bindir}/%{name}
334 %attr(755,root,root) %{_bindir}/firefox
335 %attr(755,root,root) %{_sbindir}/%{name}-chrome+xpcom-generate
336
337 %if %{without xulrunner}
338 # browser plugins v2
339 %{_browserpluginsconfdir}/browsers.d/%{name}.*
340 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
341 %endif
342
343 %dir %{_libdir}/%{name}
344 %attr(755,root,root) %{_libdir}/%{name}/libjemalloc.so
345 %if %{without xulrunner}
346 %attr(755,root,root) %{_libdir}/%{name}/libmozjs.so
347 %attr(755,root,root) %{_libdir}/%{name}/libxpcom.so
348 %attr(755,root,root) %{_libdir}/%{name}/libxul.so
349 %endif
350 %{_libdir}/%{name}/blocklist.xml
351
352 %if %{with crashreporter}
353 %{_libdir}/%{name}/crashreporter
354 %{_libdir}/%{name}/crashreporter-override.ini
355 %{_libdir}/%{name}/crashreporter.ini
356 %{_libdir}/%{name}/Throbber-small.gif
357 %endif
358
359 # config?
360 %{_libdir}/%{name}/.autoreg
361 %{_libdir}/%{name}/application.ini
362
363 %dir %{_libdir}/%{name}/components
364
365 %{_libdir}/%{name}/components/aboutRobots.js
366 %{_libdir}/%{name}/components/FeedConverter.js
367 %{_libdir}/%{name}/components/FeedWriter.js
368 %{_libdir}/%{name}/components/WebContentConverter.js
369 %{_libdir}/%{name}/components/browser.xpt
370 %{_libdir}/%{name}/components/fuelApplication.js
371 %{_libdir}/%{name}/components/nsBrowserContentHandler.js
372 %{_libdir}/%{name}/components/nsBrowserGlue.js
373 %{_libdir}/%{name}/components/nsMicrosummaryService.js
374 %{_libdir}/%{name}/components/nsPlacesTransactionsService.js
375 %{_libdir}/%{name}/components/nsSafebrowsingApplication.js
376 %{_libdir}/%{name}/components/nsSearchService.js
377 %{_libdir}/%{name}/components/nsSearchSuggestions.js
378 %{_libdir}/%{name}/components/nsSessionStartup.js
379 %{_libdir}/%{name}/components/nsSessionStore.js
380 %{_libdir}/%{name}/components/nsSetDefaultBrowser.js
381 %{_libdir}/%{name}/components/nsSidebar.js
382 %if %{without xulrunner}
383 %{_libdir}/%{name}/platform.ini
384 %{_libdir}/%{name}/components/FeedProcessor.js
385 %{_libdir}/%{name}/components/jsconsole-clhandler.js
386 %{_libdir}/%{name}/components/nsAddonRepository.js
387 %{_libdir}/%{name}/components/nsBlocklistService.js
388 %{_libdir}/%{name}/components/nsContentDispatchChooser.js
389 %{_libdir}/%{name}/components/nsContentPrefService.js
390 %{_libdir}/%{name}/components/nsDefaultCLH.js
391 %{_libdir}/%{name}/components/nsDownloadManagerUI.js
392 %{_libdir}/%{name}/components/nsExtensionManager.js
393 %{_libdir}/%{name}/components/nsFilePicker.js
394 %{_libdir}/%{name}/components/nsHandlerService.js
395 %{_libdir}/%{name}/components/nsHelperAppDlg.js
396 %{_libdir}/%{name}/components/nsLivemarkService.js
397 %{_libdir}/%{name}/components/nsLoginInfo.js
398 %{_libdir}/%{name}/components/nsLoginManager.js
399 %{_libdir}/%{name}/components/nsLoginManagerPrompter.js
400 %{_libdir}/%{name}/components/nsProxyAutoConfig.js
401 %{_libdir}/%{name}/components/nsTaggingService.js
402 %{_libdir}/%{name}/components/nsTryToClose.js
403 %{_libdir}/%{name}/components/nsURLFormatter.js
404 %{_libdir}/%{name}/components/nsUpdateService.js
405 %{_libdir}/%{name}/components/nsUrlClassifierLib.js
406 %{_libdir}/%{name}/components/nsUrlClassifierListManager.js
407 %{_libdir}/%{name}/components/nsWebHandlerApp.js
408 %{_libdir}/%{name}/components/pluginGlue.js
409 %{_libdir}/%{name}/components/storage-Legacy.js
410 %{_libdir}/%{name}/components/txEXSLTRegExFunctions.js
411 %endif
412
413 %attr(755,root,root) %{_libdir}/%{name}/components/libbrowsercomps.so
414 %attr(755,root,root) %{_libdir}/%{name}/components/libbrowserdirprovider.so
415 %if %{without xulrunner}
416 %attr(755,root,root) %{_libdir}/%{name}/components/libdbusservice.so
417 %attr(755,root,root) %{_libdir}/%{name}/components/libimgicon.so
418 %endif
419
420 %if %{with gnomevfs}
421 %if %{without xulrunner}
422 %attr(755,root,root) %{_libdir}/%{name}/components/libmozgnome.so
423 %endif
424 %attr(755,root,root) %{_libdir}/%{name}/components/libnkgnomevfs.so
425 %endif
426
427 %attr(755,root,root) %{_libdir}/%{name}/*.sh
428 %attr(755,root,root) %{_libdir}/%{name}/firefox
429 %if %{without xulrunner}
430 %attr(755,root,root) %{_libdir}/%{name}/firefox-bin
431 %dir %{_libdir}/%{name}/plugins
432 %attr(755,root,root) %{_libdir}/%{name}/plugins/*.so
433 %attr(755,root,root) %{_libdir}/%{name}/mozilla-xremote-client
434 %endif
435 %{_pixmapsdir}/mozilla-firefox.png
436 %{_desktopdir}/mozilla-firefox.desktop
437
438 # symlinks
439 %{_libdir}/%{name}/chrome
440 %{_libdir}/%{name}/defaults
441 %{_libdir}/%{name}/extensions
442 %{_libdir}/%{name}/icons
443 %{_libdir}/%{name}/modules
444 %{_libdir}/%{name}/searchplugins
445 %if %{without xulrunner}
446 %{_libdir}/%{name}/dictionaries
447 %{_libdir}/%{name}/greprefs
448 %{_libdir}/%{name}/res
449 %endif
450
451 # browserconfig
452 %{_libdir}/%{name}/browserconfig.properties
453
454 %{_libdir}/%{name}/README.txt
455
456 %dir %{_datadir}/%{name}
457 %{_datadir}/%{name}/chrome
458 %{_datadir}/%{name}/defaults
459 %{_datadir}/%{name}/icons
460 %{_datadir}/%{name}/modules
461 %{_datadir}/%{name}/searchplugins
462 %if %{without xulrunner}
463 %{_datadir}/%{name}/greprefs
464 %{_datadir}/%{name}/res
465 %endif
466
467 %dir %{_datadir}/%{name}/extensions
468 # -dom-inspector subpackage?
469 #%{_datadir}/%{name}/extensions/inspector@mozilla.org
470 # the signature of the default theme
471 %{_datadir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
472
473 # files created by regxpcom and firefox -register
474 %ghost %{_libdir}/%{name}/components/compreg.dat
475 %ghost %{_libdir}/%{name}/components/xpti.dat
This page took 0.055441 seconds and 3 git commands to generate.