]> git.pld-linux.org Git - packages/firefox.git/blob - mozilla-firefox.spec
- updated to 1.5.0.5 (Several security fixes)
[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 #
13 # Conditional build:
14 %bcond_with     tests   # enable tests (whatever they check)
15 %bcond_without  gnome   # disable all GNOME components (gnomevfs, gnome, gnomeui)
16 #
17 Summary:        Mozilla Firefox web browser
18 Summary(pl):    Mozilla Firefox - przegl±darka WWW
19 Name:           mozilla-firefox
20 Version:        1.5.0.5
21 Release:        1
22 License:        MPL/LGPL
23 Group:          X11/Applications/Networking
24 Source0:        ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/%{version}/source/firefox-%{version}-source.tar.bz2
25 # Source0-md5:  4ef41c8983c47c36efada10a867ffa6f
26 Source1:        %{name}.desktop
27 Source2:        %{name}.sh
28 Patch0:         %{name}-nss.patch
29 Patch1:         %{name}-lib_path.patch
30 Patch2:         %{name}-nss-system-nspr.patch
31 Patch3:         %{name}-nopangoxft.patch
32 Patch4:         %{name}-name.patch
33 Patch5:         %{name}-fonts.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.7
48 BuildRequires:  libstdc++-devel
49 BuildRequires:  nspr-devel >= 1:4.6.1-2
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:  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:       %{name}-lang-resources = %{version}
62 Requires:       nspr >= 1:4.6.1-2
63 Requires:       nss >= 1:3.10.2
64 Provides:       wwwbrowser
65 Obsoletes:      mozilla-firebird
66 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67
68 %define         _firefoxdir     %{_libdir}/%{name}
69 # mozilla and firefox provide their own versions
70 %define         _noautoreqdep           libgkgfx.so libgtkembedmoz.so libgtkxtbin.so libjsj.so libmozjs.so libxpcom.so libxpcom_compat.so
71
72 %define         specflags       -fno-strict-aliasing
73
74 %description
75 Mozilla Firefox is an open-source web browser, designed for standards
76 compliance, performance and portability.
77
78 %description -l pl
79 Mozilla Firefox jest open sourcow± przegl±dark± sieci WWW, stworzon± z
80 my¶l± o zgodno¶ci ze standardami, wydajno¶ci± i przeno¶no¶ci±.
81
82 %package devel
83 Summary:        Headers for developing programs that will use Mozilla Firefox
84 Summary(pl):    Mozilla Firefox - pliki nag³ówkowe
85 Group:          X11/Development/Libraries
86 Requires:       %{name} = %{epoch}:%{version}-%{release}
87 Requires:       nspr-devel >= 1:4.6.1-2
88 Obsoletes:      mozilla-devel
89
90 %description devel
91 Mozilla Firefox development package.
92
93 %description devel -l pl
94 Pliki nag³ówkowe przegl±darki Mozilla Firefox.
95
96 %package lang-en
97 Summary:        English resources for Mozilla Firefox
98 Summary(pl):    Anglojêzyczne zasoby dla przegl±darki Mozilla Firefox
99 Group:          X11/Applications/Networking
100 Requires(post,postun):  %{name} = %{version}-%{release}
101 Requires(post,postun):  textutils
102 Requires:       %{name} = %{version}-%{release}
103 Provides:       %{name}-lang-resources = %{version}-%{release}
104
105 %description lang-en
106 English resources for Mozilla Firefox.
107
108 %description lang-en -l pl
109 Anglojêzyczne zasoby dla przegl±darki Mozilla Firefox.
110
111 %prep
112 %setup -q -n mozilla
113 %patch0 -p1
114 %patch1 -p1
115 %patch2 -p1
116 %patch3 -p1
117 %patch4 -p1
118 %patch5 -p1
119
120 sed -i 's/\(-lgss\)\(\W\)/\1disable\2/' configure
121
122 %build
123 rm -f .mozconfig
124 export CFLAGS="%{rpmcflags} `%{_bindir}/pkg-config mozilla-nspr --cflags-only-I`"
125 export CXXFLAGS="%{rpmcflags} `%{_bindir}/pkg-config mozilla-nspr --cflags-only-I`"
126
127 cp -f %{_datadir}/automake/config.* build/autoconf
128 cp -f %{_datadir}/automake/config.* nsprpub/build/autoconf
129 cp -f %{_datadir}/automake/config.* directory/c-sdk/config/autoconf
130
131 LIBIDL_CONFIG="%{_bindir}/libIDL-config-2"; export LIBIDL_CONFIG
132
133 cat << EOF > .mozconfig
134 . \$topsrcdir/browser/config/mozconfig
135
136 export BUILD_OFFICIAL=1
137 export MOZILLA_OFFICIAL=1
138 mk_add_options BUILD_OFFICIAL=1
139 mk_add_options MOZILLA_OFFICIAL=1
140
141 ac_add_options --prefix=%{_prefix}
142 ac_add_options --exec-prefix=%{_exec_prefix}
143 ac_add_options --bindir=%{_bindir}
144 ac_add_options --sbindir=%{_sbindir}
145 ac_add_options --sysconfdir=%{_sysconfdir}
146 ac_add_options --datadir=%{_datadir}
147 ac_add_options --includedir=%{_includedir}
148 ac_add_options --libdir=%{_libdir}
149 ac_add_options --libexecdir=%{_libexecdir}
150 ac_add_options --localstatedir=%{_localstatedir}
151 ac_add_options --sharedstatedir=%{_sharedstatedir}
152 ac_add_options --mandir=%{_mandir}
153 ac_add_options --infodir=%{_infodir}
154 ac_add_options --enable-optimize="%{rpmcflags}"
155 %if %{?debug:1}0
156 ac_add_options --enable-debug
157 ac_add_options --enable-debug-modules
158 %else
159 ac_add_options --disable-debug
160 ac_add_options --disable-debug-modules
161 %endif
162 %if %{with tests}
163 ac_add_options --enable-tests
164 %else
165 ac_add_options --disable-tests
166 %endif
167 ac_add_options --disable-composer
168 ac_add_options --disable-dtd-debug
169 ac_add_options --disable-freetype2
170 ac_add_options --disable-installer
171 ac_add_options --disable-jsd
172 ac_add_options --disable-ldap
173 ac_add_options --disable-mailnews
174 ac_add_options --disable-profilesharing
175 ac_add_options --disable-xprint
176 ac_add_options --enable-canvas
177 ac_add_options --enable-crypto
178 ac_add_options --enable-default-toolkit=gtk2
179 ac_add_options --enable-mathml
180 ac_add_options --enable-pango
181 ac_add_options --enable-reorder
182 ac_add_options --enable-single-profile
183 ac_add_options --enable-strip
184 ac_add_options --enable-strip-libs
185 ac_add_options --enable-svg
186 ac_add_options --enable-system-cairo
187 ac_add_options --enable-xft
188 ac_add_options --enable-xinerama
189 ac_add_options --enable-xpctools
190 ac_add_options --with-pthreads
191 ac_add_options --with-system-jpeg
192 ac_add_options --with-system-nspr
193 ac_add_options --with-system-png
194 ac_add_options --with-system-zlib
195 ac_cv_visibility_pragma=no
196 EOF
197
198 %{__make} -j1 -f client.mk build \
199         CC="%{__cc}" \
200         CXX="%{__cxx}"
201
202 %install
203 rm -rf $RPM_BUILD_ROOT
204 install -d \
205         $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}{,extensions}} \
206         $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir}} \
207         $RPM_BUILD_ROOT{%{_includedir}/%{name}/idl,%{_pkgconfigdir}}
208 # extensions dir is needed (it can be empty)
209
210 ln -s mozilla-firefox $RPM_BUILD_ROOT%{_bindir}/firefox
211
212 %{__make} -C xpinstall/packager \
213         MOZ_PKG_APPNAME="mozilla-firefox" \
214         MOZILLA_BIN="\$(DIST)/bin/firefox-bin" \
215         EXCLUDE_NSPR_LIBS=1
216
217 sed 's,@LIBDIR@,%{_libdir},' %{SOURCE2} > $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox
218
219 tar -xvz -C $RPM_BUILD_ROOT%{_libdir} -f dist/mozilla-firefox-*linux*.tar.gz
220
221 install other-licenses/branding/firefox/content/icon64.png $RPM_BUILD_ROOT%{_pixmapsdir}/mozilla-firefox.png
222 #install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/
223 #install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/US/
224
225 install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
226
227 rm -rf US classic comm embed-sample en-{US,mac,unix,win} modern pipnss pippki
228 rm -f en-win.jar en-mac.jar embed-sample.jar modern.jar
229
230 # header/developement files
231 cp -rfL dist/include/*  $RPM_BUILD_ROOT%{_includedir}/%{name}
232 cp -rfL dist/idl/*      $RPM_BUILD_ROOT%{_includedir}/%{name}/idl
233
234 install dist/bin/regxpcom $RPM_BUILD_ROOT%{_bindir}
235 install dist/bin/xpidl $RPM_BUILD_ROOT%{_bindir}
236 install dist/bin/xpt_dump $RPM_BUILD_ROOT%{_bindir}
237 install dist/bin/xpt_link $RPM_BUILD_ROOT%{_bindir}
238
239 ln -sf %{_includedir}/mozilla-firefox/necko/nsIURI.h \
240         $RPM_BUILD_ROOT%{_includedir}/mozilla-firefox/nsIURI.h
241
242 # CA certificates
243 ln -s %{_libdir}/libnssckbi.so $RPM_BUILD_ROOT%{_firefoxdir}/libnssckbi.so
244
245 # pkgconfig files
246 for f in build/unix/*.pc ; do
247         sed -e 's/firefox-%{version}/mozilla-firefox/' $f \
248             > $RPM_BUILD_ROOT%{_pkgconfigdir}/$(basename $f)
249 done
250
251 # already provided by standalone packages
252 rm -f $RPM_BUILD_ROOT%{_pkgconfigdir}/firefox-{nss,nspr}.pc
253
254 sed -i -e 's#firefox-nspr =.*#mozilla-nspr#g' -e 's#irefox-nss =.*#mozilla-nss#g' \
255         $RPM_BUILD_ROOT%{_pkgconfigdir}/*.pc
256
257 # includedir/dom CFLAGS
258 sed -i -e '/Cflags:/{/{includedir}\/dom/!s,$, -I${includedir}/dom,}' \
259         $RPM_BUILD_ROOT%{_pkgconfigdir}/firefox-plugin.pc
260
261 cat << 'EOF' > $RPM_BUILD_ROOT%{_sbindir}/firefox-chrome+xpcom-generate
262 #!/bin/sh
263 umask 022
264 rm -f %{_firefoxdir}/chrome/{chrome.rdf,overlayinfo/*/*/*.rdf}
265 rm -f %{_firefoxdir}/components/{compreg,xpti}.dat
266 MOZILLA_FIVE_HOME=%{_firefoxdir}
267 export MOZILLA_FIVE_HOME
268
269 # PATH
270 PATH=%{_firefoxdir}:$PATH
271 export PATH
272
273 # added /usr/lib : don't load your local library
274 LD_LIBRARY_PATH=%{_firefoxdir}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
275 export LD_LIBRARY_PATH
276
277 unset TMPDIR TMP || :
278 MOZILLA_FIVE_HOME=%{_firefoxdir} %{_firefoxdir}/regxpcom
279 MOZILLA_FIVE_HOME=%{_firefoxdir} %{_firefoxdir}/firefox -register
280 EOF
281
282 %clean
283 rm -rf $RPM_BUILD_ROOT
284
285 %post
286 %{_sbindir}/firefox-chrome+xpcom-generate
287
288 %postun
289 if [ "$1" = "0" ]; then
290         rm -rf %{_firefoxdir}/chrome/overlayinfo
291         rm -f  %{_firefoxdir}/chrome/*.rdf
292         rm -rf %{_firefoxdir}/components
293         rm -rf %{_firefoxdir}/extensions
294 fi
295
296 %triggerpostun -- %{name} < 1.5
297 %banner %{name} -e <<EOF
298 NOTICE:
299 If you have problem with upgrade from old mozilla-firefox 1.0.x,
300 you should remove it first and reinstall %{name}-%{version}
301 EOF
302
303 %files
304 %defattr(644,root,root,755)
305 %attr(755,root,root) %{_bindir}/mozilla*
306 %attr(755,root,root) %{_bindir}/firefox
307 %attr(755,root,root) %{_sbindir}/*
308 %dir %{_firefoxdir}
309 %{_firefoxdir}/res
310 %dir %{_firefoxdir}/components
311 %attr(755,root,root) %{_firefoxdir}/components/*.so
312 %{_firefoxdir}/components/*.js
313 %{_firefoxdir}/components/*.xpt
314 %dir %{_firefoxdir}/plugins
315 %attr(755,root,root) %{_firefoxdir}/plugins/*.so
316 %{_firefoxdir}/searchplugins
317 %{_firefoxdir}/icons
318 %{_firefoxdir}/defaults
319 %{_firefoxdir}/greprefs
320 %dir %{_firefoxdir}/extensions
321 %dir %{_firefoxdir}/init.d
322 %attr(755,root,root) %{_firefoxdir}/*.so
323 %attr(755,root,root) %{_firefoxdir}/*.sh
324 %attr(755,root,root) %{_firefoxdir}/m*
325 %attr(755,root,root) %{_firefoxdir}/f*
326 %attr(755,root,root) %{_firefoxdir}/reg*
327 %attr(755,root,root) %{_firefoxdir}/x*
328 %{_pixmapsdir}/*
329 %{_desktopdir}/*
330
331 %dir %{_firefoxdir}/chrome
332 %{_firefoxdir}/chrome/*.jar
333 %{_firefoxdir}/chrome/*.manifest
334 # -chat subpackage?
335 #%{_firefoxdir}/chrome/chatzilla.jar
336 #%{_firefoxdir}/chrome/content-packs.jar
337 %dir %{_firefoxdir}/chrome/icons
338 %{_firefoxdir}/chrome/icons/default
339
340 # -dom-inspector subpackage?
341 %dir %{_firefoxdir}/extensions/inspector@mozilla.org
342 %{_firefoxdir}/extensions/inspector@mozilla.org/*
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.152854 seconds and 4 git commands to generate.