]> git.pld-linux.org Git - packages/opera.git/blob - opera.spec
eb0f2f728ec9af45d7aaffc02a24330f23586533
[packages/opera.git] / opera.spec
1 # TODO:
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
5 #
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
11
12 %ifarch sparc sparcv9
13 %undefine with_shared
14 %endif
15
16 %if %{with weekly}
17 %define ver             9.23
18 %define sver            %{ver}
19 %define fix             %{nil}
20 %define dirrel          20070809
21 %define reltype         %{nil}
22 %define magicstr        660
23 %define with_snap       1
24 %else
25 %if %{with snap}
26 %define ver             9.50
27 %define sver            %{ver}
28 %define fix             %{nil}
29 %define dirrel          20070903
30 %define reltype         Alpha-1
31 %define magicstr        1567
32 %else
33 %define ver             9.23
34 %define sver            9.23
35 %define fix             %{nil}
36 %define dirrel          20070809
37 %define reltype         final
38 %define magicstr        660
39 %endif
40 %endif
41
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
49 %if %{with shared}
50 %define type            shared
51 # We should be able to build src.rpm also on not supported archs
52 %define rel             %{x86_shared_rel}
53 %ifarch sparc sparcv9
54 #%%define       rel             %{sparc_shared_rel}
55 %define rel             %{sparc_static_rel}
56 %else
57 %ifarch ppc
58 %define rel             %{ppc_shared_rel}
59 %endif
60 %endif
61 %else
62 %define type            static
63 %define rel             %{x86_static_rel}
64 %ifarch sparc sparcv9
65 %define rel             %{sparc_static_rel}
66 %else
67 %ifarch ppc
68 %define rel             %{ppc_static_rel}
69 %endif
70 %endif
71 %endif
72
73 # define to 0 and then redefine to avoid
74 # not defined macros
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
81
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
88
89 %if %{with incall}
90 #       with incall?    [if]
91 %if     %{with snap}
92 #               with snap?      [if]
93 %if     %{with shared}
94 #                       with shared?    [if]
95 %define need_ix86_shared_snap   1
96 %define need_sparc_shared_snap  0
97 %define need_ppc_shared_snap    1
98 %else
99 #                       with shared:    [else]
100 %define need_ix86_static_snap   1
101 %define need_sparc_static_snap  1
102 %define need_ppc_static_snap    1
103 %endif
104 #                       with shared;    [endif]
105 %else
106 #               with snap:      [else]
107 %if %{with shared}
108 #                       with shared?    [if]
109 %define need_ix86_shared        1
110 #%%define       need_sparc_shared       1
111 %define need_sparc_static       1
112 %define need_ppc_shared 1
113 %else
114 #                       with shared:    [else]
115 %define need_ix86_static        1
116 %define need_sparc_static       1
117 %define need_ppc_static 1
118 %endif
119 #                       with shared;    [endif]
120 %endif
121 #               with snap;      [endif]
122 %else
123 #       with incall:    [else]
124 %ifarch %{ix86}
125 #               is ix86?        [if]
126 %if     %{with snap}
127 #                       with snap?      [if]
128 %if     %{with shared}
129 #                               with shared?    [if]
130 %define need_ix86_shared_snap   1
131 %else
132 #                               with shared:    [else]
133 %define need_ix86_static_snap   1
134 %endif
135 #                               with shared;    [endif]
136 %else
137 #                       with snap:      [else]
138 %if     %{with shared}
139 #                               with shared?    [if]
140 %define need_ix86_shared        1
141 %else
142 #                               with shared:    [else]
143 %define need_ix86_static        1
144 %endif
145 #                               with shared;    [endif]
146 %endif
147 #                       with snap;      [endif]
148 %else
149 #               is ix86:        [else]
150 %ifarch sparc sparc64
151 #               is sparc?       [if]
152 %if     %{with snap}
153 #                       with snap?      [if]
154 %if     %{with shared}
155 #                               with shared?    [if]
156 %define need_sparc_shared_snap  1
157 %else
158 #                               with shared:    [else]
159 %define need_sparc_static_snap  1
160 %endif
161 #                               with shared;    [endif]
162 %else
163 #                       with snap:      [else]
164 %if     %{with shared}
165 #                               with shared?    [if]
166 #%%define       need_sparc_shared       1
167 %define need_sparc_static       1
168 %else
169 #                               with shared:    [else]
170 %define need_sparc_static       1
171 %endif
172 #                               with shared;    [endif]
173 %endif
174 #                       with snap;      [endif]
175 %else
176 #               is sparc:       [else]
177 %ifarch ppc
178 #               is ppc?         [if]
179 %if     %{with snap}
180 #                       with snap?      [if]
181 %if     %{with shared}
182 #                               with shared?    [if]
183 %define need_ppc_shared_snap    1
184 %else
185 #                               with shared:    [else]
186 %define need_ppc_static_snap    1
187 %endif
188 #                               with shared;    [endif]
189 %else
190 #                       with snap:      [else]
191 %if     %{with shared}
192 #                               with shared?    [if]
193 %define need_ppc_shared 1
194 %else
195 #                               with shared:    [else]
196 %define need_ppc_static 1
197 %endif
198 #                               with shared;    [endif]
199 %endif
200 #                       with snap;      [endif]
201 %endif
202 #               is ppc;         [endif]
203 %endif
204 #               is sparc;       [endif]
205 %endif
206 #               is ix86;        [endif]
207 %endif
208 #       with incall;    [endif]
209
210 %if %{with weekly}
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
215 %endif
216
217 %define         _rel    1
218 Summary:        World fastest web browser
219 Summary(pl.UTF-8):      Najszybsza przeglądarka WWW na świecie
220 Name:           opera
221 Version:        %{ver}%{fix}
222 Release:        %{?with_snap:1.%{rel}.}%{_rel}
223 Epoch:          2
224 License:        Distributable for PLD until 31 Dec 2006 - http://distribute.opera.com/ (otherwise restricted, see file LICENSE)
225 Group:          X11/Applications/Networking
226
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}
231 %endif
232
233 %if %{need_ix86_static_snap}
234 %if %{with weekly}
235 Source30100:    http://snapshot.opera.com/unix/Weekly-%{magicstr}/intel-linux/%{name}-%{sver}-%{x86_static_rel}-static-qt.i386-en-%{magicstr}.tar.bz2
236 %else
237 Source100:      http://snapshot.opera.com/unix/%{ver}-%{reltype}/intel-linux/%{name}-%{sver}-%{x86_static_rel}-static-qt.i386-en-%{magicstr}.tar.bz2
238 %endif
239 %{!?with_distributable:NoSource:        100}
240 %endif
241
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}
246 %endif
247
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}
252 %endif
253
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}
258 %endif
259
260 %if %{need_ppc_static_snap}
261 %if %{with weekly}
262 Source30102:    http://snapshot.opera.com/unix/Weekly-%{magicstr}/ppc-linux/%{name}-%{sver}-%{ppc_static_rel}-static-qt.ppc-en-%{magicstr}.tar.bz2
263 %else
264 Source102:      http://snapshot.opera.com/unix/%{ver}-%{reltype}/%{magicstr}/ppc-linux/%{name}-%{sver}-%{ppc_static_rel}-static-qt.ppc-en.tar.bz2
265 %endif
266 %{!?with_distributable:NoSource:        102}
267 %endif
268
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}
273 %endif
274
275 %if %{need_ix86_shared_snap}
276 %if %{with weekly}
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
279 %else
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}
283 %endif
284 %endif
285
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}
290 %endif
291
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}
296 %endif
297
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}
302 %endif
303
304 %if %{need_ppc_shared_snap}
305 %if %{with weekly}
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
308 %else
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}
312 %endif
313 %endif
314
315 %ifarch %{x8664}
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}
319 %endif
320
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
328 Provides:       wwwbrowser
329 ExclusiveArch:  %{ix86} %{x8664} ppc sparc sparcv9
330 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
331
332 %define         _plugindir      %{_libdir}/opera/plugins
333 %define         _operadocdir    %{_docdir}/%{name}-%{ver}
334
335 %description
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}
338 linked with Qt.
339
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.
344
345 %prep
346 %ifarch %{ix86}
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}}
348 %endif
349 %ifarch %{x8664}
350 %setup -q -T -b 23 -n %{name}-%{version}-%{dirrel}.2-shared-qt.x86_64-%{magicstr}
351 %endif
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}}
354 %endif
355 %ifarch ppc
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}}
357 %endif
358 %patch0 -p1
359
360 %install
361 rm -rf $RPM_BUILD_ROOT
362 install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_sysconfdir}}
363
364 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins -b <<'EOF'
365 # opera does not use for .xpt files
366 *.xpt
367
368 # use mplayerplug-in-opera instead
369 mplayerplug-in*
370
371 # opera uses libjava.so to run java
372 libjavaplugin_oji.so
373 EOF
374
375 sh install.sh \
376         DESTDIR=$RPM_BUILD_ROOT \
377         --prefix=%{_prefix} \
378         --exec_prefix=%{_libdir}/%{name}/bin \
379         --plugindir=%{_libdir}/%{name}/plugins \
380         --docdir=%{_operadocdir}
381
382 # install in kde etc.
383 install %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}
384
385 %if %{with snap}
386 install etc/* $RPM_BUILD_ROOT%{_sysconfdir}
387 install usr/share/pixmaps/*.xpm $RPM_BUILD_ROOT%{_pixmapsdir}
388 %else
389 mv -f $RPM_BUILD_ROOT%{_datadir}/%{name}/config/* $RPM_BUILD_ROOT%{_sysconfdir}
390 install images/opera.xpm $RPM_BUILD_ROOT%{_pixmapsdir}
391 %endif
392
393 %clean
394 rm -rf $RPM_BUILD_ROOT
395
396 %post
397 %update_browser_plugins
398
399 %postun
400 if [ "$1" = 0 ]; then
401         %update_browser_plugins
402 fi
403
404 %files
405 %defattr(644,root,root,755)
406 %doc LICENSE
407 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/opera*rc*
408
409 # browser plugins v2
410 %{_browserpluginsconfdir}/browsers.d/%{name}.*
411 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
412
413 %attr(755,root,root) %{_bindir}/*
414 %dir %{_libdir}/opera
415 %dir %{_libdir}/opera/bin
416 %attr(755,root,root) %{_libdir}/opera/bin/*
417 %dir %{_plugindir}
418 %if ! %{with snap}
419 %attr(755,root,root) %{_plugindir}/*
420 %{_datadir}/opera/images
421 %endif
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
This page took 0.067734 seconds and 3 git commands to generate.