]> git.pld-linux.org Git - packages/firefox.git/blob - mozilla-firefox.spec
- mozilla-firefox-lang.patch seems to do nothing. removed
[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
15 Release:        4
16 License:        MPL/LGPL
17 Group:          X11/Applications/Networking
18 Source0:        http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/%{version}/source/firefox-%{version}-source.tar.bz2
19 # Source0-md5:  fa915ddcadecda30ed3e13694f26a779
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 # official patches
28 # certain ui operations cause prolonged hang (cpu at 100%)
29 Patch100:       %{name}-bug305970.patch
30 # UPDATE or DROP?
31 #PatchX:                %{name}-searchplugins.patch
32 URL:            http://www.mozilla.org/projects/firefox/
33 %{?with_gnome:BuildRequires:    GConf2-devel >= 1.2.1}
34 BuildRequires:  automake
35 BuildRequires:  cairo-devel >= 1.0.0
36 BuildRequires:  gtk+2-devel >= 1:2.0.0
37 BuildRequires:  heimdal-devel >= 0.7.1
38 %{?with_gnome:BuildRequires:    gnome-vfs2-devel >= 2.0}
39 BuildRequires:  libIDL-devel >= 0.8.0
40 %{?with_gnome:BuildRequires:    libgnome-devel >= 2.0}
41 %{?with_gnome:BuildRequires:    libgnomeui-devel >= 2.2.0}
42 BuildRequires:  libjpeg-devel >= 6b
43 BuildRequires:  libpng-devel >= 1.2.0
44 BuildRequires:  libstdc++-devel
45 BuildRequires:  nspr-devel >= 1:4.6-0.20041030.1
46 BuildRequires:  nss-devel >= 3.8
47 BuildRequires:  pango-devel >= 1:1.6.0
48 BuildRequires:  perl-modules >= 5.004
49 BuildRequires:  pkgconfig
50 BuildRequires:  zip
51 Requires:       %{name}-lang-resources = %{version}
52 Requires:       nspr >= 1:4.6-0.20041030.1
53 Requires:       nss >= 3.8
54 # for /etc/ld.so.conf.d
55 Requires:       glibc >= 6:2.3.5-7.6
56 Requires(post,postun):  /sbin/ldconfig
57 Obsoletes:      mozilla-firebird
58 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59
60 %define         _firefoxdir     %{_libdir}/%{name}
61 # mozilla and firefox provide their own versions
62 %define         _noautoreqdep           libgkgfx.so libgtkembedmoz.so libgtkxtbin.so libjsj.so libmozjs.so libxpcom.so libxpcom_compat.so
63 %define         _noautoprovfiles        libplc4.so libplds4.so
64
65 %description
66 Mozilla Firefox is an open-source web browser, designed for standards
67 compliance, performance and portability.
68
69 %description -l pl
70 Mozilla Firefox jest open sourcow± przegl±dark± sieci WWW, stworzon± z
71 my¶l± o zgodno¶ci ze standardami, wydajno¶ci± i przeno¶no¶ci±.
72
73 %package devel
74 Summary:        Headers for developing programs that will use Mozilla Firefox
75 Summary(pl):    Mozilla Firefox - pliki nag³ówkowe i biblioteki
76 Group:          X11/Development/Libraries
77 Obsoletes:      mozilla-devel
78 Requires:       %{name} = %{epoch}:%{version}-%{release}
79 Requires:       nspr-devel >= 1:4.6-0.20041030.1
80
81 %description devel
82 Mozilla development package.
83
84 %description devel -l pl
85 Biblioteki i pliki nag³ówkowe.
86
87 %package lang-en
88 Summary:        English resources for Mozilla-firefox
89 Summary(pl):    Anglojêzyczne zasoby dla Mozilla-FireFox
90 Group:          X11/Applications/Networking
91 Requires(post,postun):  %{name} = %{version}-%{release}
92 Requires(post,postun):  textutils
93 Requires:       %{name} = %{version}-%{release}
94 Provides:       %{name}-lang-resources = %{version}-%{release}
95
96 %description lang-en
97 English resources for Mozilla-firefox
98
99 %description lang-en -l pl
100 Anglojêzyczne zasoby dla Mozilla-FireFox
101
102 %prep
103 %setup -q -n mozilla
104 %patch0 -p1
105 %patch1 -p1
106 %patch2 -p1
107 %patch3 -p1
108 %patch4 -p1
109
110 # official patches
111 %patch100 -p1
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 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 %{__make} -C xpinstall/packager \
202         MOZ_PKG_APPNAME="mozilla-firefox" \
203         MOZILLA_BIN="\$(DIST)/bin/firefox-bin" \
204         EXCLUDE_NSPR_LIBS=1
205
206 install %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox
207
208 tar -xvz -C $RPM_BUILD_ROOT%{_libdir} -f dist/mozilla-firefox-*linux*.tar.gz
209
210 install other-licenses/branding/firefox/content/icon64.png $RPM_BUILD_ROOT%{_pixmapsdir}/mozilla-firefox.png
211 #install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/
212 #install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/US/
213
214 install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
215
216 #grep locale $RPM_BUILD_ROOT%{_firefoxdir}/chrome/installed-chrome.txt > $RPM_BUILD_ROOT%{_firefoxdir}/chrome/%{name}-en-US-installed-chrome.txt
217 #grep -v locale $RPM_BUILD_ROOT%{_firefoxdir}/chrome/installed-chrome.txt > $RPM_BUILD_ROOT%{_firefoxdir}/chrome/%{name}-misc-installed-chrome.txt
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 #There is no such files (*-installed-chrome.txt). IMO obsolete.
257 #cat %{_firefoxdir}/chrome/*-installed-chrome.txt > %{_firefoxdir}/chrome/installed-chrome.txt
258 rm -f %{_firefoxdir}/chrome/{chrome.rdf,overlayinfo/*/*/*.rdf}
259 rm -f %{_firefoxdir}/components/{compreg,xpti}.dat
260 MOZILLA_FIVE_HOME=%{_firefoxdir}
261 export MOZILLA_FIVE_HOME
262
263 # PATH
264 PATH=%{_firefoxdir}:$PATH
265 export PATH
266
267 # added /usr/lib : don't load your local library
268 LD_LIBRARY_PATH=%{_firefoxdir}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
269 export LD_LIBRARY_PATH
270
271 unset TMPDIR TMP || :
272 MOZILLA_FIVE_HOME=%{_firefoxdir} %{_firefoxdir}/regxpcom
273 MOZILLA_FIVE_HOME=%{_firefoxdir} %{_firefoxdir}/firefox -register
274 EOF
275
276 %clean
277 rm -rf $RPM_BUILD_ROOT
278
279 %post
280 /sbin/ldconfig
281 %{_sbindir}/firefox-chrome+xpcom-generate
282 %banner %{name} -e <<EOF
283 ###################################################################
284 #                                                                 #
285 # NOTICE:                                                         #
286 # If you have problem with upgrade old mozilla-firefox 1.0.x, you #
287 # should remove it first.                                         #
288 #                                                                 #
289 ###################################################################
290 EOF
291
292 %postun
293 /sbin/ldconfig
294 if [ "$1" != "0" ]; then
295         %{_sbindir}/firefox-chrome+xpcom-generate
296 fi
297
298 %preun
299 if [ "$1" == "0" ]; then
300         rm -rf %{_firefoxdir}/chrome/overlayinfo
301         rm -f  %{_firefoxdir}/chrome/*.rdf
302         rm -rf %{_firefoxdir}/components
303         rm -rf %{_firefoxdir}/extensions
304 fi
305
306 #%post lang-en
307 #umask 022
308 #cat %{_firefoxdir}/chrome/*-installed-chrome.txt >%{_firefoxdir}/chrome/installed-chrome.txt
309
310 #%postun lang-en
311 #umask 022
312 #cat %{_firefoxdir}/chrome/*-installed-chrome.txt >%{_firefoxdir}/chrome/installed-chrome.txt
313
314 %files
315 %defattr(644,root,root,755)
316 %attr(755,root,root) %{_bindir}/mozilla*
317 %attr(755,root,root) %{_sbindir}/*
318 %dir %{_firefoxdir}
319 %{_firefoxdir}/res
320 %dir %{_firefoxdir}/components
321 %attr(755,root,root) %{_firefoxdir}/components/*.so
322 %{_firefoxdir}/components/*.js
323 %{_firefoxdir}/components/*.xpt
324 %{_firefoxdir}/plugins
325 %{_firefoxdir}/searchplugins
326 %{_firefoxdir}/icons
327 %{_firefoxdir}/defaults
328 %{_firefoxdir}/greprefs
329 %dir %{_firefoxdir}/extensions
330 %dir %{_firefoxdir}/init.d
331 %attr(755,root,root) %{_firefoxdir}/*.so
332 %attr(755,root,root) %{_firefoxdir}/*.sh
333 %attr(755,root,root) %{_firefoxdir}/m*
334 %attr(755,root,root) %{_firefoxdir}/f*
335 %attr(755,root,root) %{_firefoxdir}/reg*
336 %attr(755,root,root) %{_firefoxdir}/x*
337 %{_pixmapsdir}/*
338 %{_desktopdir}/*
339
340 %dir %{_firefoxdir}/chrome
341 %{_firefoxdir}/chrome/*.jar
342 %{_firefoxdir}/chrome/*.manifest
343 # -chat subpackage?
344 #%{_firefoxdir}/chrome/chatzilla.jar
345 #%{_firefoxdir}/chrome/content-packs.jar
346 # -dom-inspector subpackage?
347 #%{_firefoxdir}/chrome/inspector.jar
348 #%{_firefoxdir}/chrome/mozilla-firefox-misc-installed-chrome.txt
349 %dir %{_firefoxdir}/chrome/icons
350 %{_firefoxdir}/chrome/icons/default
351
352 %files devel
353 %defattr(644,root,root,755)
354 %attr(755,root,root) %{_bindir}/regxpcom
355 %attr(755,root,root) %{_bindir}/xpidl
356 %attr(755,root,root) %{_bindir}/xpt_dump
357 %attr(755,root,root) %{_bindir}/xpt_link
358 %{_includedir}/%{name}
359 %{_pkgconfigdir}/*
360
361 %files lang-en
362 %defattr(644,root,root,755)
363 %{_firefoxdir}/chrome/en-US.jar
364 %{_firefoxdir}/chrome/en-US.manifest
365 #%{_firefoxdir}/chrome/mozilla-firefox-en-US-installed-chrome.txt
This page took 0.100529 seconds and 4 git commands to generate.