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