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