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