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