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