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