]>
Commit | Line | Data |
---|---|---|
1 | # TODO: | |
2 | # - handle locales differently (runtime, since it's possible to do) | |
3 | # - see ftp://ftp.debian.org/debian/pool/main/m/mozilla-firefox/*diff* | |
4 | # for hints how to make locales | |
5 | # - make it more pld-like (bookmarks, default page etc..) | |
6 | # - add dictionaries outside of mozilla | |
7 | # | |
8 | # Conditional build: | |
9 | %bcond_with tests # enable tests (whatever they check) | |
10 | %bcond_without gnome # disable all GNOME components (gnomevfs, gnome, gnomeui) | |
11 | # | |
12 | Summary: Firefox Community Edition web browser | |
13 | Summary(pl.UTF-8): Firefox Community Edition - przeglądarka WWW | |
14 | Name: mozilla-firefox | |
15 | Version: 2.0.0.2 | |
16 | Release: 3 | |
17 | License: MPL/LGPL | |
18 | Group: X11/Applications/Networking | |
19 | Source0: ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/%{version}/source/firefox-%{version}-source.tar.bz2 | |
20 | # Source0-md5: d7db87b76c1e78a229b662d7dd642265 | |
21 | Source1: %{name}.desktop | |
22 | Source2: %{name}.sh | |
23 | Patch0: mozilla-install.patch | |
24 | Patch1: %{name}-lib_path.patch | |
25 | Patch3: %{name}-nopangoxft.patch | |
26 | Patch5: %{name}-fonts.patch | |
27 | Patch69: %{name}-agent.patch | |
28 | # drop as soon as bug is fixed since it's so ugly hack | |
29 | # fixing symptoms only | |
30 | # https://bugzilla.mozilla.org/show_bug.cgi?id=362462 | |
31 | Patch6: mozilla-hack-gcc_4_2.patch | |
32 | # if ac rebuild is needed... | |
33 | #PatchX: %{name}-ac.patch | |
34 | URL: http://www.mozilla.org/projects/firefox/ | |
35 | %{?with_gnome:BuildRequires: GConf2-devel >= 1.2.1} | |
36 | BuildRequires: automake | |
37 | BuildRequires: cairo-devel >= 1.0.0 | |
38 | %{?with_gnome:BuildRequires: gnome-vfs2-devel >= 2.0} | |
39 | BuildRequires: gtk+2-devel >= 1:2.0.0 | |
40 | BuildRequires: heimdal-devel >= 0.7.1 | |
41 | BuildRequires: libIDL-devel >= 0.8.0 | |
42 | %{?with_gnome:BuildRequires: libgnome-devel >= 2.0} | |
43 | %{?with_gnome:BuildRequires: libgnomeui-devel >= 2.2.0} | |
44 | BuildRequires: libjpeg-devel >= 6b | |
45 | BuildRequires: libpng-devel >= 1.2.7 | |
46 | BuildRequires: libstdc++-devel | |
47 | BuildRequires: nspr-devel >= 1:4.6.3 | |
48 | BuildRequires: nss-devel >= 1:3.11.3-3 | |
49 | BuildRequires: pango-devel >= 1:1.6.0 | |
50 | BuildRequires: perl-modules >= 5.004 | |
51 | BuildRequires: pkgconfig | |
52 | BuildRequires: rpmbuild(macros) >= 1.356 | |
53 | BuildRequires: xorg-lib-libXext-devel | |
54 | BuildRequires: xorg-lib-libXft-devel >= 2.1 | |
55 | BuildRequires: xorg-lib-libXinerama-devel | |
56 | BuildRequires: xorg-lib-libXp-devel | |
57 | BuildRequires: xorg-lib-libXt-devel | |
58 | BuildRequires: zip | |
59 | BuildRequires: zlib-devel >= 1.2.3 | |
60 | Requires(post): mktemp >= 1.5-18 | |
61 | Requires: %{name}-lang-resources = %{version} | |
62 | Requires: %{name}-libs = %{epoch}:%{version}-%{release} | |
63 | Requires: browser-plugins >= 2.0 | |
64 | Requires: nspr >= 1:4.6.3 | |
65 | Requires: nss >= 1:3.11.3 | |
66 | Provides: wwwbrowser | |
67 | Obsoletes: mozilla-firebird | |
68 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
69 | ||
70 | # mozilla and firefox provide their own versions | |
71 | %define _noautoreqdep libgkgfx.so libgtkembedmoz.so libgtkxtbin.so libjsj.so libmozjs.so libxpcom.so libxpcom_compat.so libxpcom_core.so | |
72 | %define _noautoprovfiles %{_libdir}/%{name}/components | |
73 | ||
74 | %define specflags -fno-strict-aliasing -fno-tree-vrp -fno-stack-protector | |
75 | ||
76 | %description | |
77 | Firefox Community Edition is an open-source web browser, designed for | |
78 | standards compliance, performance and portability. | |
79 | ||
80 | %description -l pl.UTF-8 | |
81 | Firefox Community Edition jest open sourcową przeglądarką sieci WWW, | |
82 | stworzoną z myślą o zgodności ze standardami, wydajnością i | |
83 | przenośnością. | |
84 | ||
85 | %package libs | |
86 | Summary: Firefox Community Edition shared libraries | |
87 | Summary(pl.UTF-8): Biblioteki współdzielone przeglądarki Firefox Community Edition | |
88 | Group: Libraries | |
89 | Conflicts: mozilla-firefox < 2.0-1.4 | |
90 | ||
91 | %description libs | |
92 | Firefox Community Edition shared libraries. | |
93 | ||
94 | %description libs -l pl.UTF-8 | |
95 | Biblioteki współdzielone przeglądarki Firefox Community Edition. | |
96 | ||
97 | %package lang-en | |
98 | Summary: English resources for Firefox Community Edition | |
99 | Summary(pl.UTF-8): Anglojęzyczne zasoby dla przeglądarki Firefox Community Edition | |
100 | Group: X11/Applications/Networking | |
101 | Requires: %{name} = %{version}-%{release} | |
102 | Provides: %{name}-lang-resources = %{version}-%{release} | |
103 | ||
104 | %description lang-en | |
105 | English resources for Firefox Community Edition. | |
106 | ||
107 | %description lang-en -l pl.UTF-8 | |
108 | Anglojęzyczne zasoby dla przeglądarki Firefox Community Edition. | |
109 | ||
110 | %prep | |
111 | %setup -qc | |
112 | cd mozilla | |
113 | %patch0 -p1 | |
114 | %patch1 -p1 | |
115 | %patch3 -p1 | |
116 | %patch5 -p1 | |
117 | %patch6 -p2 | |
118 | %patch69 -p1 | |
119 | ||
120 | sed -i 's/\(-lgss\)\(\W\)/\1disable\2/' configure | |
121 | ||
122 | # use system | |
123 | #rm -rf mozilla/nsprpub mozilla/security/nss | |
124 | ||
125 | %build | |
126 | cd mozilla | |
127 | export CFLAGS="%{rpmcflags} $(%{_bindir}/pkg-config mozilla-nspr --cflags-only-I)" | |
128 | export CXXFLAGS="%{rpmcflags} $(%{_bindir}/pkg-config mozilla-nspr --cflags-only-I)" | |
129 | ||
130 | cp -f %{_datadir}/automake/config.* build/autoconf | |
131 | cp -f %{_datadir}/automake/config.* nsprpub/build/autoconf | |
132 | cp -f %{_datadir}/automake/config.* directory/c-sdk/config/autoconf | |
133 | ||
134 | cat << 'EOF' > .mozconfig | |
135 | . $topsrcdir/browser/config/mozconfig | |
136 | ||
137 | # Options for 'configure' (same as command-line options). | |
138 | ac_add_options --prefix=%{_prefix} | |
139 | ac_add_options --exec-prefix=%{_exec_prefix} | |
140 | ac_add_options --bindir=%{_bindir} | |
141 | ac_add_options --sbindir=%{_sbindir} | |
142 | ac_add_options --sysconfdir=%{_sysconfdir} | |
143 | ac_add_options --datadir=%{_datadir} | |
144 | ac_add_options --includedir=%{_includedir} | |
145 | ac_add_options --libdir=%{_libdir} | |
146 | ac_add_options --libexecdir=%{_libexecdir} | |
147 | ac_add_options --localstatedir=%{_localstatedir} | |
148 | ac_add_options --sharedstatedir=%{_sharedstatedir} | |
149 | ac_add_options --mandir=%{_mandir} | |
150 | ac_add_options --infodir=%{_infodir} | |
151 | %if %{?debug:1}0 | |
152 | ac_add_options --disable-optimize | |
153 | ac_add_options --enable-debug | |
154 | ac_add_options --enable-debug-modules | |
155 | ac_add_options --enable-debugger-info-modules | |
156 | ac_add_options --enable-crash-on-assert | |
157 | %else | |
158 | ac_add_options --disable-debug | |
159 | ac_add_options --disable-logging | |
160 | ac_add_options --enable-optimize="%{rpmcflags}" | |
161 | %endif | |
162 | %if %{with tests} | |
163 | ac_add_options --enable-tests | |
164 | %else | |
165 | ac_add_options --disable-tests | |
166 | %endif | |
167 | %if %{with gnome} | |
168 | ac_add_options --enable-gnomevfs | |
169 | ac_add_options --enable-gnomeui | |
170 | %else | |
171 | ac_add_options --disable-gnomevfs | |
172 | ac_add_options --disable-gnomeui | |
173 | %endif | |
174 | ac_add_options --disable-freetype2 | |
175 | ac_add_options --disable-installer | |
176 | ac_add_options --disable-javaxpcom | |
177 | ac_add_options --disable-updater | |
178 | ac_add_options --enable-default-toolkit=gtk2 | |
179 | ac_add_options --enable-svg | |
180 | ac_add_options --enable-system-cairo | |
181 | ac_add_options --enable-xft | |
182 | ac_add_options --with-distribution-id=org.pld-linux | |
183 | ac_add_options --with-system-nspr | |
184 | ac_add_options --with-system-nss | |
185 | ac_add_options --with-system-zlib | |
186 | ac_add_options --with-system-jpeg | |
187 | ac_add_options --with-system-png | |
188 | ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name} | |
189 | ac_cv_visibility_pragma=no | |
190 | EOF | |
191 | ||
192 | %{__make} -j1 -f client.mk build \ | |
193 | CC="%{__cc}" \ | |
194 | CXX="%{__cxx}" | |
195 | ||
196 | %install | |
197 | rm -rf $RPM_BUILD_ROOT | |
198 | cd mozilla | |
199 | install -d \ | |
200 | $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}} \ | |
201 | $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir}} \ | |
202 | $RPM_BUILD_ROOT%{_datadir}/%{name} | |
203 | ||
204 | %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins | |
205 | ||
206 | %{__make} -C xpinstall/packager stage-package \ | |
207 | DESTDIR=$RPM_BUILD_ROOT \ | |
208 | MOZ_PKG_APPDIR=%{_libdir}/%{name} \ | |
209 | PKG_SKIP_STRIP=1 | |
210 | ||
211 | # move arch independant ones to datadir | |
212 | mv $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome $RPM_BUILD_ROOT%{_datadir}/%{name}/chrome | |
213 | mv $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults $RPM_BUILD_ROOT%{_datadir}/%{name}/defaults | |
214 | mv $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries $RPM_BUILD_ROOT%{_datadir}/%{name}/dictionaries | |
215 | mv $RPM_BUILD_ROOT%{_libdir}/%{name}/extensions $RPM_BUILD_ROOT%{_datadir}/%{name}/extensions | |
216 | mv $RPM_BUILD_ROOT%{_libdir}/%{name}/greprefs $RPM_BUILD_ROOT%{_datadir}/%{name}/greprefs | |
217 | mv $RPM_BUILD_ROOT%{_libdir}/%{name}/icons $RPM_BUILD_ROOT%{_datadir}/%{name}/icons | |
218 | mv $RPM_BUILD_ROOT%{_libdir}/%{name}/init.d $RPM_BUILD_ROOT%{_datadir}/%{name}/init.d | |
219 | mv $RPM_BUILD_ROOT%{_libdir}/%{name}/res $RPM_BUILD_ROOT%{_datadir}/%{name}/res | |
220 | mv $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins $RPM_BUILD_ROOT%{_datadir}/%{name}/searchplugins | |
221 | ln -s ../../share/%{name}/chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome | |
222 | ln -s ../../share/%{name}/defaults $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults | |
223 | ln -s ../../share/%{name}/dictionaries $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries | |
224 | ln -s ../../share/%{name}/extensions $RPM_BUILD_ROOT%{_libdir}/%{name}/extensions | |
225 | ln -s ../../share/%{name}/greprefs $RPM_BUILD_ROOT%{_libdir}/%{name}/greprefs | |
226 | ln -s ../../share/%{name}/icons $RPM_BUILD_ROOT%{_libdir}/%{name}/icons | |
227 | ln -s ../../share/%{name}/init.d $RPM_BUILD_ROOT%{_libdir}/%{name}/init.d | |
228 | ln -s ../../share/%{name}/res $RPM_BUILD_ROOT%{_libdir}/%{name}/res | |
229 | ln -s ../../share/%{name}/searchplugins $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins | |
230 | ||
231 | sed 's,@LIBDIR@,%{_libdir},' %{SOURCE2} > $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox | |
232 | ln -s mozilla-firefox $RPM_BUILD_ROOT%{_bindir}/firefox | |
233 | ||
234 | install browser/base/branding/icon64.png $RPM_BUILD_ROOT%{_pixmapsdir}/mozilla-firefox.png | |
235 | ||
236 | install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir} | |
237 | ||
238 | # header/development files | |
239 | rm $RPM_BUILD_ROOT%{_libdir}/%{name}/xpidl | |
240 | rm $RPM_BUILD_ROOT%{_libdir}/%{name}/xpt_dump | |
241 | rm $RPM_BUILD_ROOT%{_libdir}/%{name}/xpt_link | |
242 | ||
243 | # files created by regxpcom and firefox -register | |
244 | touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/compreg.dat | |
245 | touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/xpti.dat | |
246 | ||
247 | # what's this? it's content is invalid anyway. | |
248 | rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list | |
249 | ||
250 | cat << 'EOF' > $RPM_BUILD_ROOT%{_sbindir}/%{name}-chrome+xpcom-generate | |
251 | #!/bin/sh | |
252 | umask 022 | |
253 | rm -f %{_libdir}/%{name}/components/{compreg,xpti}.dat | |
254 | ||
255 | # it attempts to touch files in $HOME/.mozilla | |
256 | # beware if you run this with sudo!!! | |
257 | export HOME=$(mktemp -d) | |
258 | # also TMPDIR could be pointing to sudo user's homedir | |
259 | unset TMPDIR TMP || : | |
260 | ||
261 | LD_LIBRARY_PATH=%{_libdir}/%{name}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} %{_libdir}/%{name}/regxpcom | |
262 | %{_libdir}/%{name}/firefox -register | |
263 | ||
264 | rm -rf $HOME | |
265 | EOF | |
266 | ||
267 | %clean | |
268 | rm -rf $RPM_BUILD_ROOT | |
269 | ||
270 | %pre | |
271 | for d in chrome defaults dictionaries extensions greprefs icons init.d res searchplugins; do | |
272 | if [ -d %{_libdir}/%{name}/$d ] && [ ! -L %{_libdir}/%{name}/$d ]; then | |
273 | install -d %{_datadir}/%{name} | |
274 | mv %{_libdir}/%{name}/$d %{_datadir}/%{name}/$d | |
275 | fi | |
276 | done | |
277 | exit 0 | |
278 | ||
279 | %post | |
280 | %{_sbindir}/%{name}-chrome+xpcom-generate | |
281 | %update_browser_plugins | |
282 | ||
283 | %postun | |
284 | if [ "$1" = 0 ]; then | |
285 | %update_browser_plugins | |
286 | fi | |
287 | ||
288 | %files | |
289 | %defattr(644,root,root,755) | |
290 | %attr(755,root,root) %{_bindir}/%{name} | |
291 | %attr(755,root,root) %{_bindir}/firefox | |
292 | %attr(755,root,root) %{_sbindir}/%{name}-chrome+xpcom-generate | |
293 | ||
294 | # browser plugins v2 | |
295 | %{_browserpluginsconfdir}/browsers.d/%{name}.* | |
296 | %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist | |
297 | ||
298 | %dir %{_libdir}/%{name}/components | |
299 | %attr(755,root,root) %{_libdir}/%{name}/components/*.so | |
300 | %{_libdir}/%{name}/components/*.js | |
301 | %{_libdir}/%{name}/components/*.xpt | |
302 | %dir %{_libdir}/%{name}/plugins | |
303 | %attr(755,root,root) %{_libdir}/%{name}/plugins/*.so | |
304 | %attr(755,root,root) %{_libdir}/%{name}/*.sh | |
305 | %attr(755,root,root) %{_libdir}/%{name}/m* | |
306 | %attr(755,root,root) %{_libdir}/%{name}/f* | |
307 | %attr(755,root,root) %{_libdir}/%{name}/regxpcom | |
308 | %attr(755,root,root) %{_libdir}/%{name}/xpcshell | |
309 | %attr(755,root,root) %{_libdir}/%{name}/xpicleanup | |
310 | %{_pixmapsdir}/mozilla-firefox.png | |
311 | %{_desktopdir}/mozilla-firefox.desktop | |
312 | ||
313 | # symlinks | |
314 | %{_libdir}/%{name}/chrome | |
315 | %{_libdir}/%{name}/defaults | |
316 | %{_libdir}/%{name}/dictionaries | |
317 | %{_libdir}/%{name}/extensions | |
318 | %{_libdir}/%{name}/greprefs | |
319 | %{_libdir}/%{name}/icons | |
320 | %{_libdir}/%{name}/init.d | |
321 | %{_libdir}/%{name}/res | |
322 | %{_libdir}/%{name}/searchplugins | |
323 | ||
324 | # browserconfig | |
325 | %{_libdir}/%{name}/browserconfig.properties | |
326 | ||
327 | %{_libdir}/%{name}/LICENSE | |
328 | %{_libdir}/%{name}/README.txt | |
329 | ||
330 | %dir %{_datadir}/%{name} | |
331 | %{_datadir}/%{name}/chrome | |
332 | %{_datadir}/%{name}/defaults | |
333 | %{_datadir}/%{name}/dictionaries | |
334 | %{_datadir}/%{name}/greprefs | |
335 | %{_datadir}/%{name}/icons | |
336 | %{_datadir}/%{name}/init.d | |
337 | %{_datadir}/%{name}/res | |
338 | %{_datadir}/%{name}/searchplugins | |
339 | ||
340 | %dir %{_datadir}/%{name}/extensions | |
341 | # -dom-inspector subpackage? | |
342 | %{_datadir}/%{name}/extensions/inspector@mozilla.org | |
343 | # the signature of the default theme | |
344 | %{_datadir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd} | |
345 | ||
346 | # files created by regxpcom and firefox -register | |
347 | %ghost %{_libdir}/%{name}/components/compreg.dat | |
348 | %ghost %{_libdir}/%{name}/components/xpti.dat | |
349 | ||
350 | %files libs | |
351 | %defattr(644,root,root,755) | |
352 | %dir %{_libdir}/%{name} | |
353 | %attr(755,root,root) %{_libdir}/%{name}/*.so | |
354 | ||
355 | %files lang-en | |
356 | %defattr(644,root,root,755) | |
357 | %{_datadir}/%{name}/chrome/en-US.jar | |
358 | %{_datadir}/%{name}/chrome/en-US.manifest | |
359 | # probably should share these with all mozilla apps | |
360 | %{_datadir}/%{name}/dictionaries/en-US.aff | |
361 | %{_datadir}/%{name}/dictionaries/en-US.dic |