]> git.pld-linux.org Git - packages/opera.git/blob - opera.spec
- snap up to 9.50 (first alpha version of kestrel)
[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 #
5 %bcond_without  shared          # static or shared version
6 %bcond_without  distributable   # distributable or not
7 %bcond_without  incall          # include all tarballs into src.rpm (but splitted into shared/static)
8 %bcond_with     snap            # snap version
9 %bcond_with     weekly          # weekly snapshot version
10
11 %ifarch sparc sparcv9
12 %undefine with_shared
13 %endif
14
15 %if %{with weekly}
16 %define ver             9.23
17 %define sver            %{ver}
18 %define fix             %{nil}
19 %define dirrel          20070809
20 %define reltype         %{nil}
21 %define magicstr        660
22 %define with_snap       1
23 %else
24 %if %{with snap}
25 %define ver             9.50
26 %define sver            %{ver}
27 %define fix             %{nil}
28 %define dirrel          20070903
29 %define reltype         Alpha-1
30 %define magicstr        1567
31 %else
32 %define ver             9.23
33 %define sver            9.23
34 %define fix             %{nil}
35 %define dirrel          20070809
36 %define reltype         final
37 %define magicstr        660
38 %endif
39 %endif
40
41 %define shver           %(echo %{ver} | tr -d .)%{fix}
42 %define x86_shared_rel          %{dirrel}.5
43 %define x86_static_rel          %{dirrel}.1
44 %define sparc_shared_rel        %{dirrel}.2
45 %define sparc_static_rel        %{dirrel}.1
46 %define ppc_shared_rel          %{dirrel}.3
47 %define ppc_static_rel          %{dirrel}.1
48 %if %{with shared}
49 %define type            shared
50 # We should be able to build src.rpm also on not supported archs
51 %define rel             %{x86_shared_rel}
52 %ifarch sparc sparcv9
53 #%%define       rel             %{sparc_shared_rel}
54 %define rel             %{sparc_static_rel}
55 %else
56 %ifarch ppc
57 %define rel             %{ppc_shared_rel}
58 %endif
59 %endif
60 %else
61 %define type            static
62 %define rel             %{x86_static_rel}
63 %ifarch sparc sparcv9
64 %define rel             %{sparc_static_rel}
65 %else
66 %ifarch ppc
67 %define rel             %{ppc_static_rel}
68 %endif
69 %endif
70 %endif
71
72 # define to 0 and then redefine to avoid
73 # not defined macros
74 %define need_ix86_shared_snap   0
75 %define need_sparc_shared_snap  0
76 %define need_ppc_shared_snap    0
77 %define need_ix86_static_snap   0
78 %define need_sparc_static_snap  0
79 %define need_ppc_static_snap    0
80
81 %define need_ix86_shared        0
82 %define need_sparc_shared       0
83 %define need_ppc_shared         0
84 %define need_ix86_static        0
85 %define need_sparc_static       0
86 %define need_ppc_static         0
87
88 %if %{with incall}
89 #       with incall?    [if]
90 %if     %{with snap}
91 #               with snap?      [if]
92 %if     %{with shared}
93 #                       with shared?    [if]
94 %define need_ix86_shared_snap   1
95 %define need_sparc_shared_snap  0
96 %define need_ppc_shared_snap    1
97 %else
98 #                       with shared:    [else]
99 %define need_ix86_static_snap   1
100 %define need_sparc_static_snap  1
101 %define need_ppc_static_snap    1
102 %endif
103 #                       with shared;    [endif]
104 %else
105 #               with snap:      [else]
106 %if %{with shared}
107 #                       with shared?    [if]
108 %define need_ix86_shared        1
109 #%%define       need_sparc_shared       1
110 %define need_sparc_static       1
111 %define need_ppc_shared 1
112 %else
113 #                       with shared:    [else]
114 %define need_ix86_static        1
115 %define need_sparc_static       1
116 %define need_ppc_static 1
117 %endif
118 #                       with shared;    [endif]
119 %endif
120 #               with snap;      [endif]
121 %else
122 #       with incall:    [else]
123 %ifarch %{ix86}
124 #               is ix86?        [if]
125 %if     %{with snap}
126 #                       with snap?      [if]
127 %if     %{with shared}
128 #                               with shared?    [if]
129 %define need_ix86_shared_snap   1
130 %else
131 #                               with shared:    [else]
132 %define need_ix86_static_snap   1
133 %endif
134 #                               with shared;    [endif]
135 %else
136 #                       with snap:      [else]
137 %if     %{with shared}
138 #                               with shared?    [if]
139 %define need_ix86_shared        1
140 %else
141 #                               with shared:    [else]
142 %define need_ix86_static        1
143 %endif
144 #                               with shared;    [endif]
145 %endif
146 #                       with snap;      [endif]
147 %else
148 #               is ix86:        [else]
149 %ifarch sparc sparc64
150 #               is sparc?       [if]
151 %if     %{with snap}
152 #                       with snap?      [if]
153 %if     %{with shared}
154 #                               with shared?    [if]
155 %define need_sparc_shared_snap  1
156 %else
157 #                               with shared:    [else]
158 %define need_sparc_static_snap  1
159 %endif
160 #                               with shared;    [endif]
161 %else
162 #                       with snap:      [else]
163 %if     %{with shared}
164 #                               with shared?    [if]
165 #%%define       need_sparc_shared       1
166 %define need_sparc_static       1
167 %else
168 #                               with shared:    [else]
169 %define need_sparc_static       1
170 %endif
171 #                               with shared;    [endif]
172 %endif
173 #                       with snap;      [endif]
174 %else
175 #               is sparc:       [else]
176 %ifarch ppc
177 #               is ppc?         [if]
178 %if     %{with snap}
179 #                       with snap?      [if]
180 %if     %{with shared}
181 #                               with shared?    [if]
182 %define need_ppc_shared_snap    1
183 %else
184 #                               with shared:    [else]
185 %define need_ppc_static_snap    1
186 %endif
187 #                               with shared;    [endif]
188 %else
189 #                       with snap:      [else]
190 %if     %{with shared}
191 #                               with shared?    [if]
192 %define need_ppc_shared 1
193 %else
194 #                               with shared:    [else]
195 %define need_ppc_static 1
196 %endif
197 #                               with shared;    [endif]
198 %endif
199 #                       with snap;      [endif]
200 %endif
201 #               is ppc;         [endif]
202 %endif
203 #               is sparc;       [endif]
204 %endif
205 #               is ix86;        [endif]
206 %endif
207 #       with incall;    [endif]
208
209 %if %{with weekly}
210 %define need_ppc_shared_snap    0
211 %define need_ppc_static_snap    0
212 %define need_sparc_shared_snap  0
213 %define need_sparc_static_snap  0
214 %endif
215
216 %define         _rel    1
217 Summary:        World fastest web browser
218 Summary(pl.UTF-8):      Najszybsza przeglądarka WWW na świecie
219 Name:           opera
220 Version:        %{ver}%{fix}
221 Release:        %{?with_snap:1.%{rel}.}%{_rel}
222 Epoch:          2
223 License:        Distributable for PLD until 31 Dec 2006 - http://distribute.opera.com/ (otherwise restricted, see file LICENSE)
224 Group:          X11/Applications/Networking
225
226 %if %{need_ix86_static}
227 Source0:        ftp://ftp.opera.com/pub/opera/linux/%{shver}/%{reltype}/en/i386/static/%{name}-%{sver}-%{x86_static_rel}-static-qt.i386-en.tar.bz2
228 # Source0-md5:  0c721abff854df6c8ec7746956a37f55
229 %{!?with_distributable:NoSource:        0}
230 %endif
231
232 %if %{need_ix86_static_snap}
233 %if %{with weekly}
234 Source30100:    http://snapshot.opera.com/unix/Weekly-%{magicstr}/intel-linux/%{name}-%{sver}-%{x86_static_rel}-static-qt.i386-en-%{magicstr}.tar.bz2
235 %else
236 Source100:      http://snapshot.opera.com/unix/%{ver}-%{reltype}/intel-linux/%{name}-%{sver}-%{x86_static_rel}-static-qt.i386-en-%{magicstr}.tar.bz2
237 %endif
238 %{!?with_distributable:NoSource:        100}
239 %endif
240
241 %if %{need_sparc_static}
242 Source1:        ftp://ftp.opera.com/pub/opera/linux/%{shver}/%{reltype}/en/sparc/static/%{name}-%{sver}-%{sparc_static_rel}-static-qt.sparc-en.tar.bz2
243 # Source1-md5:  98a84755df7d74812e8b8fa20d09d929
244 %{!?with_distributable:NoSource:        1}
245 %endif
246
247 %if %{need_sparc_static_snap}
248 Source101:      http://snapshot.opera.com/unix/%{ver}-%{reltype}/%{magicstr}/sparc-linux/%{name}-%{sver}-%{sparc_static_rel}-static-qt.sparc-en.tar.bz2
249 # Source101-md5:        913ccb28106f9f5acd3d94c8dc71ae1
250 %{!?with_distributable:NoSource:        101}
251 %endif
252
253 %if %{need_ppc_static}
254 Source2:        ftp://ftp.opera.com/pub/opera/linux/%{shver}/%{reltype}/en/ppc/static/%{name}-%{sver}-%{ppc_static_rel}-static-qt.ppc-en.tar.bz2
255 # Source2-md5:  132fa2d85a2e0c2840b8bf2d27cfc93d
256 %{!?with_distributable:NoSource:        2}
257 %endif
258
259 %if %{need_ppc_static_snap}
260 %if %{with weekly}
261 Source30102:    http://snapshot.opera.com/unix/Weekly-%{magicstr}/ppc-linux/%{name}-%{sver}-%{ppc_static_rel}-static-qt.ppc-en-%{magicstr}.tar.bz2
262 %else
263 Source102:      http://snapshot.opera.com/unix/%{ver}-%{reltype}/%{magicstr}/ppc-linux/%{name}-%{sver}-%{ppc_static_rel}-static-qt.ppc-en.tar.bz2
264 %endif
265 %{!?with_distributable:NoSource:        102}
266 %endif
267
268 %if %{need_ix86_shared}
269 Source20:       ftp://ftp.opera.com/pub/opera/linux/%{shver}/%{reltype}/en/i386/shared/%{name}-%{sver}-%{x86_shared_rel}-shared-qt.i386-en.tar.bz2
270 # Source20-md5: fe3c699c4509788276a94e325cd1bc5b
271 %{!?with_distributable:NoSource:        20}
272 %endif
273
274 %if %{need_ix86_shared_snap}
275 %if %{with weekly}
276 Source301020:   http://snapshot.opera.com/unix/Weekly-%{magicstr}/intel-linux/%{name}-%{sver}-%{x86_shared_rel}-shared-qt.i386-en-%{magicstr}.tar.bz2
277 # Source301020-md5:     fe3c699c4509788276a94e325cd1bc5b
278 %else
279 Source1020:     http://snapshot.opera.com/unix/%{ver}-%{reltype}/intel-linux/%{name}-%{sver}-%{x86_shared_rel}-shared-qt.i386-%{magicstr}.tar.bz2
280 # Source1020-md5:       8655d3c4623db40076507f03987158ae
281 %{!?with_distributable:NoSource:        1020}
282 %endif
283 %endif
284
285 %if %{need_sparc_shared}
286 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
287 # Source21-md5: 883df8058672cf52678a07d714dcfce
288 %{!?with_distributable:NoSource:        21}
289 %endif
290
291 %if %{need_sparc_shared_snap}
292 Source1021:     http://snapshot.opera.com/unix/%{ver}-%{reltype}/%{magicstr}/sparc-linux/%{name}-%{sver}-%{sparc_shared_rel}-shared-qt.sparc-en.tar.bz2
293 # Source1021-md5:       e190021f5530de3f711006cd9f6bb339
294 %{!?with_distributable:NoSource:        1021}
295 %endif
296
297 %if %{need_ppc_shared}
298 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
299 # Source22-md5: 2f9bf50540fac7ed63f2984a13b1010d
300 %{!?with_distributable:NoSource:        22}
301 %endif
302
303 %if %{need_ppc_shared_snap}
304 %if %{with weekly}
305 Source301022:   http://snapshot.opera.com/unix/Weekly-%{magicstr}/ppc-linux/%{name}-%{sver}-%{ppc_shared_rel}-shared-qt.ppc-en-%{magicstr}.tar.bz2
306 # Source301022-md5:     65293d788e18d0c23cccac71b9fe567c
307 %else
308 Source1022:     http://snapshot.opera.com/unix/%{ver}-%{reltype}/ppc-linux/%{name}-%{sver}-%{ppc_shared_rel}-shared-qt.ppc-%{magicstr}.tar.bz2
309 # Source1022-md5:       94b4d77cdcdf42a40ebe2d682892bb9a
310 %{!?with_distributable:NoSource:        1022}
311 %endif
312 %endif
313
314 Source4:        %{name}.desktop
315 Patch0:         %{name}-wrapper.patch
316 URL:            http://www.opera.com/
317 BuildRequires:  rpmbuild(macros) >= 1.356
318 BuildRequires:  sed >= 4.0
319 Requires:       browser-plugins >= 2.0
320 Requires:       freetype >= 2
321 Provides:       wwwbrowser
322 ExclusiveArch:  %{ix86} ppc sparc sparcv9
323 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
324
325 %define         _plugindir      %{_libdir}/opera/plugins
326 %define         _operadocdir    %{_docdir}/%{name}-%{ver}
327
328 %description
329 Opera is world fastest web browser. It supports most of nowaday
330 extensions of HTML. And it is quite stable. This version is %{?with_shared:shared}%{!?with_shared:statically}
331 linked with Qt.
332
333 %description -l pl.UTF-8
334 Opera jest najszybszą przeglądarką WWW na świecie. Obsługuje większość
335 dzisiejszych rozszerzeń HTML-a. Dodatkowo jest w miarę stabilna. Ta
336 wersja jest skonsolidowana %{?with_shared:dynamicznie}%{!?with_shared:statycznie} z Qt.
337
338 %prep
339 %ifarch %{ix86}
340 %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}}
341 %endif
342 %ifarch sparc sparcv9
343 %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}}
344 %endif
345 %ifarch ppc
346 %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}}
347 %endif
348 %patch0 -p1
349
350 %install
351 rm -rf $RPM_BUILD_ROOT
352 install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_sysconfdir}}
353
354 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins -b <<'EOF'
355 # opera does not use for .xpt files
356 *.xpt
357
358 # use mplayerplug-in-opera instead
359 mplayerplug-in*
360
361 # opera uses libjava.so to run java
362 libjavaplugin_oji.so
363 EOF
364
365 sh install.sh \
366         DESTDIR=$RPM_BUILD_ROOT \
367         --prefix=%{_prefix} \
368         --exec_prefix=%{_libdir}/opera/bin \
369         --docdir=%{_operadocdir}
370
371 # install in kde etc.
372 install %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}
373
374 %if %{with snap}
375 install etc/* $RPM_BUILD_ROOT%{_sysconfdir}
376 install usr/share/pixmaps/*.xpm $RPM_BUILD_ROOT%{_pixmapsdir}
377 %else
378 mv -f $RPM_BUILD_ROOT%{_datadir}/%{name}/config/* $RPM_BUILD_ROOT%{_sysconfdir}
379 install images/opera.xpm $RPM_BUILD_ROOT%{_pixmapsdir}
380 %endif
381
382 %clean
383 rm -rf $RPM_BUILD_ROOT
384
385 %post
386 %update_browser_plugins
387
388 %postun
389 if [ "$1" = 0 ]; then
390         %update_browser_plugins
391 fi
392
393 %files
394 %defattr(644,root,root,755)
395 %doc LICENSE
396 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/opera*rc*
397
398 # browser plugins v2
399 %{_browserpluginsconfdir}/browsers.d/%{name}.*
400 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
401
402 %attr(755,root,root) %{_bindir}/*
403 %dir %{_libdir}/opera
404 %dir %{_libdir}/opera/bin
405 %attr(755,root,root) %{_libdir}/opera/bin/*
406 %dir %{_plugindir}
407 %if ! %{with snap}
408 %attr(755,root,root) %{_plugindir}/*
409 %{_datadir}/opera/images
410 %endif
411 %dir %{_datadir}/opera
412 %{_datadir}/opera/*.*
413 %{_datadir}/opera/ini
414 %{_datadir}/opera/java
415 %{_datadir}/opera/skin
416 %{_datadir}/opera/styles
417 %dir %{_datadir}/opera/locale
418 %{_datadir}/opera/locale/en
419 %{_datadir}/opera/locale/english.lng
420 %{_desktopdir}/*.desktop
421 %{_mandir}/man1/opera.1*
422 %{_pixmapsdir}/opera.xpm
This page took 0.062352 seconds and 4 git commands to generate.