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