]> git.pld-linux.org Git - packages/firefox.git/blob - mozilla-firefox.spec
- enable xft, disable freetype (follow official builds), disable native-uconv (caused...
[packages/firefox.git] / mozilla-firefox.spec
1 #
2 # TODO:
3 # - review building options (like disable-mailnews and disable-composer,
4 #   these are not meant for firefox)
5 # - handle locales differently (runtime, since it's possible to do)
6 # - see ftp://ftp.debian.org/debian/pool/main/m/mozilla-firefox/*diff*
7 #   for hints how to make locales and other stuff like extensions working
8 # - unpackaged files check
9 #   /usr/lib/mozilla-firefox/LICENSE
10 #   ^- officially packaged, probably not for PLD
11 #   /usr/lib/mozilla-firefox/README.txt
12 #   ^- officially packaged
13 #   /usr/lib/mozilla-firefox/browserconfig.properties
14 #   ^- officially packaged
15 #   /usr/lib/mozilla-firefox/chrome/chatzilla.jar
16 #   ^- chatzilla to be disabled
17 #   /usr/lib/mozilla-firefox/chrome/chromelist.txt
18 #   ^- officially packaged
19 #   /usr/lib/mozilla-firefox/chrome/content-packs.jar
20 #   ^- no sign of this file
21 #   /usr/lib/mozilla-firefox/chrome/embed-sample.jar
22 #   ^- officially packaged
23 #   /usr/lib/mozilla-firefox/components/myspell/en-US.aff
24 #   ^- myspell to be disabled
25 #   /usr/lib/mozilla-firefox/components/myspell/en-US.dic
26 #   ^- as above
27 #   /usr/lib/mozilla-firefox/init.d/README
28 #   ^- officially packaged but not needed
29 #
30 # Conditional build:
31 %bcond_with     tests   # enable tests (whatever they check)
32 %bcond_without  ft218   # compile with freetype < 2.1.8
33 #
34 Summary:        Mozilla Firefox web browser
35 Summary(pl):    Mozilla Firefox - przegl±darka WWW
36 Name:           mozilla-firefox
37 Version:        1.0.7
38 Release:        2.2
39 License:        MPL/LGPL
40 Group:          X11/Applications/Networking
41 Source0:        http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/%{version}/source/firefox-%{version}-source.tar.bz2
42 # Source0-md5:  5704a8c36de84b408e069afb0c5bc1df
43 Source1:        %{name}.desktop
44 Source2:        %{name}.sh
45 Patch0:         %{name}-alpha-gcc3.patch
46 Patch1:         %{name}-gfx.patch
47 Patch2:         %{name}-nss.patch
48 Patch3:         %{name}-lib_path.patch
49 Patch4:         %{name}-freetype.patch
50 Patch5:         %{name}-searchplugins.patch
51 Patch6:         %{name}-gcc-bugs.patch
52 URL:            http://www.mozilla.org/projects/firefox/
53 BuildRequires:  automake
54 %if %{with ft218}
55 BuildRequires:  freetype-devel >= 1:2.1.9
56 %else
57 BuildRequires:  freetype-devel >= 2.1.3
58 BuildRequires:  freetype-devel < 1:2.1.8
59 BuildConflicts: freetype-devel = 2.1.8
60 %endif
61 BuildRequires:  gnome-vfs2-devel
62 BuildRequires:  libgnome-devel >= 2.0
63 BuildRequires:  GConf2-devel
64 BuildRequires:  gtk+2-devel >= 1:2.0.0
65 BuildRequires:  heimdal-devel >= 0.7
66 BuildRequires:  libIDL-devel >= 0.8.0
67 BuildRequires:  libjpeg-devel >= 6b
68 BuildRequires:  libpng-devel >= 1.2.0
69 BuildRequires:  libstdc++-devel
70 BuildRequires:  nspr-devel >= 1:4.6-0.20041030.1
71 BuildRequires:  nss-devel >= 3.8
72 BuildRequires:  pango-devel >= 1:1.1.0
73 BuildRequires:  perl-modules
74 BuildRequires:  pkgconfig
75 BuildRequires:  zip
76 Requires:       %{name}-lang-resources = %{version}
77 %if %{with ft218}
78 Requires:       freetype >= 1:2.1.3
79 %else
80 Requires:       freetype >= 2.1.3
81 Conflicts:      freetype = 2.1.8
82 %endif
83 Requires:       nspr >= 1:4.6-0.20041030.1
84 Requires:       nss >= 3.8
85 Obsoletes:      mozilla-firebird
86 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
87
88 %define         _firefoxdir     %{_libdir}/%{name}
89 # mozilla and firefox provide their own versions
90 %define         _noautoreqdep           libgkgfx.so libgtkembedmoz.so libgtkxtbin.so libjsj.so libmozjs.so libxpcom.so libxpcom_compat.so
91 %define         _noautoprovfiles        libplc4.so libplds4.so
92
93 %description
94 Mozilla Firefox is an open-source web browser, designed for standards
95 compliance, performance and portability.
96
97 %description -l pl
98 Mozilla Firefox jest open sourcow± przegl±dark± sieci WWW, stworzon± z
99 my¶l± o zgodno¶ci ze standardami, wydajno¶ci± i przeno¶no¶ci±.
100
101 %package devel
102 Summary:        Headers for developing programs that will use Mozilla Firefox
103 Summary(pl):    Mozilla Firefox - pliki nag³ówkowe i biblioteki
104 Group:          X11/Development/Libraries
105 Obsoletes:      mozilla-devel
106 Requires:       %{name} = %{epoch}:%{version}-%{release}
107 Requires:       nspr-devel >= 1:4.6-0.20041030.1
108
109 %description devel
110 Mozilla development package.
111
112 %description devel -l pl
113 Biblioteki i pliki nag³ówkowe.
114
115 %package lang-en
116 Summary:        English resources for Mozilla-firefox
117 Summary(pl):    Anglojêzyczne zasoby dla Mozilla-FireFox
118 Group:          X11/Applications/Networking
119 Requires(post,postun):  %{name} = %{version}-%{release}
120 Requires(post,postun):  textutils
121 Requires:       %{name} = %{version}-%{release}
122 Provides:       %{name}-lang-resources = %{version}-%{release}
123
124 %description lang-en
125 English resources for Mozilla-firefox
126
127 %description lang-en -l pl
128 Anglojêzyczne zasoby dla Mozilla-FireFox
129
130 %prep
131 %setup -q -c
132 cd mozilla
133 %patch0 -p1
134 %patch1 -p1
135 %patch2 -p1
136 %patch3 -p1
137 %{?with_ft218:%patch4 -p1}
138 %patch5 -p0
139 %patch6 -p0
140 sed -i 's/\(-lgss\)\(\W\)/\1disable\2/' configure
141
142 %build
143 cd mozilla
144 rm -f .mozconfig
145 export CFLAGS="%{rpmcflags} `%{_bindir}/pkg-config mozilla-nspr --cflags-only-I`"
146 export CXXFLAGS="%{rpmcflags} `%{_bindir}/pkg-config mozilla-nspr --cflags-only-I`"
147
148 cp -f %{_datadir}/automake/config.* build/autoconf
149 cp -f %{_datadir}/automake/config.* nsprpub/build/autoconf
150 cp -f %{_datadir}/automake/config.* directory/c-sdk/config/autoconf
151
152 LIBIDL_CONFIG="%{_bindir}/libIDL-config-2"; export LIBIDL_CONFIG
153
154 cat << EOF > .mozconfig
155 . \$topsrcdir/browser/config/mozconfig
156
157 export BUILD_OFFICIAL=1
158 export MOZILLA_OFFICIAL=1
159 mk_add_options BUILD_OFFICIAL=1
160 mk_add_options MOZILLA_OFFICIAL=1
161
162 ac_add_options --prefix=%{_prefix}
163 ac_add_options --exec-prefix=%{_exec_prefix}
164 ac_add_options --bindir=%{_bindir}
165 ac_add_options --sbindir=%{_sbindir}
166 ac_add_options --sysconfdir=%{_sysconfdir}
167 ac_add_options --datadir=%{_datadir}
168 ac_add_options --includedir=%{_includedir}
169 ac_add_options --libdir=%{_libdir}
170 ac_add_options --libexecdir=%{_libexecdir}
171 ac_add_options --localstatedir=%{_localstatedir}
172 ac_add_options --sharedstatedir=%{_sharedstatedir}
173 ac_add_options --mandir=%{_mandir}
174 ac_add_options --infodir=%{_infodir}
175 ac_add_options --enable-optimize="%{rpmcflags}"
176 %if %{?debug:1}0
177 ac_add_options --enable-debug
178 ac_add_options --enable-debug-modules
179 %else
180 ac_add_options --disable-debug
181 ac_add_options --disable-debug-modules
182 %endif
183 %if %{with tests}
184 ac_add_options --enable-tests
185 %else
186 ac_add_options --disable-tests
187 %endif
188 ac_add_options --disable-composer
189 ac_add_options --disable-dtd-debug
190 ac_add_options --disable-installer
191 ac_add_options --disable-jsd
192 ac_add_options --disable-ldap
193 ac_add_options --disable-mailnews
194 ac_add_options --disable-profilesharing
195 ac_add_options --enable-xft
196 ac_add_options --disable-xprint
197 ac_add_options --enable-crypto
198 ac_add_options --enable-default-toolkit=gtk2
199 ac_add_options --disable-freetype2
200 ac_add_options --enable-mathml
201 ac_add_options --enable-reorder
202 ac_add_options --enable-single-profile
203 ac_add_options --enable-strip
204 ac_add_options --enable-strip-libs
205 ac_add_options --enable-xinerama
206 ac_add_options --enable-xpctools
207 ac_add_options --with-pthreads
208 ac_add_options --with-system-jpeg
209 ac_add_options --with-system-nspr
210 ac_add_options --with-system-png
211 ac_add_options --with-system-zlib
212 EOF
213
214 %{__make} -j1 -f client.mk build \
215         CC="%{__cc}" \
216         CXX="%{__cxx}"
217
218 %install
219 rm -rf $RPM_BUILD_ROOT
220 cd mozilla
221 install -d \
222         $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}} \
223         $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir}} \
224         $RPM_BUILD_ROOT{%{_includedir}/%{name}/idl,%{_pkgconfigdir}}
225         
226 %{__make} -C xpinstall/packager \
227         MOZ_PKG_APPNAME="mozilla-firefox" \
228         MOZILLA_BIN="\$(DIST)/bin/firefox-bin" \
229         EXCLUDE_NSPR_LIBS=1
230
231 install %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox
232
233 tar -xvz -C $RPM_BUILD_ROOT%{_libdir} -f dist/mozilla-firefox-*-linux-gnu.tar.gz
234
235 install other-licenses/branding/firefox/content/icon32.png $RPM_BUILD_ROOT%{_pixmapsdir}/mozilla-firefox.png
236 #install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/
237 #install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/US/
238
239 install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
240
241 grep locale $RPM_BUILD_ROOT%{_firefoxdir}/chrome/installed-chrome.txt > $RPM_BUILD_ROOT%{_firefoxdir}/chrome/%{name}-en-US-installed-chrome.txt
242 grep -v locale $RPM_BUILD_ROOT%{_firefoxdir}/chrome/installed-chrome.txt > $RPM_BUILD_ROOT%{_firefoxdir}/chrome/%{name}-misc-installed-chrome.txt
243
244 rm -rf US classic comm embed-sample en-{US,mac,unix,win} modern pipnss pippki
245 rm -f en-win.jar en-mac.jar embed-sample.jar modern.jar
246
247 # header/developement files
248 cp -rfL dist/include/*  $RPM_BUILD_ROOT%{_includedir}/%{name}
249 cp -rfL dist/idl/*      $RPM_BUILD_ROOT%{_includedir}/%{name}/idl
250
251 install dist/bin/regchrome $RPM_BUILD_ROOT%{_bindir}
252 install dist/bin/regxpcom $RPM_BUILD_ROOT%{_bindir}
253 install dist/bin/xpidl $RPM_BUILD_ROOT%{_bindir}
254 install dist/bin/xpt_dump $RPM_BUILD_ROOT%{_bindir}
255 install dist/bin/xpt_link $RPM_BUILD_ROOT%{_bindir}
256
257 ln -sf %{_includedir}/mozilla-firefox/necko/nsIURI.h \
258         $RPM_BUILD_ROOT%{_includedir}/mozilla-firefox/nsIURI.h
259         
260 # CA certificates
261 ln -s %{_libdir}/libnssckbi.so $RPM_BUILD_ROOT%{_firefoxdir}/libnssckbi.so
262
263 # pkgconfig files
264 for f in build/unix/*.pc ; do
265         sed -e 's/firefox-%{version}/mozilla-firefox/' $f \
266             > $RPM_BUILD_ROOT%{_pkgconfigdir}/$(basename $f)
267 done
268
269 # already provided by standalone packages
270 rm -f $RPM_BUILD_ROOT%{_pkgconfigdir}/firefox-{nss,nspr}.pc
271
272 sed -i -e 's#firefox-nspr =.*#mozilla-nspr#g' -e 's#irefox-nss =.*#mozilla-nss#g' \
273         $RPM_BUILD_ROOT%{_pkgconfigdir}/*.pc
274
275 # includedir/dom CFLAGS         
276 sed -i -e '/Cflags:/{/{includedir}\/dom/!s,$, -I${includedir}/dom,}' \
277         $RPM_BUILD_ROOT%{_pkgconfigdir}/firefox-plugin.pc
278         
279 cat << 'EOF' > $RPM_BUILD_ROOT%{_sbindir}/firefox-chrome+xpcom-generate
280 #!/bin/sh
281 umask 022
282 cat %{_firefoxdir}/chrome/*-installed-chrome.txt > %{_firefoxdir}/chrome/installed-chrome.txt
283 rm -f %{_firefoxdir}/chrome/{chrome.rdf,overlayinfo/*/*/*.rdf}
284 rm -f %{_firefoxdir}/components/{compreg,xpti}.dat
285 MOZILLA_FIVE_HOME=%{_firefoxdir}
286 export MOZILLA_FIVE_HOME
287
288 # PATH
289 PATH=%{_firefoxdir}:$PATH
290 export PATH
291
292 # added /usr/lib : don't load your local library
293 LD_LIBRARY_PATH=%{_firefoxdir}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
294 export LD_LIBRARY_PATH
295
296 unset TMPDIR TMP || :
297 %{_firefoxdir}/regxpcom
298 %{_firefoxdir}/regchrome
299 %{_firefoxdir}/firefox -register
300 EOF
301
302 %clean
303 rm -rf $RPM_BUILD_ROOT
304
305 %post
306 %{_sbindir}/firefox-chrome+xpcom-generate
307
308 %postun
309 if [ "$1" != "0" ]; then
310         %{_sbindir}/firefox-chrome+xpcom-generate
311 fi
312
313 %preun
314 if [ "$1" == "0" ]; then
315         rm -rf %{_firefoxdir}/chrome/overlayinfo
316         rm -f  %{_firefoxdir}/chrome/*.rdf
317         rm -rf %{_firefoxdir}/components
318         rm -rf %{_firefoxdir}/extensions
319 fi
320
321 %post lang-en
322 umask 022
323 cat %{_firefoxdir}/chrome/*-installed-chrome.txt >%{_firefoxdir}/chrome/installed-chrome.txt
324
325 %postun lang-en
326 umask 022
327 cat %{_firefoxdir}/chrome/*-installed-chrome.txt >%{_firefoxdir}/chrome/installed-chrome.txt
328
329 %files
330 %defattr(644,root,root,755)
331 %attr(755,root,root) %{_bindir}/mozilla*
332 %attr(755,root,root) %{_sbindir}/*
333 %dir %{_firefoxdir}
334 %{_firefoxdir}/res
335 %dir %{_firefoxdir}/components
336 %attr(755,root,root) %{_firefoxdir}/components/*.so
337 %{_firefoxdir}/components/*.js
338 %{_firefoxdir}/components/*.xpt
339 %{_firefoxdir}/plugins
340 %{_firefoxdir}/searchplugins
341 %{_firefoxdir}/icons
342 %{_firefoxdir}/defaults
343 %{_firefoxdir}/greprefs
344 %dir %{_firefoxdir}/init.d
345 %attr(755,root,root) %{_firefoxdir}/*.so
346 %attr(755,root,root) %{_firefoxdir}/*.sh
347 %attr(755,root,root) %{_firefoxdir}/m*
348 %attr(755,root,root) %{_firefoxdir}/f*
349 %attr(755,root,root) %{_firefoxdir}/reg*
350 %attr(755,root,root) %{_firefoxdir}/x*
351 %attr(755,root,root) %{_firefoxdir}/T*
352 %ifarch %{ix86}
353 %attr(755,root,root) %{_firefoxdir}/elf-dynstr-gc
354 %endif
355 %{_firefoxdir}/bloaturls.txt
356 %{_pixmapsdir}/*
357 %{_desktopdir}/*
358
359 %dir %{_firefoxdir}/chrome
360 %{_firefoxdir}/chrome/browser.jar
361 # -chat subpackage?
362 #%{_firefoxdir}/chrome/chatzilla.jar
363 %{_firefoxdir}/chrome/classic.jar
364 %{_firefoxdir}/chrome/comm.jar
365 #%{_firefoxdir}/chrome/content-packs.jar
366 %{_firefoxdir}/chrome/help.jar
367 # -dom-inspector subpackage?
368 %{_firefoxdir}/chrome/inspector.jar
369 %{_firefoxdir}/chrome/modern.jar
370 %{_firefoxdir}/chrome/pip*.jar
371 %{_firefoxdir}/chrome/toolkit.jar
372 %{_firefoxdir}/chrome/mozilla-firefox-misc-installed-chrome.txt
373 %ghost %{_firefoxdir}/chrome/installed-chrome.txt
374 %dir %{_firefoxdir}/chrome/icons
375 %{_firefoxdir}/chrome/icons/default
376
377 %files devel
378 %defattr(644,root,root,755)
379 %attr(755,root,root) %{_bindir}/regchrome
380 %attr(755,root,root) %{_bindir}/regxpcom
381 %attr(755,root,root) %{_bindir}/xpidl
382 %attr(755,root,root) %{_bindir}/xpt_dump
383 %attr(755,root,root) %{_bindir}/xpt_link
384 %{_includedir}/%{name}
385 %{_pkgconfigdir}/*
386
387 %files lang-en
388 %defattr(644,root,root,755)
389 %{_firefoxdir}/chrome/en-US.jar
390 %{_firefoxdir}/chrome/mozilla-firefox-en-US-installed-chrome.txt
This page took 0.066457 seconds and 4 git commands to generate.