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