]> git.pld-linux.org Git - packages/firefox.git/blob - mozilla-firefox.spec
- few fixes to build with gcc 4.1 (still fails)
[packages/firefox.git] / mozilla-firefox.spec
1 #
2 # TODO:
3 # - with new gcc version (it is possible that)
4 #   - -fvisibility=hiddenn and ac_cv_visibility_pragma=no can be removed
5 # - with new firefox version (it is possible that)
6 #   - -fno-strict-aliasing can be removed (needs to be tested carefuly,
7 #      not to be fixed soon, imho)
8 # - handle locales differently (runtime, since it's possible to do)
9 # - see ftp://ftp.debian.org/debian/pool/main/m/mozilla-firefox/*diff*
10 #   for hints how to make locales and other stuff like extensions working
11 # - rpm upgrade is broken. First you need uninstall Firefox 1.0.x.
12 # Conditional build:
13 %bcond_with     tests   # enable tests (whatever they check)
14 %bcond_without  gnome   # disable all GNOME components (gnomevfs, gnome, gnomeui)
15 #
16 Summary:        Mozilla Firefox web browser
17 Summary(pl):    Mozilla Firefox - przegl±darka WWW
18 Name:           mozilla-firefox
19 Version:        1.5.0.1
20 Release:        2
21 License:        MPL/LGPL
22 Group:          X11/Applications/Networking
23 Source0:        ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/%{version}/source/firefox-%{version}-source.tar.bz2
24 # Source0-md5:  c76f02956645bc823241379e27f76bb5
25 Source1:        %{name}.desktop
26 Source2:        %{name}.sh
27 Patch0:         %{name}-nss.patch
28 Patch1:         %{name}-lib_path.patch
29 Patch2:         %{name}-nss-system-nspr.patch
30 Patch3:         %{name}-nopangoxft.patch
31 Patch4:         %{name}-name.patch
32 Patch5:         %{name}-dumpstack.patch
33 Patch6:         %{name}-pango-typo.patch
34 # UPDATE or DROP?
35 #PatchX:        %{name}-searchplugins.patch
36 URL:            http://www.mozilla.org/projects/firefox/
37 %{?with_gnome:BuildRequires:    GConf2-devel >= 1.2.1}
38 BuildRequires:  automake
39 BuildRequires:  cairo-devel >= 1.0.0
40 %{?with_gnome:BuildRequires:    gnome-vfs2-devel >= 2.0}
41 BuildRequires:  gtk+2-devel >= 1:2.0.0
42 BuildRequires:  heimdal-devel >= 0.7.1
43 BuildRequires:  libIDL-devel >= 0.8.0
44 %{?with_gnome:BuildRequires:    libgnome-devel >= 2.0}
45 %{?with_gnome:BuildRequires:    libgnomeui-devel >= 2.2.0}
46 BuildRequires:  libjpeg-devel >= 6b
47 BuildRequires:  libpng-devel >= 1.2.0
48 BuildRequires:  libstdc++-devel
49 BuildRequires:  nspr-devel >= 1:4.6.1
50 BuildRequires:  nss-devel >= 3.10.2
51 BuildRequires:  pango-devel >= 1:1.6.0
52 BuildRequires:  perl-modules >= 5.004
53 BuildRequires:  pkgconfig
54 BuildRequires:  zip
55 Requires:       %{name}-lang-resources = %{version}
56 Requires:       nspr >= 1:4.6.1
57 Requires:       nss >= 3.10.2
58 # for /etc/ld.so.conf.d
59 Requires:       glibc >= 6:2.3.5-7.6
60 Requires(post,postun):  /sbin/ldconfig
61 Provides:       wwwbrowser
62 Obsoletes:      mozilla-firebird
63 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
64
65 %define         _firefoxdir     %{_libdir}/%{name}
66 # mozilla and firefox provide their own versions
67 %define         _noautoreqdep           libgkgfx.so libgtkembedmoz.so libgtkxtbin.so libjsj.so libmozjs.so libxpcom.so libxpcom_compat.so
68 %define         _noautoprovfiles        libplc4.so libplds4.so
69
70 %description
71 Mozilla Firefox is an open-source web browser, designed for standards
72 compliance, performance and portability.
73
74 %description -l pl
75 Mozilla Firefox jest open sourcow± przegl±dark± sieci WWW, stworzon± z
76 my¶l± o zgodno¶ci ze standardami, wydajno¶ci± i przeno¶no¶ci±.
77
78 %package devel
79 Summary:        Headers for developing programs that will use Mozilla Firefox
80 Summary(pl):    Mozilla Firefox - pliki nag³ówkowe
81 Group:          X11/Development/Libraries
82 Requires:       %{name} = %{epoch}:%{version}-%{release}
83 Requires:       nspr-devel >= 1:4.6.1
84 Obsoletes:      mozilla-devel
85
86 %description devel
87 Mozilla Firefox development package.
88
89 %description devel -l pl
90 Pliki nag³ówkowe przegl±darki Mozilla Firefox.
91
92 %package lang-en
93 Summary:        English resources for Mozilla Firefox
94 Summary(pl):    Anglojêzyczne zasoby dla przegl±darki Mozilla Firefox
95 Group:          X11/Applications/Networking
96 Requires(post,postun):  %{name} = %{version}-%{release}
97 Requires(post,postun):  textutils
98 Requires:       %{name} = %{version}-%{release}
99 Provides:       %{name}-lang-resources = %{version}-%{release}
100
101 %description lang-en
102 English resources for Mozilla Firefox.
103
104 %description lang-en -l pl
105 Anglojêzyczne zasoby dla przegl±darki Mozilla Firefox.
106
107 %prep
108 %setup -q -n mozilla
109 %patch0 -p1
110 %patch1 -p1
111 %patch2 -p1
112 %patch3 -p1
113 %patch4 -p1
114 %patch5 -p0
115 %patch6 -p0
116
117 sed -i 's/\(-lgss\)\(\W\)/\1disable\2/' configure
118
119 %build
120 rm -f .mozconfig
121 export CFLAGS="%{rpmcflags} `%{_bindir}/pkg-config mozilla-nspr --cflags-only-I`"
122 export CXXFLAGS="%{rpmcflags} `%{_bindir}/pkg-config mozilla-nspr --cflags-only-I`"
123
124 cp -f %{_datadir}/automake/config.* build/autoconf
125 cp -f %{_datadir}/automake/config.* nsprpub/build/autoconf
126 cp -f %{_datadir}/automake/config.* directory/c-sdk/config/autoconf
127
128 LIBIDL_CONFIG="%{_bindir}/libIDL-config-2"; export LIBIDL_CONFIG
129
130 cat << EOF > .mozconfig
131 . \$topsrcdir/browser/config/mozconfig
132
133 export BUILD_OFFICIAL=1
134 export MOZILLA_OFFICIAL=1
135 mk_add_options BUILD_OFFICIAL=1
136 mk_add_options MOZILLA_OFFICIAL=1
137
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 ac_add_options --enable-optimize="%{rpmcflags}"
152 %if %{?debug:1}0
153 ac_add_options --enable-debug
154 ac_add_options --enable-debug-modules
155 %else
156 ac_add_options --disable-debug
157 ac_add_options --disable-debug-modules
158 %endif
159 %if %{with tests}
160 ac_add_options --enable-tests
161 %else
162 ac_add_options --disable-tests
163 %endif
164 ac_add_options --disable-composer
165 ac_add_options --disable-dtd-debug
166 ac_add_options --disable-freetype2
167 ac_add_options --disable-installer
168 ac_add_options --disable-jsd
169 ac_add_options --disable-ldap
170 ac_add_options --disable-mailnews
171 ac_add_options --disable-profilesharing
172 ac_add_options --disable-xprint
173 ac_add_options --enable-canvas
174 ac_add_options --enable-crypto
175 ac_add_options --enable-default-toolkit=gtk2
176 ac_add_options --enable-mathml
177 ac_add_options --enable-pango
178 ac_add_options --enable-reorder
179 ac_add_options --enable-single-profile
180 ac_add_options --enable-strip
181 ac_add_options --enable-strip-libs
182 ac_add_options --enable-svg
183 ac_add_options --enable-system-cairo
184 ac_add_options --enable-xft
185 ac_add_options --enable-xinerama
186 ac_add_options --enable-xpctools
187 ac_add_options --with-pthreads
188 ac_add_options --with-system-jpeg
189 ac_add_options --with-system-nspr
190 ac_add_options --with-system-png
191 ac_add_options --with-system-zlib
192 ac_cv_visibility_pragma=no
193 EOF
194
195 %{__make} -j1 -f client.mk build \
196         CC="%{__cc} -fno-strict-aliasing -fvisibility=hidden" \
197         CXX="%{__cxx}"
198
199 %install
200 rm -rf $RPM_BUILD_ROOT
201 install -d \
202         $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}{,extensions}} \
203         $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir}} \
204         $RPM_BUILD_ROOT{%{_includedir}/%{name}/idl,%{_pkgconfigdir}}
205 # extensions dir is needed (it can be empty)
206
207 %{__make} -C xpinstall/packager \
208         MOZ_PKG_APPNAME="mozilla-firefox" \
209         MOZILLA_BIN="\$(DIST)/bin/firefox-bin" \
210         EXCLUDE_NSPR_LIBS=1
211
212 sed 's,@LIBDIR@,%{_libdir},' %{SOURCE2} > $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox
213
214 tar -xvz -C $RPM_BUILD_ROOT%{_libdir} -f dist/mozilla-firefox-*linux*.tar.gz
215
216 install other-licenses/branding/firefox/content/icon64.png $RPM_BUILD_ROOT%{_pixmapsdir}/mozilla-firefox.png
217 #install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/
218 #install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/US/
219
220 install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
221
222 rm -rf US classic comm embed-sample en-{US,mac,unix,win} modern pipnss pippki
223 rm -f en-win.jar en-mac.jar embed-sample.jar modern.jar
224
225 # header/developement files
226 cp -rfL dist/include/*  $RPM_BUILD_ROOT%{_includedir}/%{name}
227 cp -rfL dist/idl/*      $RPM_BUILD_ROOT%{_includedir}/%{name}/idl
228
229 install dist/bin/regxpcom $RPM_BUILD_ROOT%{_bindir}
230 install dist/bin/xpidl $RPM_BUILD_ROOT%{_bindir}
231 install dist/bin/xpt_dump $RPM_BUILD_ROOT%{_bindir}
232 install dist/bin/xpt_link $RPM_BUILD_ROOT%{_bindir}
233
234 ln -sf %{_includedir}/mozilla-firefox/necko/nsIURI.h \
235         $RPM_BUILD_ROOT%{_includedir}/mozilla-firefox/nsIURI.h
236
237 # CA certificates
238 ln -s %{_libdir}/libnssckbi.so $RPM_BUILD_ROOT%{_firefoxdir}/libnssckbi.so
239
240 # pkgconfig files
241 for f in build/unix/*.pc ; do
242         sed -e 's/firefox-%{version}/mozilla-firefox/' $f \
243             > $RPM_BUILD_ROOT%{_pkgconfigdir}/$(basename $f)
244 done
245
246 # already provided by standalone packages
247 rm -f $RPM_BUILD_ROOT%{_pkgconfigdir}/firefox-{nss,nspr}.pc
248
249 sed -i -e 's#firefox-nspr =.*#mozilla-nspr#g' -e 's#irefox-nss =.*#mozilla-nss#g' \
250         $RPM_BUILD_ROOT%{_pkgconfigdir}/*.pc
251
252 # includedir/dom CFLAGS
253 sed -i -e '/Cflags:/{/{includedir}\/dom/!s,$, -I${includedir}/dom,}' \
254         $RPM_BUILD_ROOT%{_pkgconfigdir}/firefox-plugin.pc
255
256 cat << 'EOF' > $RPM_BUILD_ROOT%{_sbindir}/firefox-chrome+xpcom-generate
257 #!/bin/sh
258 umask 022
259 rm -f %{_firefoxdir}/chrome/{chrome.rdf,overlayinfo/*/*/*.rdf}
260 rm -f %{_firefoxdir}/components/{compreg,xpti}.dat
261 MOZILLA_FIVE_HOME=%{_firefoxdir}
262 export MOZILLA_FIVE_HOME
263
264 # PATH
265 PATH=%{_firefoxdir}:$PATH
266 export PATH
267
268 # added /usr/lib : don't load your local library
269 LD_LIBRARY_PATH=%{_firefoxdir}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
270 export LD_LIBRARY_PATH
271
272 unset TMPDIR TMP || :
273 MOZILLA_FIVE_HOME=%{_firefoxdir} %{_firefoxdir}/regxpcom
274 MOZILLA_FIVE_HOME=%{_firefoxdir} %{_firefoxdir}/firefox -register
275 EOF
276
277 %clean
278 rm -rf $RPM_BUILD_ROOT
279
280 %post
281 /sbin/ldconfig
282 %{_sbindir}/firefox-chrome+xpcom-generate
283 %banner %{name} -e <<EOF
284 ###################################################################
285 #                                                                 #
286 # NOTICE:                                                         #
287 # If you have problem with upgrade old mozilla-firefox 1.0.x, you #
288 # should remove it first.                                         #
289 #                                                                 #
290 ###################################################################
291 EOF
292
293 %postun
294 /sbin/ldconfig
295 if [ "$1" != "0" ]; then
296         %{_sbindir}/firefox-chrome+xpcom-generate
297 fi
298
299 %preun
300 if [ "$1" == "0" ]; then
301         rm -rf %{_firefoxdir}/chrome/overlayinfo
302         rm -f  %{_firefoxdir}/chrome/*.rdf
303         rm -rf %{_firefoxdir}/components
304         rm -rf %{_firefoxdir}/extensions
305 fi
306
307 %files
308 %defattr(644,root,root,755)
309 %attr(755,root,root) %{_bindir}/mozilla*
310 %attr(755,root,root) %{_sbindir}/*
311 %dir %{_firefoxdir}
312 %{_firefoxdir}/res
313 %dir %{_firefoxdir}/components
314 %attr(755,root,root) %{_firefoxdir}/components/*.so
315 %{_firefoxdir}/components/*.js
316 %{_firefoxdir}/components/*.xpt
317 %{_firefoxdir}/plugins
318 %{_firefoxdir}/searchplugins
319 %{_firefoxdir}/icons
320 %{_firefoxdir}/defaults
321 %{_firefoxdir}/greprefs
322 %dir %{_firefoxdir}/extensions
323 %dir %{_firefoxdir}/init.d
324 %attr(755,root,root) %{_firefoxdir}/*.so
325 %attr(755,root,root) %{_firefoxdir}/*.sh
326 %attr(755,root,root) %{_firefoxdir}/m*
327 %attr(755,root,root) %{_firefoxdir}/f*
328 %attr(755,root,root) %{_firefoxdir}/reg*
329 %attr(755,root,root) %{_firefoxdir}/x*
330 %{_pixmapsdir}/*
331 %{_desktopdir}/*
332
333 %dir %{_firefoxdir}/chrome
334 %{_firefoxdir}/chrome/*.jar
335 %{_firefoxdir}/chrome/*.manifest
336 # -chat subpackage?
337 #%{_firefoxdir}/chrome/chatzilla.jar
338 #%{_firefoxdir}/chrome/content-packs.jar
339 # -dom-inspector subpackage?
340 #%{_firefoxdir}/chrome/inspector.jar
341 %dir %{_firefoxdir}/chrome/icons
342 %{_firefoxdir}/chrome/icons/default
343
344 %files devel
345 %defattr(644,root,root,755)
346 %attr(755,root,root) %{_bindir}/regxpcom
347 %attr(755,root,root) %{_bindir}/xpidl
348 %attr(755,root,root) %{_bindir}/xpt_dump
349 %attr(755,root,root) %{_bindir}/xpt_link
350 %{_includedir}/%{name}
351 %{_pkgconfigdir}/*
352
353 %files lang-en
354 %defattr(644,root,root,755)
355 %{_firefoxdir}/chrome/en-US.jar
356 %{_firefoxdir}/chrome/en-US.manifest
This page took 0.107147 seconds and 4 git commands to generate.