]> git.pld-linux.org Git - packages/firefox.git/blob - mozilla-firefox.spec
- mark installed-chrome.txt as ghost
[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.1
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 --disable-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 --enable-freetype2
200 ac_add_options --enable-mathml
201 ac_add_options --enable-native-uconv
202 ac_add_options --enable-reorder
203 ac_add_options --enable-single-profile
204 ac_add_options --enable-strip
205 ac_add_options --enable-strip-libs
206 ac_add_options --enable-xinerama
207 ac_add_options --enable-xpctools
208 ac_add_options --with-pthreads
209 ac_add_options --with-system-jpeg
210 ac_add_options --with-system-nspr
211 ac_add_options --with-system-png
212 ac_add_options --with-system-zlib
213 EOF
214
215 %{__make} -j1 -f client.mk build \
216         CC="%{__cc}" \
217         CXX="%{__cxx}"
218
219 %install
220 rm -rf $RPM_BUILD_ROOT
221 cd mozilla
222 install -d \
223         $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}} \
224         $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir}} \
225         $RPM_BUILD_ROOT{%{_includedir}/%{name}/idl,%{_pkgconfigdir}}
226         
227 %{__make} -C xpinstall/packager \
228         MOZ_PKG_APPNAME="mozilla-firefox" \
229         MOZILLA_BIN="\$(DIST)/bin/firefox-bin" \
230         EXCLUDE_NSPR_LIBS=1
231
232 install %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox
233
234 tar -xvz -C $RPM_BUILD_ROOT%{_libdir} -f dist/mozilla-firefox-*-linux-gnu.tar.gz
235
236 install other-licenses/branding/firefox/content/icon32.png $RPM_BUILD_ROOT%{_pixmapsdir}/mozilla-firefox.png
237 #install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/
238 #install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/US/
239
240 install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
241
242 grep locale $RPM_BUILD_ROOT%{_firefoxdir}/chrome/installed-chrome.txt > $RPM_BUILD_ROOT%{_firefoxdir}/chrome/%{name}-en-US-installed-chrome.txt
243 grep -v locale $RPM_BUILD_ROOT%{_firefoxdir}/chrome/installed-chrome.txt > $RPM_BUILD_ROOT%{_firefoxdir}/chrome/%{name}-misc-installed-chrome.txt
244
245 rm -rf US classic comm embed-sample en-{US,mac,unix,win} modern pipnss pippki
246 rm -f en-win.jar en-mac.jar embed-sample.jar modern.jar
247
248 # header/developement files
249 cp -rfL dist/include/*  $RPM_BUILD_ROOT%{_includedir}/%{name}
250 cp -rfL dist/idl/*      $RPM_BUILD_ROOT%{_includedir}/%{name}/idl
251
252 install dist/bin/regchrome $RPM_BUILD_ROOT%{_bindir}
253 install dist/bin/regxpcom $RPM_BUILD_ROOT%{_bindir}
254 install dist/bin/xpidl $RPM_BUILD_ROOT%{_bindir}
255 install dist/bin/xpt_dump $RPM_BUILD_ROOT%{_bindir}
256 install dist/bin/xpt_link $RPM_BUILD_ROOT%{_bindir}
257
258 ln -sf %{_includedir}/mozilla-firefox/necko/nsIURI.h \
259         $RPM_BUILD_ROOT%{_includedir}/mozilla-firefox/nsIURI.h
260         
261 # CA certificates
262 ln -s %{_libdir}/libnssckbi.so $RPM_BUILD_ROOT%{_firefoxdir}/libnssckbi.so
263
264 # pkgconfig files
265 for f in build/unix/*.pc ; do
266         sed -e 's/firefox-%{version}/mozilla-firefox/' $f \
267             > $RPM_BUILD_ROOT%{_pkgconfigdir}/$(basename $f)
268 done
269
270 # already provided by standalone packages
271 rm -f $RPM_BUILD_ROOT%{_pkgconfigdir}/firefox-{nss,nspr}.pc
272
273 sed -i -e 's#firefox-nspr =.*#mozilla-nspr#g' -e 's#irefox-nss =.*#mozilla-nss#g' \
274         $RPM_BUILD_ROOT%{_pkgconfigdir}/*.pc
275
276 # includedir/dom CFLAGS         
277 sed -i -e '/Cflags:/{/{includedir}\/dom/!s,$, -I${includedir}/dom,}' \
278         $RPM_BUILD_ROOT%{_pkgconfigdir}/firefox-plugin.pc
279         
280 cat << 'EOF' > $RPM_BUILD_ROOT%{_sbindir}/firefox-chrome+xpcom-generate
281 #!/bin/sh
282 umask 022
283 cat %{_firefoxdir}/chrome/*-installed-chrome.txt > %{_firefoxdir}/chrome/installed-chrome.txt
284 rm -f %{_firefoxdir}/chrome/{chrome.rdf,overlayinfo/*/*/*.rdf}
285 rm -f %{_firefoxdir}/components/{compreg,xpti}.dat
286 MOZILLA_FIVE_HOME=%{_firefoxdir}
287 export MOZILLA_FIVE_HOME
288
289 # PATH
290 PATH=%{_firefoxdir}:$PATH
291 export PATH
292
293 # added /usr/lib : don't load your local library
294 LD_LIBRARY_PATH=%{_firefoxdir}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
295 export LD_LIBRARY_PATH
296
297 unset TMPDIR TMP || :
298 %{_firefoxdir}/regxpcom
299 %{_firefoxdir}/regchrome
300 %{_firefoxdir}/firefox -register
301 EOF
302
303 %clean
304 rm -rf $RPM_BUILD_ROOT
305
306 %post
307 %{_sbindir}/firefox-chrome+xpcom-generate
308
309 %postun
310 if [ "$1" != "0" ]; then
311         %{_sbindir}/firefox-chrome+xpcom-generate
312 fi
313
314 %preun
315 if [ "$1" == "0" ]; then
316         rm -rf %{_firefoxdir}/chrome/overlayinfo
317         rm -f  %{_firefoxdir}/chrome/*.rdf
318         rm -rf %{_firefoxdir}/components
319         rm -rf %{_firefoxdir}/extensions
320 fi
321
322 %post lang-en
323 umask 022
324 cat %{_firefoxdir}/chrome/*-installed-chrome.txt >%{_firefoxdir}/chrome/installed-chrome.txt
325
326 %postun lang-en
327 umask 022
328 cat %{_firefoxdir}/chrome/*-installed-chrome.txt >%{_firefoxdir}/chrome/installed-chrome.txt
329
330 %files
331 %defattr(644,root,root,755)
332 %attr(755,root,root) %{_bindir}/mozilla*
333 %attr(755,root,root) %{_sbindir}/*
334 %dir %{_firefoxdir}
335 %{_firefoxdir}/res
336 %dir %{_firefoxdir}/components
337 %attr(755,root,root) %{_firefoxdir}/components/*.so
338 %{_firefoxdir}/components/*.js
339 %{_firefoxdir}/components/*.xpt
340 %{_firefoxdir}/plugins
341 %{_firefoxdir}/searchplugins
342 %{_firefoxdir}/icons
343 %{_firefoxdir}/defaults
344 %{_firefoxdir}/greprefs
345 %dir %{_firefoxdir}/init.d
346 %attr(755,root,root) %{_firefoxdir}/*.so
347 %attr(755,root,root) %{_firefoxdir}/*.sh
348 %attr(755,root,root) %{_firefoxdir}/m*
349 %attr(755,root,root) %{_firefoxdir}/f*
350 %attr(755,root,root) %{_firefoxdir}/reg*
351 %attr(755,root,root) %{_firefoxdir}/x*
352 %attr(755,root,root) %{_firefoxdir}/T*
353 %ifarch %{ix86}
354 %attr(755,root,root) %{_firefoxdir}/elf-dynstr-gc
355 %endif
356 %{_firefoxdir}/bloaturls.txt
357 %{_pixmapsdir}/*
358 %{_desktopdir}/*
359
360 %dir %{_firefoxdir}/chrome
361 %{_firefoxdir}/chrome/browser.jar
362 # -chat subpackage?
363 #%{_firefoxdir}/chrome/chatzilla.jar
364 %{_firefoxdir}/chrome/classic.jar
365 %{_firefoxdir}/chrome/comm.jar
366 #%{_firefoxdir}/chrome/content-packs.jar
367 %{_firefoxdir}/chrome/help.jar
368 # -dom-inspector subpackage?
369 %{_firefoxdir}/chrome/inspector.jar
370 %{_firefoxdir}/chrome/modern.jar
371 %{_firefoxdir}/chrome/pip*.jar
372 %{_firefoxdir}/chrome/toolkit.jar
373 %{_firefoxdir}/chrome/mozilla-firefox-misc-installed-chrome.txt
374 %ghost %{_firefoxdir}/chrome/installed-chrome.txt
375 %dir %{_firefoxdir}/chrome/icons
376 %{_firefoxdir}/chrome/icons/default
377
378 %files devel
379 %defattr(644,root,root,755)
380 %attr(755,root,root) %{_bindir}/regchrome
381 %attr(755,root,root) %{_bindir}/regxpcom
382 %attr(755,root,root) %{_bindir}/xpidl
383 %attr(755,root,root) %{_bindir}/xpt_dump
384 %attr(755,root,root) %{_bindir}/xpt_link
385 %{_includedir}/%{name}
386 %{_pkgconfigdir}/*
387
388 %files lang-en
389 %defattr(644,root,root,755)
390 %{_firefoxdir}/chrome/en-US.jar
391 %{_firefoxdir}/chrome/mozilla-firefox-en-US-installed-chrome.txt
This page took 0.078784 seconds and 4 git commands to generate.