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