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