]> git.pld-linux.org Git - packages/firefox.git/blob - mozilla-firefox.spec
- P: wwwbrowser (for future use)
[packages/firefox.git] / mozilla-firefox.spec
1 #
2 # TODO:
3 # - handle locales differently (runtime, since it's possible to do)
4 # - see ftp://ftp.debian.org/debian/pool/main/m/mozilla-firefox/*diff*
5 #   for hints how to make locales and other stuff like extensions working
6 # - rpm upgrade is broken. First you need uninstall Firefox 1.0.x. 
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:        Mozilla Firefox web browser
12 Summary(pl):    Mozilla Firefox - przegl±darka WWW
13 Name:           mozilla-firefox
14 Version:        1.5
15 Release:        4
16 License:        MPL/LGPL
17 Group:          X11/Applications/Networking
18 Source0:        http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/%{version}/source/firefox-%{version}-source.tar.bz2
19 # Source0-md5:  fa915ddcadecda30ed3e13694f26a779
20 Source1:        %{name}.desktop
21 Source2:        %{name}.sh
22 Patch0:         %{name}-nss.patch
23 Patch1:         %{name}-lib_path.patch
24 Patch2:         %{name}-nss-system-nspr.patch
25 Patch3:         %{name}-nopangoxft.patch
26 Patch4:         %{name}-name.patch
27 # official patches
28 # certain ui operations cause prolonged hang (cpu at 100%)
29 Patch100:       %{name}-bug305970.patch
30 # UPDATE or DROP?
31 #PatchX:                %{name}-searchplugins.patch
32 URL:            http://www.mozilla.org/projects/firefox/
33 %{?with_gnome:BuildRequires:    GConf2-devel >= 1.2.1}
34 BuildRequires:  automake
35 BuildRequires:  cairo-devel >= 1.0.0
36 BuildRequires:  gtk+2-devel >= 1:2.0.0
37 BuildRequires:  heimdal-devel >= 0.7.1
38 %{?with_gnome:BuildRequires:    gnome-vfs2-devel >= 2.0}
39 BuildRequires:  libIDL-devel >= 0.8.0
40 %{?with_gnome:BuildRequires:    libgnome-devel >= 2.0}
41 %{?with_gnome:BuildRequires:    libgnomeui-devel >= 2.2.0}
42 BuildRequires:  libjpeg-devel >= 6b
43 BuildRequires:  libpng-devel >= 1.2.0
44 BuildRequires:  libstdc++-devel
45 BuildRequires:  nspr-devel >= 1:4.6-0.20041030.1
46 BuildRequires:  nss-devel >= 3.8
47 BuildRequires:  pango-devel >= 1:1.6.0
48 BuildRequires:  perl-modules >= 5.004
49 BuildRequires:  pkgconfig
50 BuildRequires:  zip
51 Requires:       %{name}-lang-resources = %{version}
52 Requires:       nspr >= 1:4.6-0.20041030.1
53 Requires:       nss >= 3.8
54 # for /etc/ld.so.conf.d
55 Requires:       glibc >= 6:2.3.5-7.6
56 Requires(post,postun):  /sbin/ldconfig
57 Provides:       wwwbrowser
58 Obsoletes:      mozilla-firebird
59 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60
61 %define         _firefoxdir     %{_libdir}/%{name}
62 # mozilla and firefox provide their own versions
63 %define         _noautoreqdep           libgkgfx.so libgtkembedmoz.so libgtkxtbin.so libjsj.so libmozjs.so libxpcom.so libxpcom_compat.so
64 %define         _noautoprovfiles        libplc4.so libplds4.so
65
66 %description
67 Mozilla Firefox is an open-source web browser, designed for standards
68 compliance, performance and portability.
69
70 %description -l pl
71 Mozilla Firefox jest open sourcow± przegl±dark± sieci WWW, stworzon± z
72 my¶l± o zgodno¶ci ze standardami, wydajno¶ci± i przeno¶no¶ci±.
73
74 %package devel
75 Summary:        Headers for developing programs that will use Mozilla Firefox
76 Summary(pl):    Mozilla Firefox - pliki nag³ówkowe i biblioteki
77 Group:          X11/Development/Libraries
78 Obsoletes:      mozilla-devel
79 Requires:       %{name} = %{epoch}:%{version}-%{release}
80 Requires:       nspr-devel >= 1:4.6-0.20041030.1
81
82 %description devel
83 Mozilla development package.
84
85 %description devel -l pl
86 Biblioteki i pliki nag³ówkowe.
87
88 %package lang-en
89 Summary:        English resources for Mozilla-firefox
90 Summary(pl):    Anglojêzyczne zasoby dla Mozilla-FireFox
91 Group:          X11/Applications/Networking
92 Requires(post,postun):  %{name} = %{version}-%{release}
93 Requires(post,postun):  textutils
94 Requires:       %{name} = %{version}-%{release}
95 Provides:       %{name}-lang-resources = %{version}-%{release}
96
97 %description lang-en
98 English resources for Mozilla-firefox
99
100 %description lang-en -l pl
101 Anglojêzyczne zasoby dla Mozilla-FireFox
102
103 %prep
104 %setup -q -n mozilla
105 %patch0 -p1
106 %patch1 -p1
107 %patch2 -p1
108 %patch3 -p1
109 %patch4 -p1
110
111 # official patches
112 %patch100 -p1
113 sed -i 's/\(-lgss\)\(\W\)/\1disable\2/' configure
114
115 %build
116 rm -f .mozconfig
117 export CFLAGS="%{rpmcflags} `%{_bindir}/pkg-config mozilla-nspr --cflags-only-I`"
118 export CXXFLAGS="%{rpmcflags} `%{_bindir}/pkg-config mozilla-nspr --cflags-only-I`"
119
120 cp -f %{_datadir}/automake/config.* build/autoconf
121 cp -f %{_datadir}/automake/config.* nsprpub/build/autoconf
122 cp -f %{_datadir}/automake/config.* directory/c-sdk/config/autoconf
123
124 LIBIDL_CONFIG="%{_bindir}/libIDL-config-2"; export LIBIDL_CONFIG
125
126 cat << EOF > .mozconfig
127 . \$topsrcdir/browser/config/mozconfig
128
129 export BUILD_OFFICIAL=1
130 export MOZILLA_OFFICIAL=1
131 mk_add_options BUILD_OFFICIAL=1
132 mk_add_options MOZILLA_OFFICIAL=1
133
134 ac_add_options --prefix=%{_prefix}
135 ac_add_options --exec-prefix=%{_exec_prefix}
136 ac_add_options --bindir=%{_bindir}
137 ac_add_options --sbindir=%{_sbindir}
138 ac_add_options --sysconfdir=%{_sysconfdir}
139 ac_add_options --datadir=%{_datadir}
140 ac_add_options --includedir=%{_includedir}
141 ac_add_options --libdir=%{_libdir}
142 ac_add_options --libexecdir=%{_libexecdir}
143 ac_add_options --localstatedir=%{_localstatedir}
144 ac_add_options --sharedstatedir=%{_sharedstatedir}
145 ac_add_options --mandir=%{_mandir}
146 ac_add_options --infodir=%{_infodir}
147 ac_add_options --enable-optimize="%{rpmcflags}"
148 %if %{?debug:1}0
149 ac_add_options --enable-debug
150 ac_add_options --enable-debug-modules
151 %else
152 ac_add_options --disable-debug
153 ac_add_options --disable-debug-modules
154 %endif
155 %if %{with tests}
156 ac_add_options --enable-tests
157 %else
158 ac_add_options --disable-tests
159 %endif
160 ac_add_options --disable-composer
161 ac_add_options --disable-dtd-debug
162 ac_add_options --disable-freetype2
163 ac_add_options --disable-installer
164 ac_add_options --disable-jsd
165 ac_add_options --disable-ldap
166 ac_add_options --disable-mailnews
167 ac_add_options --disable-profilesharing
168 ac_add_options --disable-xprint
169 ac_add_options --enable-canvas
170 ac_add_options --enable-crypto
171 ac_add_options --enable-default-toolkit=gtk2
172 ac_add_options --enable-mathml
173 ac_add_options --enable-pango
174 ac_add_options --enable-reorder
175 ac_add_options --enable-single-profile
176 ac_add_options --enable-strip
177 ac_add_options --enable-strip-libs
178 ac_add_options --enable-svg
179 ac_add_options --enable-system-cairo
180 ac_add_options --enable-xft
181 ac_add_options --enable-xinerama
182 ac_add_options --enable-xpctools
183 ac_add_options --with-pthreads
184 ac_add_options --with-system-jpeg
185 ac_add_options --with-system-nspr
186 ac_add_options --with-system-png
187 ac_add_options --with-system-zlib
188 EOF
189
190 %{__make} -j1 -f client.mk build \
191         CC="%{__cc}" \
192         CXX="%{__cxx}"
193
194 %install
195 rm -rf $RPM_BUILD_ROOT
196 install -d \
197         $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}{,extensions}} \
198         $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir}} \
199         $RPM_BUILD_ROOT{%{_includedir}/%{name}/idl,%{_pkgconfigdir}}
200 # extensions dir is needed (it can be empty)
201         
202 %{__make} -C xpinstall/packager \
203         MOZ_PKG_APPNAME="mozilla-firefox" \
204         MOZILLA_BIN="\$(DIST)/bin/firefox-bin" \
205         EXCLUDE_NSPR_LIBS=1
206
207 install %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox
208
209 tar -xvz -C $RPM_BUILD_ROOT%{_libdir} -f dist/mozilla-firefox-*linux*.tar.gz
210
211 install other-licenses/branding/firefox/content/icon64.png $RPM_BUILD_ROOT%{_pixmapsdir}/mozilla-firefox.png
212 #install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/
213 #install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/US/
214
215 install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
216
217 #grep locale $RPM_BUILD_ROOT%{_firefoxdir}/chrome/installed-chrome.txt > $RPM_BUILD_ROOT%{_firefoxdir}/chrome/%{name}-en-US-installed-chrome.txt
218 #grep -v locale $RPM_BUILD_ROOT%{_firefoxdir}/chrome/installed-chrome.txt > $RPM_BUILD_ROOT%{_firefoxdir}/chrome/%{name}-misc-installed-chrome.txt
219
220 rm -rf US classic comm embed-sample en-{US,mac,unix,win} modern pipnss pippki
221 rm -f en-win.jar en-mac.jar embed-sample.jar modern.jar
222
223 # header/developement files
224 cp -rfL dist/include/*  $RPM_BUILD_ROOT%{_includedir}/%{name}
225 cp -rfL dist/idl/*      $RPM_BUILD_ROOT%{_includedir}/%{name}/idl
226
227 install dist/bin/regxpcom $RPM_BUILD_ROOT%{_bindir}
228 install dist/bin/xpidl $RPM_BUILD_ROOT%{_bindir}
229 install dist/bin/xpt_dump $RPM_BUILD_ROOT%{_bindir}
230 install dist/bin/xpt_link $RPM_BUILD_ROOT%{_bindir}
231
232 ln -sf %{_includedir}/mozilla-firefox/necko/nsIURI.h \
233         $RPM_BUILD_ROOT%{_includedir}/mozilla-firefox/nsIURI.h
234         
235 # CA certificates
236 ln -s %{_libdir}/libnssckbi.so $RPM_BUILD_ROOT%{_firefoxdir}/libnssckbi.so
237
238 # pkgconfig files
239 for f in build/unix/*.pc ; do
240         sed -e 's/firefox-%{version}/mozilla-firefox/' $f \
241             > $RPM_BUILD_ROOT%{_pkgconfigdir}/$(basename $f)
242 done
243
244 # already provided by standalone packages
245 rm -f $RPM_BUILD_ROOT%{_pkgconfigdir}/firefox-{nss,nspr}.pc
246
247 sed -i -e 's#firefox-nspr =.*#mozilla-nspr#g' -e 's#irefox-nss =.*#mozilla-nss#g' \
248         $RPM_BUILD_ROOT%{_pkgconfigdir}/*.pc
249
250 # includedir/dom CFLAGS         
251 sed -i -e '/Cflags:/{/{includedir}\/dom/!s,$, -I${includedir}/dom,}' \
252         $RPM_BUILD_ROOT%{_pkgconfigdir}/firefox-plugin.pc
253         
254 cat << 'EOF' > $RPM_BUILD_ROOT%{_sbindir}/firefox-chrome+xpcom-generate
255 #!/bin/sh
256 umask 022
257 #There is no such files (*-installed-chrome.txt). IMO obsolete.
258 #cat %{_firefoxdir}/chrome/*-installed-chrome.txt > %{_firefoxdir}/chrome/installed-chrome.txt
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 #%post lang-en
308 #umask 022
309 #cat %{_firefoxdir}/chrome/*-installed-chrome.txt >%{_firefoxdir}/chrome/installed-chrome.txt
310
311 #%postun lang-en
312 #umask 022
313 #cat %{_firefoxdir}/chrome/*-installed-chrome.txt >%{_firefoxdir}/chrome/installed-chrome.txt
314
315 %files
316 %defattr(644,root,root,755)
317 %attr(755,root,root) %{_bindir}/mozilla*
318 %attr(755,root,root) %{_sbindir}/*
319 %dir %{_firefoxdir}
320 %{_firefoxdir}/res
321 %dir %{_firefoxdir}/components
322 %attr(755,root,root) %{_firefoxdir}/components/*.so
323 %{_firefoxdir}/components/*.js
324 %{_firefoxdir}/components/*.xpt
325 %{_firefoxdir}/plugins
326 %{_firefoxdir}/searchplugins
327 %{_firefoxdir}/icons
328 %{_firefoxdir}/defaults
329 %{_firefoxdir}/greprefs
330 %dir %{_firefoxdir}/extensions
331 %dir %{_firefoxdir}/init.d
332 %attr(755,root,root) %{_firefoxdir}/*.so
333 %attr(755,root,root) %{_firefoxdir}/*.sh
334 %attr(755,root,root) %{_firefoxdir}/m*
335 %attr(755,root,root) %{_firefoxdir}/f*
336 %attr(755,root,root) %{_firefoxdir}/reg*
337 %attr(755,root,root) %{_firefoxdir}/x*
338 %{_pixmapsdir}/*
339 %{_desktopdir}/*
340
341 %dir %{_firefoxdir}/chrome
342 %{_firefoxdir}/chrome/*.jar
343 %{_firefoxdir}/chrome/*.manifest
344 # -chat subpackage?
345 #%{_firefoxdir}/chrome/chatzilla.jar
346 #%{_firefoxdir}/chrome/content-packs.jar
347 # -dom-inspector subpackage?
348 #%{_firefoxdir}/chrome/inspector.jar
349 #%{_firefoxdir}/chrome/mozilla-firefox-misc-installed-chrome.txt
350 %dir %{_firefoxdir}/chrome/icons
351 %{_firefoxdir}/chrome/icons/default
352
353 %files devel
354 %defattr(644,root,root,755)
355 %attr(755,root,root) %{_bindir}/regxpcom
356 %attr(755,root,root) %{_bindir}/xpidl
357 %attr(755,root,root) %{_bindir}/xpt_dump
358 %attr(755,root,root) %{_bindir}/xpt_link
359 %{_includedir}/%{name}
360 %{_pkgconfigdir}/*
361
362 %files lang-en
363 %defattr(644,root,root,755)
364 %{_firefoxdir}/chrome/en-US.jar
365 %{_firefoxdir}/chrome/en-US.manifest
366 #%{_firefoxdir}/chrome/mozilla-firefox-en-US-installed-chrome.txt
This page took 0.157915 seconds and 4 git commands to generate.