|
1 # |
|
2 # spec file for package MozillaFirefox (Version 3.6b4) |
|
3 # |
|
4 # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. |
|
5 # Copyright (c) 2006-2009 Wolfgang Rosenauer |
|
6 # |
|
7 # All modifications and additions to the file contributed by third parties |
|
8 # remain the property of their copyright owners, unless otherwise agreed |
|
9 # upon. The license for this file, and modifications and additions to the |
|
10 # file, is the same license as for the pristine package itself (unless the |
|
11 # license for the pristine package is not an Open Source License, in which |
|
12 # case the license is the MIT License). An "Open Source License" is a |
|
13 # license that conforms to the Open Source Definition (Version 1.9) |
|
14 # published by the Open Source Initiative. |
|
15 |
|
16 # Please submit bugfixes or comments via http://bugs.opensuse.org/ |
|
17 # |
|
18 |
|
19 # norootforbuild |
|
20 |
|
21 |
|
22 Name: MozillaFirefox |
|
23 %define xulrunner mozilla-xulrunner192 |
|
24 BuildRequires: autoconf213 gcc-c++ libgnomeui-devel libidl-devel libnotify-devel orbit-devel python unzip update-desktop-files zip |
|
25 BuildRequires: %{xulrunner}-devel = 1.9.2b4 |
|
26 %if %suse_version > 1020 |
|
27 BuildRequires: fdupes |
|
28 %endif |
|
29 %if %suse_version > 1110 |
|
30 BuildRequires: libiw-devel |
|
31 %else |
|
32 BuildRequires: wireless-tools |
|
33 %endif |
|
34 License: GPL v2 or later ; LGPL v2.1 or later ; MPL 1.1 or later |
|
35 Provides: web_browser |
|
36 Provides: firefox |
|
37 Version: 3.6b4 |
|
38 Release: 1 |
|
39 %define releasedate 2009112600 |
|
40 Summary: Mozilla Firefox Web Browser |
|
41 Url: http://www.mozilla.org/ |
|
42 Group: Productivity/Networking/Web/Browsers |
|
43 Source: firefox-%{version}-source.tar.bz2 |
|
44 Source1: MozillaFirefox.desktop |
|
45 Source2: %{name}-rpmlintrc |
|
46 Source3: mozilla.sh.in |
|
47 Source4: find-external-requires.sh |
|
48 # this needs to be shipped when lockdown changes are back |
|
49 Source5: firefox.schemas |
|
50 Source7: l10n-%{version}.tar.bz2 |
|
51 Source8: firefox-mimeinfo.xml |
|
52 Source16: firefox.1 |
|
53 Source17: firefox-suse-default-prefs.js |
|
54 Patch1: firefox-libxul-sdk.patch |
|
55 Patch2: firefox-credits.patch |
|
56 Patch3: toolkit-download-folder.patch |
|
57 Patch4: firefox-linkorder.patch |
|
58 Patch5: firefox-browser-css.patch |
|
59 Patch6: firefox-cross-desktop.patch |
|
60 #Patch7: firefox-kde.patch |
|
61 Patch8: firefox-no-gnomevfs.patch |
|
62 Patch17: firefox-appname.patch |
|
63 BuildRoot: %{_tmppath}/%{name}-%{version}-build |
|
64 PreReq: coreutils /bin/sh shared-mime-info desktop-file-utils |
|
65 Requires: %{xulrunner} >= %(rpm -q --queryformat '%{VERSION}-%{RELEASE}' %{xulrunner}) |
|
66 %requires_eq %{xulrunner} |
|
67 %ifarch %ix86 |
|
68 Requires: %{xulrunner}-32bit >= %(rpm -q --queryformat '%{VERSION}-%{RELEASE}' %{xulrunner}) |
|
69 Requires: %{xulrunner}-32bit = %(rpm -q --queryformat '%{VERSION}' %{xulrunner}) |
|
70 %endif |
|
71 Requires: %{name}-branding >= 3.5 |
|
72 %define _use_internal_dependency_generator 0 |
|
73 %define __find_requires sh %{SOURCE4} |
|
74 %global provfind sh -c "grep -v '.so' | %__find_provides" |
|
75 %global __find_provides %provfind |
|
76 %define progname firefox |
|
77 %define progdir %{_prefix}/%_lib/%{progname} |
|
78 %if %suse_version > 1020 |
|
79 %define gnome_dir %{_prefix} |
|
80 %else |
|
81 %define gnome_dir /opt/gnome |
|
82 %endif |
|
83 ### build options |
|
84 %define branding 1 |
|
85 %define localize 1 |
|
86 ### build options end |
|
87 |
|
88 %description |
|
89 Mozilla Firefox is a standalone web browser, designed for standards |
|
90 compliance and performance. Its functionality can be enhanced via a |
|
91 plethora of extensions. |
|
92 |
|
93 |
|
94 %if %localize |
|
95 %package translations-common |
|
96 Summary: Common translations for MozillaFirefox |
|
97 License: GPL v2 or later ; LGPL v2.1 or later ; MPL 1.1 or later |
|
98 Provides: locale(%{name}:ar;ca;cs;da;de;en_GB;es_AR;es_CL;es_ES;fi;fr;hu;it;ja;ko;nb_NO;nl;pl;pt_BR;pt_PT;ru;sv_SE;zh_CN;zh_TW) |
|
99 Group: System/Localization |
|
100 PreReq: %{name} = %{version} |
|
101 Requires: %{xulrunner}-translations-common |
|
102 Obsoletes: %{name}-translations < %{version}-%{release} |
|
103 |
|
104 %description translations-common |
|
105 This package contains several common languages for the user interface |
|
106 of MozillaFirefox. |
|
107 |
|
108 %package translations-other |
|
109 Summary: Extra translations for MozillaFirefox |
|
110 License: GPL v2 or later ; LGPL v2.1 or later ; MPL 1.1 or later |
|
111 Provides: locale(%{name}:be;bn_BD;cy;el;eo;et;eu;fa;fy_NL;ga_IE;gl;gu_IN;he;hi_IN;id;is;kk;kn;lt;lv;mk;ml;mr;nn_NO;or;pa_IN;rm;ro;si;sk;sl;sq;ta;ta_LK;te;tr;uk) |
|
112 Group: System/Localization |
|
113 PreReq: %{name} = %{version} |
|
114 Requires: %{xulrunner}-translations-other |
|
115 Obsoletes: %{name}-translations < %{version}-%{release} |
|
116 |
|
117 %description translations-other |
|
118 This package contains rarely used languages for the user interface |
|
119 of MozillaFirefox. |
|
120 |
|
121 %endif |
|
122 |
|
123 %package branding-upstream |
|
124 License: GPL v2 or later ; LGPL v2.1 or later ; MPL 1.1 or later |
|
125 Summary: Upstream branding for MozillaFirefox |
|
126 Group: Productivity/Networking/Web/Browsers |
|
127 Provides: %{name}-branding = 3.5 |
|
128 Conflicts: otherproviders(%{name}-branding) |
|
129 Supplements: packageand(%{name}:branding-upstream) |
|
130 #BRAND: Provide three files - |
|
131 #BRAND: /usr/lib/firefox/browserconfig.properties that contains the |
|
132 #BRAND: default homepage and some other default configuration options |
|
133 #BRAND: /usr/lib/firefox/defaults/profile/bookmarks.html that contains |
|
134 #BRAND: the list of default bookmarks |
|
135 #BRAND: /etc/gconf/schemas/firefox.schemas |
|
136 #BRAND: for mapping some Firefox prefs to gconf |
|
137 #BRAND: It's also possible to create a file |
|
138 #BRAND: /usr/lib/firefox/defaults/preferences/firefox-$vendor.js to set |
|
139 #BRAND: custom preference overrides. |
|
140 #BRAND: It's also possible to drop files in /usr/lib/firefox/searchplugins |
|
141 |
|
142 %description branding-upstream |
|
143 This package provides upstream look and feel for MozillaFirefox. |
|
144 |
|
145 |
|
146 %prep |
|
147 %setup -q -n mozilla -b 7 |
|
148 cd $RPM_BUILD_DIR/mozilla |
|
149 %patch1 -p1 |
|
150 %patch2 -p1 |
|
151 %patch3 -p1 |
|
152 %patch4 -p1 |
|
153 #%patch5 -p1 # FIXME |
|
154 %patch6 -p1 |
|
155 %patch8 -p1 |
|
156 %patch17 -p1 |
|
157 |
|
158 %build |
|
159 export MOZ_BUILD_DATE=%{releasedate} |
|
160 export MOZILLA_OFFICIAL=1 |
|
161 export BUILD_OFFICIAL=1 |
|
162 export CFLAGS="$RPM_OPT_FLAGS -Os -fno-strict-aliasing" |
|
163 export CXXFLAGS="$CFLAGS" |
|
164 # 10.3-x86_64 build fails probably because gcc bug |
|
165 %if %suse_version == 1030 |
|
166 %ifarch x86_64 |
|
167 export ac_cv_visibility_hidden="no" |
|
168 %endif |
|
169 %endif |
|
170 export MOZCONFIG=$RPM_BUILD_DIR/mozconfig |
|
171 SDKDIR=$(pkg-config --variable=sdkdir libxul) |
|
172 cat << EOF > $MOZCONFIG |
|
173 mk_add_options MOZILLA_OFFICIAL=1 |
|
174 mk_add_options BUILD_OFFICIAL=1 |
|
175 mk_add_options MOZ_MAKE_FLAGS=%{?jobs:-j%jobs} |
|
176 . \$topsrcdir/browser/config/mozconfig |
|
177 ac_add_options --prefix=%{_prefix} |
|
178 ac_add_options --libdir=%{_libdir} |
|
179 ac_add_options --sysconfdir=%{_sysconfdir} |
|
180 ac_add_options --mandir=%{_mandir} |
|
181 ac_add_options --includedir=%{_includedir} |
|
182 ac_add_options --with-system-nspr |
|
183 ac_add_options --with-system-nss |
|
184 ac_add_options --with-libxul-sdk=$SDKDIR |
|
185 ac_add_options --with-l10n-base=../l10n |
|
186 ac_add_options --with-system-jpeg |
|
187 #ac_add_options --with-system-png # doesn't work because of missing APNG support |
|
188 ac_add_options --with-system-zlib |
|
189 ac_add_options --disable-installer |
|
190 ac_add_options --disable-updater |
|
191 ac_add_options --disable-tests |
|
192 ac_add_options --disable-debug |
|
193 ac_add_options --disable-crashreporter |
|
194 EOF |
|
195 %if %branding |
|
196 cat << EOF >> $MOZCONFIG |
|
197 ac_add_options --enable-official-branding |
|
198 EOF |
|
199 %endif |
|
200 make -f client.mk build |
|
201 |
|
202 %install |
|
203 make -C browser/installer STRIP=/bin/true |
|
204 # copy tree into RPM_BUILD_ROOT |
|
205 mkdir -p $RPM_BUILD_ROOT/%{progdir} |
|
206 cp -rf $RPM_BUILD_DIR/mozilla/dist/firefox/* $RPM_BUILD_ROOT/%{progdir} |
|
207 # install additional locales |
|
208 %if %localize |
|
209 rm -f %{_tmppath}/translations.* |
|
210 for locale in $(awk '{ print $1; }' browser/locales/shipped-locales); do |
|
211 case $locale in |
|
212 ja-JP-mac|en-US) |
|
213 ;; |
|
214 *) |
|
215 make -C browser/locales libs-$locale |
|
216 cp dist/xpi-stage/locale-$locale/chrome/$locale.jar \ |
|
217 $RPM_BUILD_ROOT%{progdir}/chrome |
|
218 cp dist/xpi-stage/locale-$locale/chrome/$locale.manifest \ |
|
219 $RPM_BUILD_ROOT%{progdir}/chrome |
|
220 # check against the fixed common list and sort into the right filelist |
|
221 _matched=0 |
|
222 for _match in ar ca cs da de en-GB es-AR es-CL es-ES fi fr hu it ja ko nb-NO nl pl pt-BR pt-PT ru sv-SE zh-CN zh-TW; do |
|
223 [ "$_match" = "$locale" ] && _matched=1 |
|
224 done |
|
225 [ $_matched -eq 1 ] && _l10ntarget=common || _l10ntarget=other |
|
226 echo %{progdir}/chrome/$locale.jar >> %{_tmppath}/translations.$_l10ntarget |
|
227 echo %{progdir}/chrome/$locale.manifest >> %{_tmppath}/translations.$_l10ntarget |
|
228 esac |
|
229 done |
|
230 %endif |
|
231 # overwrite the mozilla start-script and link it to /usr/bin |
|
232 mkdir --parents $RPM_BUILD_ROOT/usr/bin |
|
233 sed "s:%%PREFIX:%{_prefix}:g |
|
234 s:%%PROGDIR:%{progdir}:g |
|
235 s:%%APPNAME:%{progname}:g |
|
236 s:%%PROFILE:.mozilla/firefox:g" \ |
|
237 %{SOURCE3} > $RPM_BUILD_ROOT%{progdir}/%{progname}.sh |
|
238 chmod 755 $RPM_BUILD_ROOT%{progdir}/%{progname}.sh |
|
239 ln -sf ../..%{progdir}/%{progname}.sh $RPM_BUILD_ROOT%{_bindir}/%{progname} |
|
240 # desktop definition |
|
241 mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications |
|
242 install -m 644 %{SOURCE1} \ |
|
243 $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop |
|
244 # additional mime-types |
|
245 mkdir -p $RPM_BUILD_ROOT%{_datadir}/mime/packages |
|
246 cp %{SOURCE8} $RPM_BUILD_ROOT%{_datadir}/mime/packages/%{progname}.xml |
|
247 # install man-page |
|
248 mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1/ |
|
249 cp %{SOURCE16} $RPM_BUILD_ROOT%{_mandir}/man1/%{progname}.1 |
|
250 # apply SUSE defaults |
|
251 sed -e 's,RPM_VERSION,%{version}-%{release},g' \ |
|
252 %{SOURCE17} > suse-default-prefs |
|
253 cp suse-default-prefs $RPM_BUILD_ROOT%{progdir}/defaults/preferences/firefox-build.js |
|
254 rm suse-default-prefs |
|
255 # use correct locale for useragent |
|
256 cat > $RPM_BUILD_ROOT%{progdir}/defaults/preferences/firefox-l10n.js << EOF |
|
257 pref("general.useragent.locale", "chrome://global/locale/intl.properties"); |
|
258 EOF |
|
259 ########## |
|
260 # ADDONS |
|
261 # |
|
262 mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps/ |
|
263 ln -sf %{progdir}/icons/mozicon128.png $RPM_BUILD_ROOT/usr/share/pixmaps/%{progname}.png |
|
264 ln -sf %{progdir}/icons/mozicon128.png $RPM_BUILD_ROOT/usr/share/pixmaps/%{progname}-gnome.png |
|
265 %if %branding |
|
266 for size in 16 32 48; do |
|
267 mkdir -p $RPM_BUILD_ROOT%{gnome_dir}/share/icons/hicolor/${size}x${size}/apps/ |
|
268 ln -sf %{progdir}/chrome/icons/default/default$size.png \ |
|
269 $RPM_BUILD_ROOT%{gnome_dir}/share/icons/hicolor/${size}x${size}/apps/%{progname}.png |
|
270 done |
|
271 %endif |
|
272 %suse_update_desktop_file %{name} Network WebBrowser X-Ximian-Main X-Ximian-Toplevel GTK |
|
273 # excludes |
|
274 rm -f $RPM_BUILD_ROOT%{progdir}/updater.ini |
|
275 rm -f $RPM_BUILD_ROOT%{progdir}/removed-files |
|
276 rm -f $RPM_BUILD_ROOT%{progdir}/README.txt |
|
277 rm -f $RPM_BUILD_ROOT%{progdir}/old-homepage-default.properties |
|
278 rm -f $RPM_BUILD_ROOT%{progdir}/run-mozilla.sh |
|
279 rm -f $RPM_BUILD_ROOT%{progdir}/LICENSE |
|
280 # fdupes |
|
281 %if %suse_version > 1020 |
|
282 %fdupes $RPM_BUILD_ROOT%{progdir} |
|
283 %fdupes $RPM_BUILD_ROOT%{_datadir} |
|
284 %endif |
|
285 |
|
286 %clean |
|
287 rm -rf $RPM_BUILD_ROOT |
|
288 %if %localize |
|
289 rm -rf %{_tmppath}/translations.* |
|
290 %endif |
|
291 |
|
292 %post |
|
293 # update mime and desktop database |
|
294 if [ -f usr/bin/update-mime-database ] ; then |
|
295 usr/bin/update-mime-database %{_datadir}/mime > /dev/null || : |
|
296 fi |
|
297 %if %suse_version >= 1030 |
|
298 if [ -f usr/bin/update-desktop-database ] ; then |
|
299 usr/bin/update-desktop-database > /dev/null || : |
|
300 fi |
|
301 %else |
|
302 if [ -f opt/gnome/bin/update-mime-database ] ; then |
|
303 opt/gnome/bin/update-mime-database > /dev/null || : |
|
304 fi |
|
305 %endif |
|
306 # move plugins to new location |
|
307 if [ "$1" = "2" ]; then |
|
308 if [ -d /opt/MozillaFirefox/%{_lib}/plugins ]; then |
|
309 rm -rf /opt/MozillaFirefox/%{_lib}/plugins/libnullplugin.so |
|
310 cp -fud /opt/MozillaFirefox/%{_lib}/plugins/* %{progdir}/plugins |
|
311 rm -rf /opt/MozillaFirefox/%{_lib}/plugins |
|
312 fi |
|
313 fi |
|
314 exit 0 |
|
315 |
|
316 %postun |
|
317 if [ -f usr/bin/update-mime-database ] ; then |
|
318 usr/bin/update-mime-database %{_datadir}/mime > /dev/null || : |
|
319 fi |
|
320 %if %suse_version >= 1030 |
|
321 if [ -f usr/bin/update-desktop-database ] ; then |
|
322 usr/bin/update-desktop-database > /dev/null || : |
|
323 fi |
|
324 %else |
|
325 if [ -f opt/gnome/bin/update-mime-database ] ; then |
|
326 opt/gnome/bin/update-mime-database > /dev/null || : |
|
327 fi |
|
328 %endif |
|
329 |
|
330 %files |
|
331 %defattr(-,root,root) |
|
332 %dir %{progdir} |
|
333 %dir %{progdir}/chrome/ |
|
334 %{progdir}/chrome/browser.* |
|
335 %{progdir}/chrome/classic.* |
|
336 %{progdir}/chrome/en-US.* |
|
337 %{progdir}/chrome/reporter.* |
|
338 %{progdir}/chrome/icons |
|
339 %{progdir}/components/ |
|
340 %exclude %{progdir}/defaults/profile/bookmarks.html |
|
341 %{progdir}/defaults/ |
|
342 %{progdir}/extensions/ |
|
343 %{progdir}/icons/ |
|
344 %{progdir}/searchplugins/ |
|
345 %{progdir}/modules/ |
|
346 %attr(755,root,root) %{progdir}/%{progname}.sh |
|
347 %{progdir}/%{progname} |
|
348 %{progdir}/application.ini |
|
349 %{progdir}/blocklist.xml |
|
350 %{_datadir}/applications/%{name}.desktop |
|
351 %{_datadir}/mime/packages/%{progname}.xml |
|
352 %{_datadir}/pixmaps/firefox* |
|
353 %if %branding |
|
354 %{gnome_dir}/share/icons/hicolor/ |
|
355 %endif |
|
356 %{_bindir}/%{progname} |
|
357 %doc %{_mandir}/man1/%{progname}.1.gz |
|
358 %if %localize |
|
359 |
|
360 %files translations-common -f %{_tmppath}/translations.common |
|
361 %defattr(-,root,root) |
|
362 |
|
363 %files translations-other -f %{_tmppath}/translations.other |
|
364 %defattr(-,root,root) |
|
365 %endif |
|
366 |
|
367 %files branding-upstream |
|
368 %defattr(-,root,root) |
|
369 %{progdir}/browserconfig.properties |
|
370 %{progdir}/defaults/profile/bookmarks.html |
|
371 |
|
372 %changelog |