]> git.pld-linux.org Git - packages/firefox.git/blob - mozilla-firefox.spec
bd9e19de2240ce9b39f745d3a60ec623b6fbc1c9
[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 Patch5:         %{name}-lang.patch
28 # official patches
29 # certain ui operations cause prolonged hang (cpu at 100%)
30 Patch100:       %{name}-bug305970.patch
31 # UPDATE or DROP?
32 #PatchX:                %{name}-searchplugins.patch
33 URL:            http://www.mozilla.org/projects/firefox/
34 %{?with_gnome:BuildRequires:    GConf2-devel >= 1.2.1}
35 BuildRequires:  automake
36 BuildRequires:  cairo-devel >= 1.0.0
37 BuildRequires:  gtk+2-devel >= 1:2.0.0
38 BuildRequires:  heimdal-devel >= 0.7.1
39 %{?with_gnome:BuildRequires:    gnome-vfs2-devel >= 2.0}
40 BuildRequires:  libIDL-devel >= 0.8.0
41 %{?with_gnome:BuildRequires:    libgnome-devel >= 2.0}
42 %{?with_gnome:BuildRequires:    libgnomeui-devel >= 2.2.0}
43 BuildRequires:  libjpeg-devel >= 6b
44 BuildRequires:  libpng-devel >= 1.2.0
45 BuildRequires:  libstdc++-devel
46 BuildRequires:  nspr-devel >= 1:4.6-0.20041030.1
47 BuildRequires:  nss-devel >= 3.8
48 BuildRequires:  pango-devel >= 1:1.6.0
49 BuildRequires:  perl-modules >= 5.004
50 BuildRequires:  pkgconfig
51 BuildRequires:  zip
52 Requires:       %{name}-lang-resources = %{version}
53 Requires:       nspr >= 1:4.6-0.20041030.1
54 Requires:       nss >= 3.8
55 # for /etc/ld.so.conf.d
56 Requires:       glibc >= 6:2.3.5-7.6
57 Requires(post,postun):  /sbin/ldconfig
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 #%patch5 -p1
111
112 # official patches
113 %patch100 -p1
114 sed -i 's/\(-lgss\)\(\W\)/\1disable\2/' configure
115
116 %build
117 rm -f .mozconfig
118 export CFLAGS="%{rpmcflags} `%{_bindir}/pkg-config mozilla-nspr --cflags-only-I`"
119 export CXXFLAGS="%{rpmcflags} `%{_bindir}/pkg-config mozilla-nspr --cflags-only-I`"
120
121 cp -f %{_datadir}/automake/config.* build/autoconf
122 cp -f %{_datadir}/automake/config.* nsprpub/build/autoconf
123 cp -f %{_datadir}/automake/config.* directory/c-sdk/config/autoconf
124
125 LIBIDL_CONFIG="%{_bindir}/libIDL-config-2"; export LIBIDL_CONFIG
126
127 cat << EOF > .mozconfig
128 . \$topsrcdir/browser/config/mozconfig
129
130 export BUILD_OFFICIAL=1
131 export MOZILLA_OFFICIAL=1
132 mk_add_options BUILD_OFFICIAL=1
133 mk_add_options MOZILLA_OFFICIAL=1
134
135 ac_add_options --prefix=%{_prefix}
136 ac_add_options --exec-prefix=%{_exec_prefix}
137 ac_add_options --bindir=%{_bindir}
138 ac_add_options --sbindir=%{_sbindir}
139 ac_add_options --sysconfdir=%{_sysconfdir}
140 ac_add_options --datadir=%{_datadir}
141 ac_add_options --includedir=%{_includedir}
142 ac_add_options --libdir=%{_libdir}
143 ac_add_options --libexecdir=%{_libexecdir}
144 ac_add_options --localstatedir=%{_localstatedir}
145 ac_add_options --sharedstatedir=%{_sharedstatedir}
146 ac_add_options --mandir=%{_mandir}
147 ac_add_options --infodir=%{_infodir}
148 ac_add_options --enable-optimize="%{rpmcflags}"
149 %if %{?debug:1}0
150 ac_add_options --enable-debug
151 ac_add_options --enable-debug-modules
152 %else
153 ac_add_options --disable-debug
154 ac_add_options --disable-debug-modules
155 %endif
156 %if %{with tests}
157 ac_add_options --enable-tests
158 %else
159 ac_add_options --disable-tests
160 %endif
161 ac_add_options --disable-composer
162 ac_add_options --disable-dtd-debug
163 ac_add_options --disable-freetype2
164 ac_add_options --disable-installer
165 ac_add_options --disable-jsd
166 ac_add_options --disable-ldap
167 ac_add_options --disable-mailnews
168 ac_add_options --disable-profilesharing
169 ac_add_options --disable-xprint
170 ac_add_options --enable-canvas
171 ac_add_options --enable-crypto
172 ac_add_options --enable-default-toolkit=gtk2
173 ac_add_options --enable-mathml
174 ac_add_options --enable-pango
175 ac_add_options --enable-reorder
176 ac_add_options --enable-single-profile
177 ac_add_options --enable-strip
178 ac_add_options --enable-strip-libs
179 ac_add_options --enable-svg
180 ac_add_options --enable-system-cairo
181 ac_add_options --enable-xft
182 ac_add_options --enable-xinerama
183 ac_add_options --enable-xpctools
184 ac_add_options --with-pthreads
185 ac_add_options --with-system-jpeg
186 ac_add_options --with-system-nspr
187 ac_add_options --with-system-png
188 ac_add_options --with-system-zlib
189 EOF
190
191 %{__make} -j1 -f client.mk build \
192         CC="%{__cc}" \
193         CXX="%{__cxx}"
194
195 %install
196 rm -rf $RPM_BUILD_ROOT
197 install -d \
198         $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}{,extensions}} \
199         $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir}} \
200         $RPM_BUILD_ROOT{%{_includedir}/%{name}/idl,%{_pkgconfigdir}}
201 # extensions dir is needed (it can be empty)
202         
203 %{__make} -C xpinstall/packager \
204         MOZ_PKG_APPNAME="mozilla-firefox" \
205         MOZILLA_BIN="\$(DIST)/bin/firefox-bin" \
206         EXCLUDE_NSPR_LIBS=1
207
208 install %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox
209
210 tar -xvz -C $RPM_BUILD_ROOT%{_libdir} -f dist/mozilla-firefox-*linux*.tar.gz
211
212 install other-licenses/branding/firefox/content/icon64.png $RPM_BUILD_ROOT%{_pixmapsdir}/mozilla-firefox.png
213 #install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/
214 #install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/US/
215
216 install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
217
218 #grep locale $RPM_BUILD_ROOT%{_firefoxdir}/chrome/installed-chrome.txt > $RPM_BUILD_ROOT%{_firefoxdir}/chrome/%{name}-en-US-installed-chrome.txt
219 #grep -v locale $RPM_BUILD_ROOT%{_firefoxdir}/chrome/installed-chrome.txt > $RPM_BUILD_ROOT%{_firefoxdir}/chrome/%{name}-misc-installed-chrome.txt
220
221 rm -rf US classic comm embed-sample en-{US,mac,unix,win} modern pipnss pippki
222 rm -f en-win.jar en-mac.jar embed-sample.jar modern.jar
223
224 # header/developement files
225 cp -rfL dist/include/*  $RPM_BUILD_ROOT%{_includedir}/%{name}
226 cp -rfL dist/idl/*      $RPM_BUILD_ROOT%{_includedir}/%{name}/idl
227
228 install dist/bin/regxpcom $RPM_BUILD_ROOT%{_bindir}
229 install dist/bin/xpidl $RPM_BUILD_ROOT%{_bindir}
230 install dist/bin/xpt_dump $RPM_BUILD_ROOT%{_bindir}
231 install dist/bin/xpt_link $RPM_BUILD_ROOT%{_bindir}
232
233 ln -sf %{_includedir}/mozilla-firefox/necko/nsIURI.h \
234         $RPM_BUILD_ROOT%{_includedir}/mozilla-firefox/nsIURI.h
235         
236 # CA certificates
237 ln -s %{_libdir}/libnssckbi.so $RPM_BUILD_ROOT%{_firefoxdir}/libnssckbi.so
238
239 # pkgconfig files
240 for f in build/unix/*.pc ; do
241         sed -e 's/firefox-%{version}/mozilla-firefox/' $f \
242             > $RPM_BUILD_ROOT%{_pkgconfigdir}/$(basename $f)
243 done
244
245 # already provided by standalone packages
246 rm -f $RPM_BUILD_ROOT%{_pkgconfigdir}/firefox-{nss,nspr}.pc
247
248 sed -i -e 's#firefox-nspr =.*#mozilla-nspr#g' -e 's#irefox-nss =.*#mozilla-nss#g' \
249         $RPM_BUILD_ROOT%{_pkgconfigdir}/*.pc
250
251 # includedir/dom CFLAGS         
252 sed -i -e '/Cflags:/{/{includedir}\/dom/!s,$, -I${includedir}/dom,}' \
253         $RPM_BUILD_ROOT%{_pkgconfigdir}/firefox-plugin.pc
254         
255 cat << 'EOF' > $RPM_BUILD_ROOT%{_sbindir}/firefox-chrome+xpcom-generate
256 #!/bin/sh
257 umask 022
258 #There is no such files (*-installed-chrome.txt). IMO obsolete.
259 #cat %{_firefoxdir}/chrome/*-installed-chrome.txt > %{_firefoxdir}/chrome/installed-chrome.txt
260 rm -f %{_firefoxdir}/chrome/{chrome.rdf,overlayinfo/*/*/*.rdf}
261 rm -f %{_firefoxdir}/components/{compreg,xpti}.dat
262 MOZILLA_FIVE_HOME=%{_firefoxdir}
263 export MOZILLA_FIVE_HOME
264
265 # PATH
266 PATH=%{_firefoxdir}:$PATH
267 export PATH
268
269 # added /usr/lib : don't load your local library
270 LD_LIBRARY_PATH=%{_firefoxdir}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
271 export LD_LIBRARY_PATH
272
273 unset TMPDIR TMP || :
274 MOZILLA_FIVE_HOME=%{_firefoxdir} %{_firefoxdir}/regxpcom
275 MOZILLA_FIVE_HOME=%{_firefoxdir} %{_firefoxdir}/firefox -register
276 EOF
277
278 %clean
279 rm -rf $RPM_BUILD_ROOT
280
281 %post
282 /sbin/ldconfig
283 %{_sbindir}/firefox-chrome+xpcom-generate
284 %banner %{name} -e <<EOF
285 ###################################################################
286 #                                                                 #
287 # NOTICE:                                                         #
288 # If you have problem with upgrade old mozilla-firefox 1.0.x, you #
289 # should remove it first.                                         #
290 #                                                                 #
291 ###################################################################
292 EOF
293
294 %postun
295 /sbin/ldconfig
296 if [ "$1" != "0" ]; then
297         %{_sbindir}/firefox-chrome+xpcom-generate
298 fi
299
300 %preun
301 if [ "$1" == "0" ]; then
302         rm -rf %{_firefoxdir}/chrome/overlayinfo
303         rm -f  %{_firefoxdir}/chrome/*.rdf
304         rm -rf %{_firefoxdir}/components
305         rm -rf %{_firefoxdir}/extensions
306 fi
307
308 #%post lang-en
309 #umask 022
310 #cat %{_firefoxdir}/chrome/*-installed-chrome.txt >%{_firefoxdir}/chrome/installed-chrome.txt
311
312 #%postun lang-en
313 #umask 022
314 #cat %{_firefoxdir}/chrome/*-installed-chrome.txt >%{_firefoxdir}/chrome/installed-chrome.txt
315
316 %files
317 %defattr(644,root,root,755)
318 %attr(755,root,root) %{_bindir}/mozilla*
319 %attr(755,root,root) %{_sbindir}/*
320 %dir %{_firefoxdir}
321 %{_firefoxdir}/res
322 %dir %{_firefoxdir}/components
323 %attr(755,root,root) %{_firefoxdir}/components/*.so
324 %{_firefoxdir}/components/*.js
325 %{_firefoxdir}/components/*.xpt
326 %{_firefoxdir}/plugins
327 %{_firefoxdir}/searchplugins
328 %{_firefoxdir}/icons
329 %{_firefoxdir}/defaults
330 %{_firefoxdir}/greprefs
331 %dir %{_firefoxdir}/extensions
332 %dir %{_firefoxdir}/init.d
333 %attr(755,root,root) %{_firefoxdir}/*.so
334 %attr(755,root,root) %{_firefoxdir}/*.sh
335 %attr(755,root,root) %{_firefoxdir}/m*
336 %attr(755,root,root) %{_firefoxdir}/f*
337 %attr(755,root,root) %{_firefoxdir}/reg*
338 %attr(755,root,root) %{_firefoxdir}/x*
339 %{_pixmapsdir}/*
340 %{_desktopdir}/*
341
342 %dir %{_firefoxdir}/chrome
343 %{_firefoxdir}/chrome/*.jar
344 %{_firefoxdir}/chrome/*.manifest
345 # -chat subpackage?
346 #%{_firefoxdir}/chrome/chatzilla.jar
347 #%{_firefoxdir}/chrome/content-packs.jar
348 # -dom-inspector subpackage?
349 #%{_firefoxdir}/chrome/inspector.jar
350 #%{_firefoxdir}/chrome/mozilla-firefox-misc-installed-chrome.txt
351 %dir %{_firefoxdir}/chrome/icons
352 %{_firefoxdir}/chrome/icons/default
353
354 %files devel
355 %defattr(644,root,root,755)
356 %attr(755,root,root) %{_bindir}/regxpcom
357 %attr(755,root,root) %{_bindir}/xpidl
358 %attr(755,root,root) %{_bindir}/xpt_dump
359 %attr(755,root,root) %{_bindir}/xpt_link
360 %{_includedir}/%{name}
361 %{_pkgconfigdir}/*
362
363 %files lang-en
364 %defattr(644,root,root,755)
365 %{_firefoxdir}/chrome/en-US.jar
366 %{_firefoxdir}/chrome/en-US.manifest
367 #%{_firefoxdir}/chrome/mozilla-firefox-en-US-installed-chrome.txt
This page took 0.06013 seconds and 3 git commands to generate.