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