]> git.pld-linux.org Git - packages/firefox.git/blob - mozilla-firefox.spec
- searchplugins fixed
[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_with     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.4
15 Release:        6
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:  0f5d0586750fde79ba98ecf3ee4425a7
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 URL:            http://www.mozilla.org/projects/firefox/
29 BuildRequires:  automake
30 %if %{with ft218}
31 BuildRequires:  freetype-devel >= 1:2.1.9
32 %else
33 BuildRequires:  freetype-devel >= 2.1.3
34 BuildRequires:  freetype-devel < 1:2.1.8
35 BuildConflicts: freetype-devel = 2.1.8
36 %endif
37 BuildRequires:  gtk+2-devel >= 1:2.0.0
38 BuildRequires:  libIDL-devel >= 0.8.0
39 BuildRequires:  libjpeg-devel >= 6b
40 BuildRequires:  libpng-devel >= 1.2.0
41 BuildRequires:  libstdc++-devel
42 BuildRequires:  nspr-devel >= 1:4.6-0.20041030.1
43 BuildRequires:  nss-devel >= 3.8
44 BuildRequires:  pango-devel >= 1:1.1.0
45 BuildRequires:  perl-modules
46 BuildRequires:  pkgconfig
47 BuildRequires:  zip
48 BuildRequires:  heimdal-devel >= 0.7
49 Requires:       %{name}-lang-resources = %{version}
50 %if %{with ft218}
51 Requires:       freetype >= 1:2.1.3
52 %else
53 Requires:       freetype >= 2.1.3
54 Conflicts:      freetype = 2.1.8
55 %endif
56 Requires:       nspr >= 1:4.6-0.20041030.1
57 Requires:       nss >= 3.8
58 Obsoletes:      mozilla-firebird
59 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60
61 %define         _firefoxdir     %{_libdir}/%{name}
62 # mozilla and firefox provide their own versions
63 %define         _noautoreqdep           libgkgfx.so libgtkembedmoz.so libgtkxtbin.so libjsj.so libmozjs.so libxpcom.so libxpcom_compat.so
64 %define         _noautoprovfiles        libplc4.so libplds4.so
65
66 %description
67 Mozilla Firefox is an open-source web browser, designed for standards
68 compliance, performance and portability.
69
70 %description -l pl
71 Mozilla Firefox jest open sourcow± przegl±dark± sieci WWW, stworzon± z
72 my¶l± o zgodno¶ci ze standardami, wydajno¶ci± i przeno¶no¶ci±.
73
74 %package devel
75 Summary:        Headers for developing programs that will use Mozilla Firefox
76 Summary(pl):    Mozilla Firefox - pliki nag³ówkowe i biblioteki
77 Group:          X11/Development/Libraries
78 Obsoletes:      mozilla-devel
79 Requires:       %{name} = %{epoch}:%{version}-%{release}
80 Requires:       nspr-devel >= 1:4.6-0.20041030.1
81
82 %description devel
83 Mozilla development package.
84
85 %description devel -l pl
86 Biblioteki i pliki nag³ówkowe.
87
88 %package lang-en
89 Summary:        English resources for Mozilla-firefox
90 Summary(pl):    Anglojêzyczne zasoby dla Mozilla-FireFox
91 Group:          X11/Applications/Networking
92 Requires(post,postun):  %{name} = %{version}-%{release}
93 Requires(post,postun):  textutils
94 Requires:       %{name} = %{version}-%{release}
95 Provides:       %{name}-lang-resources = %{version}-%{release}
96
97 %description lang-en
98 English resources for Mozilla-firefox
99
100 %description lang-en -l pl
101 Anglojêzyczne zasoby dla Mozilla-FireFox
102
103 %prep
104 %setup -q -n mozilla
105 %patch0 -p1
106 %patch1 -p1
107 %patch2 -p1
108 %patch3 -p1
109 %{?with_ft218:%patch4 -p1}
110 %patch5 -p0
111 sed -i 's/\(-lgss\)\(\W\)/\1disable\2/' configure
112
113 %build
114 export CFLAGS="%{rpmcflags}"
115 export CXXFLAGS="%{rpmcflags}"
116 export MOZ_PHOENIX="1"
117 export BUILD_OFFICIAL="1"
118 export MOZILLA_OFFICIAL="1"
119
120 cp -f %{_datadir}/automake/config.* build/autoconf
121 cp -f %{_datadir}/automake/config.* nsprpub/build/autoconf
122 cp -f %{_datadir}/automake/config.* directory/c-sdk/config/autoconf
123 %configure2_13 \
124 %if %{?debug:1}0
125         --enable-debug \
126         --enable-debug-modules \
127 %else
128         --disable-debug \
129         --disable-debug-modules \
130 %endif
131         --disable-composer \
132         --disable-dtd-debug \
133         --disable-installer \
134         --disable-jsd \
135         --disable-ldap \
136         --disable-mailnews \
137 %if %{with tests}
138         --enable-tests \
139 %else
140         --disable-tests \
141 %endif
142         --disable-xprint \
143         --enable-crypto \
144         --enable-freetype2 \
145         --enable-mathml \
146         --enable-optimize="%{rpmcflags}" \
147         --enable-plaintext-editor-only \
148         --enable-reorder \
149         --enable-strip \
150         --enable-strip-libs \
151         --enable-xinerama \
152         --enable-xft \
153         --enable-default-toolkit="gtk2" \
154         --with-pthreads \
155         --with-system-nspr \
156         --with-system-jpeg \
157         --with-system-png \
158         --with-system-zlib \
159         --enable-single-profile \
160         --disable-profilesharing \
161         --enable-extensions=cookie,xml-rpc,xmlextras,pref,transformiix,universalchardet,webservices,inspector,gnomevfs,negotiateauth
162         
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.063026 seconds and 4 git commands to generate.