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