]> git.pld-linux.org Git - packages/firefox.git/blob - mozilla-firefox.spec
- added branding and prefs patches, see their commitlogs for details
[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 # - make it more pld-like (bookmarks, default page etc..)
7 # - review Rs/BRs for xulrunner build, surely not everything here is needed
8 # - fix/remove noauto{dep,prov,req} for xulrunner build
9 #
10 # Conditional build:
11 %bcond_with     tests           # enable tests (whatever they check)
12 %bcond_without  gnomeui         # disable gnomeui support
13 %bcond_without  gnomevfs        # disable GNOME comp. (gconf+libgnome+gnomevfs) and gnomevfs ext.
14 %bcond_without  gnome           # disable all GNOME components (gnome+gnomeui+gnomevfs)
15 %bcond_without  kerberos        # disable krb5 support
16 %bcond_with     xulrunner       # build with system xulrunner
17
18 %if %{without gnome}
19 %undefine       with_gnomeui
20 %undefine       with_gnomevfs
21 %endif
22
23 Summary:        Firefox Community Edition web browser
24 Summary(pl.UTF-8):      Firefox Community Edition - przeglądarka WWW
25 Name:           mozilla-firefox
26 Version:        3.0
27 Release:        2.3
28 License:        MPL 1.1 or GPL v2+ or LGPL v2.1+
29 Group:          X11/Applications/Networking
30 Source0:        ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/%{version}/source/firefox-%{version}-source.tar.bz2
31 # Source0-md5:  4210ae0801df2eb498408533010d97c1
32 Source1:        %{name}.desktop
33 Source2:        %{name}.sh
34 Patch0:         %{name}-install.patch
35 Patch1:         %{name}-gcc3.patch
36 Patch2:         %{name}-agent.patch
37 Patch3:         %{name}-agent-ac.patch
38 Patch4:         %{name}-ti-agent.patch
39 Patch5:         %{name}-branding.patch
40 Patch6:         %{name}-prefs.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:  glib2-devel
46 %{?with_gnomevfs:BuildRequires: gnome-vfs2-devel >= 2.0}
47 BuildRequires:  gtk+2-devel >= 2:2.10
48 %if "%{pld_release}" == "ac"
49 %{?with_kerberos:BuildRequires: heimdal-devel >= 0.7.1}
50 %else
51 %{?with_kerberos:BuildRequires: krb5-devel}
52 %endif
53 BuildRequires:  libIDL-devel >= 0.8.0
54 %{?with_gnomevfs:BuildRequires: libgnome-devel >= 2.0}
55 %{?with_gnomeui:BuildRequires:  libgnomeui-devel >= 2.2.0}
56 BuildRequires:  libjpeg-devel >= 6b
57 BuildRequires:  libpng(APNG)-devel >= 0.10
58 BuildRequires:  libpng-devel >= 1.2.7
59 BuildRequires:  libstdc++-devel
60 BuildRequires:  myspell-devel
61 BuildRequires:  nspr-devel >= 1:4.7
62 BuildRequires:  nss-devel >= 1:3.12-2
63 BuildRequires:  pango-devel >= 1:1.6.0
64 BuildRequires:  perl-modules >= 5.004
65 BuildRequires:  pkgconfig
66 BuildRequires:  sqlite3-devel
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:       libpng(APNG) >= 0.10
86 Requires:       nspr >= 1:4.7
87 Requires:       nss >= 1:3.12-2
88 %if %{with xulrunner}
89 %requires_eq    xulrunner
90 %endif
91 Provides:       wwwbrowser
92 Obsoletes:      mozilla-firebird
93 Obsoletes:      mozilla-firefox-lang-en < 2.0.0.8-3
94 Obsoletes:      mozilla-firefox-libs
95 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
96
97 # firefox/thunderbird/seamonkey provide their own versions
98 %define         _noautoreqdep           libgkgfx.so libgtkxtbin.so libjsj.so libxpcom_compat.so libxpcom_core.so
99 %define         _noautoprovfiles        %{_libdir}/%{name}/components
100 # we don't want these to satisfy xulrunner-devel
101 %define         _noautoprov             libgtkembedmoz.so libmozjs.so libxpcom.so libxul.so
102 # and as we don't provide them, don't require either
103 %define         _noautoreq              libgtkembedmoz.so 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
144 %build
145 cd mozilla
146 cp -f %{_datadir}/automake/config.* build/autoconf
147 cp -f %{_datadir}/automake/config.* nsprpub/build/autoconf
148
149 cat << 'EOF' > .mozconfig
150 . $topsrcdir/browser/config/mozconfig
151
152 mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-%{_target_cpu}
153
154 # Options for 'configure' (same as command-line options).
155 ac_add_options --prefix=%{_prefix}
156 ac_add_options --exec-prefix=%{_exec_prefix}
157 ac_add_options --bindir=%{_bindir}
158 ac_add_options --sbindir=%{_sbindir}
159 ac_add_options --sysconfdir=%{_sysconfdir}
160 ac_add_options --datadir=%{_datadir}
161 ac_add_options --includedir=%{_includedir}
162 ac_add_options --libdir=%{_libdir}
163 ac_add_options --libexecdir=%{_libexecdir}
164 ac_add_options --localstatedir=%{_localstatedir}
165 ac_add_options --sharedstatedir=%{_sharedstatedir}
166 ac_add_options --mandir=%{_mandir}
167 ac_add_options --infodir=%{_infodir}
168 %if %{?debug:1}0
169 ac_add_options --disable-optimize
170 ac_add_options --enable-debug
171 ac_add_options --enable-debug-modules
172 ac_add_options --enable-debugger-info-modules
173 ac_add_options --enable-crash-on-assert
174 %else
175 ac_add_options --disable-debug
176 ac_add_options --disable-debug-modules
177 ac_add_options --disable-logging
178 ac_add_options --enable-optimize="%{rpmcflags} -Os"
179 %endif
180 %if %{with tests}
181 ac_add_options --enable-tests
182 %else
183 ac_add_options --disable-tests
184 %endif
185 %if %{with gnomeui}
186 ac_add_options --enable-gnomeui
187 %else
188 ac_add_options --disable-gnomeui
189 %endif
190 %if %{with gnomevfs}
191 ac_add_options --enable-gnomevfs
192 %else
193 ac_add_options --disable-gnomevfs
194 %endif
195 ac_add_options --disable-crashreporter
196 ac_add_options --disable-installer
197 ac_add_options --disable-javaxpcom
198 ac_add_options --disable-updater
199 ac_add_options --disable-strip
200 ac_add_options --disable-xprint
201 ac_add_options --enable-startup-notification
202 ac_add_options --enable-svg
203 ac_add_options --enable-system-cairo
204 ac_add_options --enable-system-myspell
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}/*.so
344 %{_libdir}/%{name}/blocklist.xml
345
346 %if %{with crashreporter}
347 %{_libdir}/%{name}/crashreporter
348 %{_libdir}/%{name}/crashreporter-override.ini
349 %{_libdir}/%{name}/crashreporter.ini
350 %{_libdir}/%{name}/Throbber-small.gif
351 %endif
352
353 # config?
354 %{_libdir}/%{name}/.autoreg
355 %{_libdir}/%{name}/application.ini
356
357 %dir %{_libdir}/%{name}/components
358
359 %{_libdir}/%{name}/components/aboutRobots.js
360 %{_libdir}/%{name}/components/FeedConverter.js
361 %{_libdir}/%{name}/components/FeedWriter.js
362 %{_libdir}/%{name}/components/WebContentConverter.js
363 %{_libdir}/%{name}/components/browser.xpt
364 %{_libdir}/%{name}/components/fuelApplication.js
365 %{_libdir}/%{name}/components/nsBrowserContentHandler.js
366 %{_libdir}/%{name}/components/nsBrowserGlue.js
367 %{_libdir}/%{name}/components/nsMicrosummaryService.js
368 %{_libdir}/%{name}/components/nsPlacesTransactionsService.js
369 %{_libdir}/%{name}/components/nsSafebrowsingApplication.js
370 %{_libdir}/%{name}/components/nsSearchService.js
371 %{_libdir}/%{name}/components/nsSearchSuggestions.js
372 %{_libdir}/%{name}/components/nsSessionStartup.js
373 %{_libdir}/%{name}/components/nsSessionStore.js
374 %{_libdir}/%{name}/components/nsSetDefaultBrowser.js
375 %{_libdir}/%{name}/components/nsSidebar.js
376 %if %{without xulrunner}
377 %{_libdir}/%{name}/platform.ini
378 %{_libdir}/%{name}/components/FeedProcessor.js
379 %{_libdir}/%{name}/components/jsconsole-clhandler.js
380 %{_libdir}/%{name}/components/nsAddonRepository.js
381 %{_libdir}/%{name}/components/nsBlocklistService.js
382 %{_libdir}/%{name}/components/nsContentDispatchChooser.js
383 %{_libdir}/%{name}/components/nsContentPrefService.js
384 %{_libdir}/%{name}/components/nsDefaultCLH.js
385 %{_libdir}/%{name}/components/nsDownloadManagerUI.js
386 %{_libdir}/%{name}/components/nsExtensionManager.js
387 %{_libdir}/%{name}/components/nsFilePicker.js
388 %{_libdir}/%{name}/components/nsHandlerService.js
389 %{_libdir}/%{name}/components/nsHelperAppDlg.js
390 %{_libdir}/%{name}/components/nsLivemarkService.js
391 %{_libdir}/%{name}/components/nsLoginInfo.js
392 %{_libdir}/%{name}/components/nsLoginManager.js
393 %{_libdir}/%{name}/components/nsLoginManagerPrompter.js
394 %{_libdir}/%{name}/components/nsProxyAutoConfig.js
395 %{_libdir}/%{name}/components/nsTaggingService.js
396 %{_libdir}/%{name}/components/nsTryToClose.js
397 %{_libdir}/%{name}/components/nsURLFormatter.js
398 %{_libdir}/%{name}/components/nsUpdateService.js
399 %{_libdir}/%{name}/components/nsUrlClassifierLib.js
400 %{_libdir}/%{name}/components/nsUrlClassifierListManager.js
401 %{_libdir}/%{name}/components/nsWebHandlerApp.js
402 %{_libdir}/%{name}/components/pluginGlue.js
403 %{_libdir}/%{name}/components/storage-Legacy.js
404 %{_libdir}/%{name}/components/txEXSLTRegExFunctions.js
405 %endif
406
407 %attr(755,root,root) %{_libdir}/%{name}/components/libbrowsercomps.so
408 %attr(755,root,root) %{_libdir}/%{name}/components/libbrowserdirprovider.so
409 %if %{without xulrunner}
410 %attr(755,root,root) %{_libdir}/%{name}/components/libdbusservice.so
411 %attr(755,root,root) %{_libdir}/%{name}/components/libimgicon.so
412 %endif
413
414 %if %{with gnomevfs}
415 %if %{without xulrunner}
416 %attr(755,root,root) %{_libdir}/%{name}/components/libmozgnome.so
417 %endif
418 %attr(755,root,root) %{_libdir}/%{name}/components/libnkgnomevfs.so
419 %endif
420
421 %attr(755,root,root) %{_libdir}/%{name}/*.sh
422 %attr(755,root,root) %{_libdir}/%{name}/firefox
423 %if %{without xulrunner}
424 %attr(755,root,root) %{_libdir}/%{name}/firefox-bin
425 %dir %{_libdir}/%{name}/plugins
426 %attr(755,root,root) %{_libdir}/%{name}/plugins/*.so
427 %attr(755,root,root) %{_libdir}/%{name}/mozilla-xremote-client
428 %endif
429 %{_pixmapsdir}/mozilla-firefox.png
430 %{_desktopdir}/mozilla-firefox.desktop
431
432 # symlinks
433 %{_libdir}/%{name}/chrome
434 %{_libdir}/%{name}/defaults
435 %{_libdir}/%{name}/extensions
436 %{_libdir}/%{name}/icons
437 %{_libdir}/%{name}/modules
438 %{_libdir}/%{name}/searchplugins
439 %if %{without xulrunner}
440 %{_libdir}/%{name}/dictionaries
441 %{_libdir}/%{name}/greprefs
442 %{_libdir}/%{name}/res
443 %endif
444
445 # browserconfig
446 %{_libdir}/%{name}/browserconfig.properties
447
448 %{_libdir}/%{name}/README.txt
449
450 %dir %{_datadir}/%{name}
451 %{_datadir}/%{name}/chrome
452 %{_datadir}/%{name}/defaults
453 %{_datadir}/%{name}/icons
454 %{_datadir}/%{name}/modules
455 %{_datadir}/%{name}/searchplugins
456 %if %{without xulrunner}
457 %{_datadir}/%{name}/greprefs
458 %{_datadir}/%{name}/res
459 %endif
460
461 %dir %{_datadir}/%{name}/extensions
462 # -dom-inspector subpackage?
463 #%{_datadir}/%{name}/extensions/inspector@mozilla.org
464 # the signature of the default theme
465 %{_datadir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
466
467 # files created by regxpcom and firefox -register
468 %ghost %{_libdir}/%{name}/components/compreg.dat
469 %ghost %{_libdir}/%{name}/components/xpti.dat
This page took 0.081683 seconds and 4 git commands to generate.