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