2 # - move translations into a separate, noarch package
3 # - add kestrel (snap) x86_64 version (yes, it's available)
4 # - drop those dozens of if statements and use branches for different sources
6 %bcond_without shared # static or shared version
7 %bcond_without distributable # distributable or not
8 %bcond_without incall # include all tarballs into src.rpm (but splitted into shared/static)
9 %bcond_with snap # snap version
10 %bcond_with weekly # weekly snapshot version
20 %define dirrel 20070809
21 %define reltype %{nil}
29 %define dirrel 20070903
30 %define reltype Alpha-1
36 %define dirrel 20070809
42 %define shver %(echo %{ver} | tr -d .)%{fix}
43 %define x86_shared_rel %{dirrel}.5
44 %define x86_static_rel %{dirrel}.1
45 %define sparc_shared_rel %{dirrel}.2
46 %define sparc_static_rel %{dirrel}.1
47 %define ppc_shared_rel %{dirrel}.3
48 %define ppc_static_rel %{dirrel}.1
51 # We should be able to build src.rpm also on not supported archs
52 %define rel %{x86_shared_rel}
54 #%%define rel %{sparc_shared_rel}
55 %define rel %{sparc_static_rel}
58 %define rel %{ppc_shared_rel}
63 %define rel %{x86_static_rel}
65 %define rel %{sparc_static_rel}
68 %define rel %{ppc_static_rel}
73 # define to 0 and then redefine to avoid
75 %define need_ix86_shared_snap 0
76 %define need_sparc_shared_snap 0
77 %define need_ppc_shared_snap 0
78 %define need_ix86_static_snap 0
79 %define need_sparc_static_snap 0
80 %define need_ppc_static_snap 0
82 %define need_ix86_shared 0
83 %define need_sparc_shared 0
84 %define need_ppc_shared 0
85 %define need_ix86_static 0
86 %define need_sparc_static 0
87 %define need_ppc_static 0
95 %define need_ix86_shared_snap 1
96 %define need_sparc_shared_snap 0
97 %define need_ppc_shared_snap 1
100 %define need_ix86_static_snap 1
101 %define need_sparc_static_snap 1
102 %define need_ppc_static_snap 1
104 # with shared; [endif]
109 %define need_ix86_shared 1
110 #%%define need_sparc_shared 1
111 %define need_sparc_static 1
112 %define need_ppc_shared 1
114 # with shared: [else]
115 %define need_ix86_static 1
116 %define need_sparc_static 1
117 %define need_ppc_static 1
119 # with shared; [endif]
123 # with incall: [else]
130 %define need_ix86_shared_snap 1
132 # with shared: [else]
133 %define need_ix86_static_snap 1
135 # with shared; [endif]
140 %define need_ix86_shared 1
142 # with shared: [else]
143 %define need_ix86_static 1
145 # with shared; [endif]
150 %ifarch sparc sparc64
156 %define need_sparc_shared_snap 1
158 # with shared: [else]
159 %define need_sparc_static_snap 1
161 # with shared; [endif]
166 #%%define need_sparc_shared 1
167 %define need_sparc_static 1
169 # with shared: [else]
170 %define need_sparc_static 1
172 # with shared; [endif]
183 %define need_ppc_shared_snap 1
185 # with shared: [else]
186 %define need_ppc_static_snap 1
188 # with shared; [endif]
193 %define need_ppc_shared 1
195 # with shared: [else]
196 %define need_ppc_static 1
198 # with shared; [endif]
208 # with incall; [endif]
211 %define need_ppc_shared_snap 0
212 %define need_ppc_static_snap 0
213 %define need_sparc_shared_snap 0
214 %define need_sparc_static_snap 0
218 Summary: World fastest web browser
219 Summary(pl.UTF-8): Najszybsza przeglądarka WWW na świecie
221 Version: %{ver}%{fix}
222 Release: %{?with_snap:1.%{rel}.}%{_rel}
224 License: Distributable for PLD until 31 Dec 2006 - http://distribute.opera.com/ (otherwise restricted, see file LICENSE)
225 Group: X11/Applications/Networking
227 %if %{need_ix86_static}
228 Source0: ftp://ftp.opera.com/pub/opera/linux/%{shver}/%{reltype}/en/i386/static/%{name}-%{sver}-%{x86_static_rel}-static-qt.i386-en.tar.bz2
229 # Source0-md5: 0c721abff854df6c8ec7746956a37f55
230 %{!?with_distributable:NoSource: 0}
233 %if %{need_ix86_static_snap}
235 Source30100: http://snapshot.opera.com/unix/Weekly-%{magicstr}/intel-linux/%{name}-%{sver}-%{x86_static_rel}-static-qt.i386-en-%{magicstr}.tar.bz2
237 Source100: http://snapshot.opera.com/unix/%{ver}-%{reltype}/intel-linux/%{name}-%{sver}-%{x86_static_rel}-static-qt.i386-en-%{magicstr}.tar.bz2
239 %{!?with_distributable:NoSource: 100}
242 %if %{need_sparc_static}
243 Source1: ftp://ftp.opera.com/pub/opera/linux/%{shver}/%{reltype}/en/sparc/static/%{name}-%{sver}-%{sparc_static_rel}-static-qt.sparc-en.tar.bz2
244 # Source1-md5: 98a84755df7d74812e8b8fa20d09d929
245 %{!?with_distributable:NoSource: 1}
248 %if %{need_sparc_static_snap}
249 Source101: http://snapshot.opera.com/unix/%{ver}-%{reltype}/%{magicstr}/sparc-linux/%{name}-%{sver}-%{sparc_static_rel}-static-qt.sparc-en.tar.bz2
250 # Source101-md5: 913ccb28106f9f5acd3d94c8dc71ae1
251 %{!?with_distributable:NoSource: 101}
254 %if %{need_ppc_static}
255 Source2: ftp://ftp.opera.com/pub/opera/linux/%{shver}/%{reltype}/en/ppc/static/%{name}-%{sver}-%{ppc_static_rel}-static-qt.ppc-en.tar.bz2
256 # Source2-md5: 132fa2d85a2e0c2840b8bf2d27cfc93d
257 %{!?with_distributable:NoSource: 2}
260 %if %{need_ppc_static_snap}
262 Source30102: http://snapshot.opera.com/unix/Weekly-%{magicstr}/ppc-linux/%{name}-%{sver}-%{ppc_static_rel}-static-qt.ppc-en-%{magicstr}.tar.bz2
264 Source102: http://snapshot.opera.com/unix/%{ver}-%{reltype}/%{magicstr}/ppc-linux/%{name}-%{sver}-%{ppc_static_rel}-static-qt.ppc-en.tar.bz2
266 %{!?with_distributable:NoSource: 102}
269 %if %{need_ix86_shared}
270 Source20: ftp://ftp.opera.com/pub/opera/linux/%{shver}/%{reltype}/en/i386/shared/%{name}-%{sver}-%{x86_shared_rel}-shared-qt.i386-en.tar.bz2
271 # Source20-md5: fe3c699c4509788276a94e325cd1bc5b
272 %{!?with_distributable:NoSource: 20}
275 %if %{need_ix86_shared_snap}
277 Source301020: http://snapshot.opera.com/unix/Weekly-%{magicstr}/intel-linux/%{name}-%{sver}-%{x86_shared_rel}-shared-qt.i386-en-%{magicstr}.tar.bz2
278 # Source301020-md5: fe3c699c4509788276a94e325cd1bc5b
280 Source1020: http://snapshot.opera.com/unix/%{ver}-%{reltype}/intel-linux/%{name}-%{sver}-%{x86_shared_rel}-shared-qt.i386-%{magicstr}.tar.bz2
281 # Source1020-md5: 8655d3c4623db40076507f03987158ae
282 %{!?with_distributable:NoSource: 1020}
286 %if %{need_sparc_shared}
287 Source21: ftp://ftp.opera.com/pub/opera/linux/%{shver}/%{reltype}/en/sparc/shared/gcc-2.95/%{name}-%{sver}-%{sparc_shared_rel}-shared-qt.sparc-en.tar.bz2
288 # Source21-md5: 883df8058672cf52678a07d714dcfce
289 %{!?with_distributable:NoSource: 21}
292 %if %{need_sparc_shared_snap}
293 Source1021: http://snapshot.opera.com/unix/%{ver}-%{reltype}/%{magicstr}/sparc-linux/%{name}-%{sver}-%{sparc_shared_rel}-shared-qt.sparc-en.tar.bz2
294 # Source1021-md5: e190021f5530de3f711006cd9f6bb339
295 %{!?with_distributable:NoSource: 1021}
298 %if %{need_ppc_shared}
299 Source22: ftp://ftp.opera.com/pub/opera/linux/%{shver}/%{reltype}/en/ppc/shared/gcc-2.95/%{name}-%{sver}-%{ppc_shared_rel}-shared-qt.ppc-en.tar.bz2
300 # Source22-md5: 2f9bf50540fac7ed63f2984a13b1010d
301 %{!?with_distributable:NoSource: 22}
304 %if %{need_ppc_shared_snap}
306 Source301022: http://snapshot.opera.com/unix/Weekly-%{magicstr}/ppc-linux/%{name}-%{sver}-%{ppc_shared_rel}-shared-qt.ppc-en-%{magicstr}.tar.bz2
307 # Source301022-md5: 65293d788e18d0c23cccac71b9fe567c
309 Source1022: http://snapshot.opera.com/unix/%{ver}-%{reltype}/ppc-linux/%{name}-%{sver}-%{ppc_shared_rel}-shared-qt.ppc-%{magicstr}.tar.bz2
310 # Source1022-md5: 94b4d77cdcdf42a40ebe2d682892bb9a
311 %{!?with_distributable:NoSource: 1022}
316 Source23: http://snapshot.opera.com/unix/9.50-Alpha-1/x86_64-linux/%{name}-%{version}-%{dirrel}.2-shared-qt.x86_64-%{magicstr}.tar.bz2
317 # Source23-md5: 40b850632dbb729a0bb16a1c450d97e5
318 %{!?with_distributable:NoSource: 23}
321 Source4: %{name}.desktop
322 Patch0: %{name}-wrapper.patch
323 URL: http://www.opera.com/
324 BuildRequires: rpmbuild(macros) >= 1.356
325 BuildRequires: sed >= 4.0
326 Requires: browser-plugins >= 2.0
327 Requires: freetype >= 2
329 ExclusiveArch: %{ix86} %{x8664} ppc sparc sparcv9
330 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
332 %define _plugindir %{_libdir}/opera/plugins
333 %define _operadocdir %{_docdir}/%{name}-%{ver}
336 Opera is world fastest web browser. It supports most of nowaday
337 extensions of HTML. And it is quite stable. This version is %{?with_shared:shared}%{!?with_shared:statically}
340 %description -l pl.UTF-8
341 Opera jest najszybszą przeglądarką WWW na świecie. Obsługuje większość
342 dzisiejszych rozszerzeń HTML-a. Dodatkowo jest w miarę stabilna. Ta
343 wersja jest skonsolidowana %{?with_shared:dynamicznie}%{!?with_shared:statycznie} z Qt.
347 %setup -q -T -b %{?with_weekly:30}%{?with_snap:10}%{?with_shared:2}0 -n %{name}-%{sver}-%{rel}-%{type}-qt.i386%{!?with_snap:-en}%{?magicstr:-%{magicstr}}
350 %setup -q -T -b 23 -n %{name}-%{version}-%{dirrel}.2-shared-qt.x86_64-%{magicstr}
352 %ifarch sparc sparcv9
353 %setup -q -T -b %{?with_weekly:30}%{?with_snap:10}%{?with_shared:2}1 -n %{name}-%{sver}-%{rel}-%{type}-qt.sparc%{!?with_snap:-en}-en%{?magicstr:-%{magicstr}}
356 %setup -q -T -b %{?with_weekly:30}%{?with_snap:10}%{?with_shared:2}2 -n %{name}-%{sver}-%{rel}-%{type}-qt.ppc-en%{!?with_snap:-en}%{?magicstr:-%{magicstr}}
361 rm -rf $RPM_BUILD_ROOT
362 install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_sysconfdir}}
364 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins -b <<'EOF'
365 # opera does not use for .xpt files
368 # use mplayerplug-in-opera instead
371 # opera uses libjava.so to run java
376 DESTDIR=$RPM_BUILD_ROOT \
377 --prefix=%{_prefix} \
378 --exec_prefix=%{_libdir}/%{name}/bin \
379 --plugindir=%{_libdir}/%{name}/plugins \
380 --docdir=%{_operadocdir}
382 # install in kde etc.
383 install %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}
386 install etc/* $RPM_BUILD_ROOT%{_sysconfdir}
387 install usr/share/pixmaps/*.xpm $RPM_BUILD_ROOT%{_pixmapsdir}
389 mv -f $RPM_BUILD_ROOT%{_datadir}/%{name}/config/* $RPM_BUILD_ROOT%{_sysconfdir}
390 install images/opera.xpm $RPM_BUILD_ROOT%{_pixmapsdir}
394 rm -rf $RPM_BUILD_ROOT
397 %update_browser_plugins
400 if [ "$1" = 0 ]; then
401 %update_browser_plugins
405 %defattr(644,root,root,755)
407 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/opera*rc*
410 %{_browserpluginsconfdir}/browsers.d/%{name}.*
411 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
413 %attr(755,root,root) %{_bindir}/*
414 %dir %{_libdir}/opera
415 %dir %{_libdir}/opera/bin
416 %attr(755,root,root) %{_libdir}/opera/bin/*
419 %attr(755,root,root) %{_plugindir}/*
420 %{_datadir}/opera/images
422 %dir %{_datadir}/opera
423 %{_datadir}/opera/*.*
424 %{_datadir}/opera/ini
425 %{_datadir}/opera/java
426 %{_datadir}/opera/skin
427 %{_datadir}/opera/styles
428 %dir %{_datadir}/opera/locale
429 %{_datadir}/opera/locale/en
430 %{_datadir}/opera/locale/english.lng
431 %{_desktopdir}/*.desktop
432 %{_mandir}/man1/opera.1*
433 %{_pixmapsdir}/opera.xpm