]> git.pld-linux.org Git - packages/firefox.git/blob - mozilla-firefox.spec
b912f1196fd342b8704d4f811fe53933655b6c53
[packages/firefox.git] / mozilla-firefox.spec
1 #
2 # TODO:
3 # - from official Mozilla documentation:
4 #   ac_add_options --enable-xft
5 #      Enables XFT advanced font rendering. This is only available with
6 #      --enable-default-toolkit=gtk2, and it is recommended with gtk2
7 #   ac_add_options --enable-freetype2
8 #      Enables freetype font rendering. This is the default for the GTK toolkit.
9 #      Not compatible with --enable-xft
10 #      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 # - review building options (like disable-mailnews and disable-composer,
12 #   these are not meant for firefox)
13 # - handle locales differently (runtime, since it's possible to do)
14 # - see ftp://ftp.debian.org/debian/pool/main/m/mozilla-firefox/*diff*
15 #   for hints how to make locales and other stuff like extensions working
16 # - unpackaged files check
17 #   /usr/lib/mozilla-firefox/LICENSE
18 #   ^- officially packaged, probably not for PLD
19 #   /usr/lib/mozilla-firefox/README.txt
20 #   ^- officially packaged
21 #   /usr/lib/mozilla-firefox/browserconfig.properties
22 #   ^- officially packaged
23 #   /usr/lib/mozilla-firefox/chrome/chatzilla.jar
24 #   ^- chatzilla to be disabled
25 #   /usr/lib/mozilla-firefox/chrome/chromelist.txt
26 #   ^- officially packaged
27 #   /usr/lib/mozilla-firefox/chrome/content-packs.jar
28 #   ^- no sign of this file
29 #   /usr/lib/mozilla-firefox/chrome/embed-sample.jar
30 #   ^- officially packaged
31 #   /usr/lib/mozilla-firefox/chrome/installed-chrome.txt
32 #   ^- officially packaged
33 #   /usr/lib/mozilla-firefox/components/myspell/en-US.aff
34 #   ^- myspell to be disabled
35 #   /usr/lib/mozilla-firefox/components/myspell/en-US.dic
36 #   ^- as above
37 #   /usr/lib/mozilla-firefox/init.d/README
38 #   ^- officially packaged but not needed
39 #
40 # Conditional build:
41 %bcond_with     tests   # enable tests (whatever they check)
42 %bcond_without  ft218   # compile with freetype < 2.1.8
43 #
44 Summary:        Mozilla Firefox web browser
45 Summary(pl):    Mozilla Firefox - przegl±darka WWW
46 Name:           mozilla-firefox
47 Version:        1.0.7
48 Release:        2
49 License:        MPL/LGPL
50 Group:          X11/Applications/Networking
51 Source0:        http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/%{version}/source/firefox-%{version}-source.tar.bz2
52 # Source0-md5:  5704a8c36de84b408e069afb0c5bc1df
53 Source1:        %{name}.desktop
54 Source2:        %{name}.sh
55 Patch0:         %{name}-alpha-gcc3.patch
56 Patch1:         %{name}-gfx.patch
57 Patch2:         %{name}-nss.patch
58 Patch3:         %{name}-lib_path.patch
59 Patch4:         %{name}-freetype.patch
60 Patch5:         %{name}-searchplugins.patch
61 Patch6:         %{name}-gcc-bugs.patch
62 URL:            http://www.mozilla.org/projects/firefox/
63 BuildRequires:  automake
64 %if %{with ft218}
65 BuildRequires:  freetype-devel >= 1:2.1.9
66 %else
67 BuildRequires:  freetype-devel >= 2.1.3
68 BuildRequires:  freetype-devel < 1:2.1.8
69 BuildConflicts: freetype-devel = 2.1.8
70 %endif
71 BuildRequires:  gnome-vfs2-devel
72 BuildRequires:  libgnome-devel >= 2.0
73 BuildRequires:  GConf2-devel
74 BuildRequires:  gtk+2-devel >= 1:2.0.0
75 BuildRequires:  heimdal-devel >= 0.7
76 BuildRequires:  libIDL-devel >= 0.8.0
77 BuildRequires:  libjpeg-devel >= 6b
78 BuildRequires:  libpng-devel >= 1.2.0
79 BuildRequires:  libstdc++-devel
80 BuildRequires:  nspr-devel >= 1:4.6-0.20041030.1
81 BuildRequires:  nss-devel >= 3.8
82 BuildRequires:  pango-devel >= 1:1.1.0
83 BuildRequires:  perl-modules
84 BuildRequires:  pkgconfig
85 BuildRequires:  zip
86 Requires:       %{name}-lang-resources = %{version}
87 %if %{with ft218}
88 Requires:       freetype >= 1:2.1.3
89 %else
90 Requires:       freetype >= 2.1.3
91 Conflicts:      freetype = 2.1.8
92 %endif
93 Requires:       nspr >= 1:4.6-0.20041030.1
94 Requires:       nss >= 3.8
95 Obsoletes:      mozilla-firebird
96 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
97
98 %define         _firefoxdir     %{_libdir}/%{name}
99 # mozilla and firefox provide their own versions
100 %define         _noautoreqdep           libgkgfx.so libgtkembedmoz.so libgtkxtbin.so libjsj.so libmozjs.so libxpcom.so libxpcom_compat.so
101 %define         _noautoprovfiles        libplc4.so libplds4.so
102
103 %description
104 Mozilla Firefox is an open-source web browser, designed for standards
105 compliance, performance and portability.
106
107 %description -l pl
108 Mozilla Firefox jest open sourcow± przegl±dark± sieci WWW, stworzon± z
109 my¶l± o zgodno¶ci ze standardami, wydajno¶ci± i przeno¶no¶ci±.
110
111 %package devel
112 Summary:        Headers for developing programs that will use Mozilla Firefox
113 Summary(pl):    Mozilla Firefox - pliki nag³ówkowe i biblioteki
114 Group:          X11/Development/Libraries
115 Obsoletes:      mozilla-devel
116 Requires:       %{name} = %{epoch}:%{version}-%{release}
117 Requires:       nspr-devel >= 1:4.6-0.20041030.1
118
119 %description devel
120 Mozilla development package.
121
122 %description devel -l pl
123 Biblioteki i pliki nag³ówkowe.
124
125 %package lang-en
126 Summary:        English resources for Mozilla-firefox
127 Summary(pl):    Anglojêzyczne zasoby dla Mozilla-FireFox
128 Group:          X11/Applications/Networking
129 Requires(post,postun):  %{name} = %{version}-%{release}
130 Requires(post,postun):  textutils
131 Requires:       %{name} = %{version}-%{release}
132 Provides:       %{name}-lang-resources = %{version}-%{release}
133
134 %description lang-en
135 English resources for Mozilla-firefox
136
137 %description lang-en -l pl
138 Anglojêzyczne zasoby dla Mozilla-FireFox
139
140 %prep
141 %setup -q -c
142 cd mozilla
143 %patch0 -p1
144 %patch1 -p1
145 %patch2 -p1
146 %patch3 -p1
147 %{?with_ft218:%patch4 -p1}
148 %patch5 -p0
149 %patch6 -p0
150 sed -i 's/\(-lgss\)\(\W\)/\1disable\2/' configure
151
152 %build
153 cd mozilla
154 rm -f .mozconfig
155 export CFLAGS="%{rpmcflags} `%{_bindir}/pkg-config mozilla-nspr --cflags-only-I`"
156 export CXXFLAGS="%{rpmcflags} `%{_bindir}/pkg-config mozilla-nspr --cflags-only-I`"
157
158 cp -f %{_datadir}/automake/config.* build/autoconf
159 cp -f %{_datadir}/automake/config.* nsprpub/build/autoconf
160 cp -f %{_datadir}/automake/config.* directory/c-sdk/config/autoconf
161
162 LIBIDL_CONFIG="%{_bindir}/libIDL-config-2"; export LIBIDL_CONFIG
163
164 cat << EOF > .mozconfig
165 . \$topsrcdir/browser/config/mozconfig
166
167 export BUILD_OFFICIAL=1
168 export MOZILLA_OFFICIAL=1
169 mk_add_options BUILD_OFFICIAL=1
170 mk_add_options MOZILLA_OFFICIAL=1
171
172 ac_add_options --prefix=%{_prefix}
173 ac_add_options --exec-prefix=%{_exec_prefix}
174 ac_add_options --bindir=%{_bindir}
175 ac_add_options --sbindir=%{_sbindir}
176 ac_add_options --sysconfdir=%{_sysconfdir}
177 ac_add_options --datadir=%{_datadir}
178 ac_add_options --includedir=%{_includedir}
179 ac_add_options --libdir=%{_libdir}
180 ac_add_options --libexecdir=%{_libexecdir}
181 ac_add_options --localstatedir=%{_localstatedir}
182 ac_add_options --sharedstatedir=%{_sharedstatedir}
183 ac_add_options --mandir=%{_mandir}
184 ac_add_options --infodir=%{_infodir}
185 ac_add_options --enable-optimize="%{rpmcflags}"
186 %if %{?debug:1}0
187 ac_add_options --enable-debug
188 ac_add_options --enable-debug-modules
189 %else
190 ac_add_options --disable-debug
191 ac_add_options --disable-debug-modules
192 %endif
193 %if %{with tests}
194 ac_add_options --enable-tests
195 %else
196 ac_add_options --disable-tests
197 %endif
198 ac_add_options --disable-composer
199 ac_add_options --disable-dtd-debug
200 ac_add_options --disable-installer
201 ac_add_options --disable-jsd
202 ac_add_options --disable-ldap
203 ac_add_options --disable-mailnews
204 ac_add_options --disable-xprint
205 ac_add_options --disable-profilesharing
206 ac_add_options --enable-xpctools
207 ac_add_options --enable-native-uconv
208 ac_add_options --enable-crypto
209 ac_add_options --enable-freetype2
210 ac_add_options --enable-mathml
211 ac_add_options --enable-reorder
212 ac_add_options --enable-strip
213 ac_add_options --enable-strip-libs
214 ac_add_options --enable-xinerama
215 ac_add_options --enable-xft
216 ac_add_options --enable-default-toolkit=gtk2
217 ac_add_options --with-pthreads
218 ac_add_options --with-system-nspr
219 ac_add_options --with-system-jpeg
220 ac_add_options --with-system-png
221 ac_add_options --with-system-zlib
222 ac_add_options --enable-single-profile
223 EOF
224
225 %{__make} -j1 -f client.mk build \
226         CC="%{__cc}" \
227         CXX="%{__cxx}"
228
229 %install
230 rm -rf $RPM_BUILD_ROOT
231 cd mozilla
232 install -d \
233         $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}} \
234         $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir}} \
235         $RPM_BUILD_ROOT{%{_includedir}/%{name}/idl,%{_pkgconfigdir}}
236         
237 %{__make} -C xpinstall/packager \
238         MOZ_PKG_APPNAME="mozilla-firefox" \
239         MOZILLA_BIN="\$(DIST)/bin/firefox-bin" \
240         EXCLUDE_NSPR_LIBS=1
241
242 install %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox
243
244 tar -xvz -C $RPM_BUILD_ROOT%{_libdir} -f dist/mozilla-firefox-*-linux-gnu.tar.gz
245
246 install other-licenses/branding/firefox/content/icon32.png $RPM_BUILD_ROOT%{_pixmapsdir}/mozilla-firefox.png
247 #install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/
248 #install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/US/
249
250 install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
251
252 grep locale $RPM_BUILD_ROOT%{_firefoxdir}/chrome/installed-chrome.txt > $RPM_BUILD_ROOT%{_firefoxdir}/chrome/%{name}-en-US-installed-chrome.txt
253 grep -v locale $RPM_BUILD_ROOT%{_firefoxdir}/chrome/installed-chrome.txt > $RPM_BUILD_ROOT%{_firefoxdir}/chrome/%{name}-misc-installed-chrome.txt
254
255 rm -rf US classic comm embed-sample en-{US,mac,unix,win} modern pipnss pippki
256 rm -f en-win.jar en-mac.jar embed-sample.jar modern.jar
257
258 # header/developement files
259 cp -rfL dist/include/*  $RPM_BUILD_ROOT%{_includedir}/%{name}
260 cp -rfL dist/idl/*      $RPM_BUILD_ROOT%{_includedir}/%{name}/idl
261
262 install dist/bin/regchrome $RPM_BUILD_ROOT%{_bindir}
263 install dist/bin/regxpcom $RPM_BUILD_ROOT%{_bindir}
264 install dist/bin/xpidl $RPM_BUILD_ROOT%{_bindir}
265 install dist/bin/xpt_dump $RPM_BUILD_ROOT%{_bindir}
266 install dist/bin/xpt_link $RPM_BUILD_ROOT%{_bindir}
267
268 ln -sf %{_includedir}/mozilla-firefox/necko/nsIURI.h \
269         $RPM_BUILD_ROOT%{_includedir}/mozilla-firefox/nsIURI.h
270         
271 # CA certificates
272 ln -s %{_libdir}/libnssckbi.so $RPM_BUILD_ROOT%{_firefoxdir}/libnssckbi.so
273
274 # pkgconfig files
275 for f in build/unix/*.pc ; do
276         sed -e 's/firefox-%{version}/mozilla-firefox/' $f \
277             > $RPM_BUILD_ROOT%{_pkgconfigdir}/$(basename $f)
278 done
279
280 # already provided by standalone packages
281 rm -f $RPM_BUILD_ROOT%{_pkgconfigdir}/firefox-{nss,nspr}.pc
282
283 sed -i -e 's#firefox-nspr =.*#mozilla-nspr#g' -e 's#irefox-nss =.*#mozilla-nss#g' \
284         $RPM_BUILD_ROOT%{_pkgconfigdir}/*.pc
285
286 # includedir/dom CFLAGS         
287 sed -i -e '/Cflags:/{/{includedir}\/dom/!s,$, -I${includedir}/dom,}' \
288         $RPM_BUILD_ROOT%{_pkgconfigdir}/firefox-plugin.pc
289         
290 cat << 'EOF' > $RPM_BUILD_ROOT%{_sbindir}/firefox-chrome+xpcom-generate
291 #!/bin/sh
292 umask 022
293 cat %{_firefoxdir}/chrome/*-installed-chrome.txt > %{_firefoxdir}/chrome/installed-chrome.txt
294 rm -f %{_firefoxdir}/chrome/{chrome.rdf,overlayinfo/*/*/*.rdf}
295 rm -f %{_firefoxdir}/components/{compreg,xpti}.dat
296 MOZILLA_FIVE_HOME=%{_firefoxdir}
297 export MOZILLA_FIVE_HOME
298
299 # PATH
300 PATH=%{_firefoxdir}:$PATH
301 export PATH
302
303 # added /usr/lib : don't load your local library
304 LD_LIBRARY_PATH=%{_firefoxdir}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
305 export LD_LIBRARY_PATH
306
307 unset TMPDIR TMP || :
308 %{_firefoxdir}/regxpcom
309 %{_firefoxdir}/regchrome
310 %{_firefoxdir}/firefox -register
311 EOF
312
313 %clean
314 rm -rf $RPM_BUILD_ROOT
315
316 %post
317 %{_sbindir}/firefox-chrome+xpcom-generate
318
319 %postun
320 if [ "$1" != "0" ]; then
321         %{_sbindir}/firefox-chrome+xpcom-generate
322 fi
323
324 %preun
325 if [ "$1" == "0" ]; then
326         rm -rf %{_firefoxdir}/chrome/overlayinfo
327         rm -f  %{_firefoxdir}/chrome/*.rdf
328         rm -rf %{_firefoxdir}/components
329         rm -rf %{_firefoxdir}/extensions
330 fi
331
332 %post lang-en
333 umask 022
334 cat %{_firefoxdir}/chrome/*-installed-chrome.txt >%{_firefoxdir}/chrome/installed-chrome.txt
335
336 %postun lang-en
337 umask 022
338 cat %{_firefoxdir}/chrome/*-installed-chrome.txt >%{_firefoxdir}/chrome/installed-chrome.txt
339
340 %files
341 %defattr(644,root,root,755)
342 %attr(755,root,root) %{_bindir}/mozilla*
343 %attr(755,root,root) %{_sbindir}/*
344 %dir %{_firefoxdir}
345 %{_firefoxdir}/res
346 %dir %{_firefoxdir}/components
347 %attr(755,root,root) %{_firefoxdir}/components/*.so
348 %{_firefoxdir}/components/*.js
349 %{_firefoxdir}/components/*.xpt
350 %{_firefoxdir}/plugins
351 %{_firefoxdir}/searchplugins
352 %{_firefoxdir}/icons
353 %{_firefoxdir}/defaults
354 %{_firefoxdir}/greprefs
355 %dir %{_firefoxdir}/init.d
356 %attr(755,root,root) %{_firefoxdir}/*.so
357 %attr(755,root,root) %{_firefoxdir}/*.sh
358 %attr(755,root,root) %{_firefoxdir}/m*
359 %attr(755,root,root) %{_firefoxdir}/f*
360 %attr(755,root,root) %{_firefoxdir}/reg*
361 %attr(755,root,root) %{_firefoxdir}/x*
362 %attr(755,root,root) %{_firefoxdir}/T*
363 %ifarch %{ix86}
364 %attr(755,root,root) %{_firefoxdir}/elf-dynstr-gc
365 %endif
366 %{_firefoxdir}/bloaturls.txt
367 %{_pixmapsdir}/*
368 %{_desktopdir}/*
369
370 %dir %{_firefoxdir}/chrome
371 %{_firefoxdir}/chrome/browser.jar
372 # -chat subpackage?
373 #%{_firefoxdir}/chrome/chatzilla.jar
374 %{_firefoxdir}/chrome/classic.jar
375 %{_firefoxdir}/chrome/comm.jar
376 #%{_firefoxdir}/chrome/content-packs.jar
377 %{_firefoxdir}/chrome/help.jar
378 # -dom-inspector subpackage?
379 %{_firefoxdir}/chrome/inspector.jar
380 %{_firefoxdir}/chrome/modern.jar
381 %{_firefoxdir}/chrome/pip*.jar
382 %{_firefoxdir}/chrome/toolkit.jar
383 %{_firefoxdir}/chrome/mozilla-firefox-misc-installed-chrome.txt
384 %dir %{_firefoxdir}/chrome/icons
385 %{_firefoxdir}/chrome/icons/default
386
387 %files devel
388 %defattr(644,root,root,755)
389 %attr(755,root,root) %{_bindir}/regchrome
390 %attr(755,root,root) %{_bindir}/regxpcom
391 %attr(755,root,root) %{_bindir}/xpidl
392 %attr(755,root,root) %{_bindir}/xpt_dump
393 %attr(755,root,root) %{_bindir}/xpt_link
394 %{_includedir}/%{name}
395 %{_pkgconfigdir}/*
396
397 %files lang-en
398 %defattr(644,root,root,755)
399 %{_firefoxdir}/chrome/en-US.jar
400 %{_firefoxdir}/chrome/mozilla-firefox-en-US-installed-chrome.txt
This page took 0.04408 seconds and 2 git commands to generate.