]> git.pld-linux.org Git - packages/opera.git/blob - opera.spec
2ab66dd595955761ae3b502977bdb19eeff42536
[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          20060217
19 %define magicstr        1656
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.52
31 %define sver            8.52
32 %define fix             %{nil}
33 %define dirrel          20060201
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 Source100:      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:  2dec5155b24752517fbf1143d861f8f1
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 Source102:      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: a1847d8693025a16188bc3c165eff71a
254 %{!?with_distributable:NoSource:        20}
255 %endif
256
257 %if %{need_ix86_shared_snap}
258 %if %{with weekly}
259 Source1020:     http://snapshot.opera.com/unix/Weekly-%{magicstr}/intel-linux/%{name}-%{sver}-%{x86_shared_rel}-shared-qt.i386-en-%{magicstr}.tar.bz2
260 %else
261 Source1020:     http://snapshot.opera.com/unix/%{ver}-%{reltype}/%{magicstr}/intel-linux/%{name}-%{sver}-%{x86_shared_rel}-shared-qt.i386-en.tar.bz2
262 # Source1020-md5:       6f296be6b9fc3001588d4509016062bd
263 %endif
264 %{!?with_distributable:NoSource:        1020}
265 %endif
266
267 %if %{need_sparc_shared}
268 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
269 # Source21-md5: 883df8058672cf52678a07d714dcfce
270 %{!?with_distributable:NoSource:        21}
271 %endif
272
273 %if %{need_sparc_shared_snap}
274 Source1021:     http://snapshot.opera.com/unix/%{ver}-%{reltype}/%{magicstr}/sparc-linux/%{name}-%{sver}-%{sparc_shared_rel}-shared-qt.sparc-en.tar.bz2
275 # Source1021-md5:       e190021f5530de3f711006cd9f6bb339
276 %{!?with_distributable:NoSource:        1021}
277 %endif
278
279 %if %{need_ppc_shared}
280 Source22:       ftp://ftp.opera.com/pub/opera/linux/%{shver}/%{reltype}/en/ppc/shared/%{name}-%{sver}-%{ppc_shared_rel}-shared-qt.ppc-en.tar.bz2
281 # Source22-md5: 670e9fbc029a374187438e92a8c8602f
282 %{!?with_distributable:NoSource:        22}
283 %endif
284
285 %if %{need_ppc_shared_snap}
286 %if %{with weekly}
287 Source1022:     http://snapshot.opera.com/unix/Weekly-%{magicstr}/ppc-linux/%{name}-%{sver}-%{ppc_shared_rel}-shared-qt.ppc-en-%{magicstr}.tar.bz2
288 %else
289 Source1022:     http://snapshot.opera.com/unix/%{ver}-%{reltype}/%{magicstr}/ppc-linux/%{name}-%{sver}-%{ppc_shared_rel}-shared-qt.ppc-en.tar.bz2
290 # Source1022-md5:       74985fa6da49b2e54c9d03dab1119325
291 %endif
292 %{!?with_distributable:NoSource:        1022}
293 %endif
294
295 Source4:        %{name}.desktop
296
297 URL:            http://www.opera.com/
298 BuildRequires:  sed >= 4.0
299 Requires:       freetype >= 2
300 %{!?with_snap:Requires: openmotif >= 2}
301 Provides:       wwwbrowser
302 ExclusiveArch:  %{ix86} ppc sparc sparc64
303 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
304
305 %define         _plugindir      %{_libdir}/opera/plugins
306 %define         _operadocdir    %{_docdir}/%{name}-%{ver}.%{rel}
307 %define         configfile      %{_datadir}/opera/config/opera6rc
308
309 %description
310 Opera is world fastest web browser. It supports most of nowaday
311 extensions of HTML. And it is quite stable. This version is %{?with_shared:shared}%{!?with_shared:statically}
312 linked with Qt.
313
314 %description -l pl
315 Opera jest najszybsz± przegl±dark± WWW na ¶wiecie. Obs³uguje wiêkszo¶æ
316 dzisiejszych rozszerzeñ HTML-a. Dodatkowo jest w miarê stabilna. Ta
317 wersja jest skonsolidowana %{?with_shared:dynamicznie}%{!?with_shared:statycznie} z Qt.
318
319 %prep
320 %ifarch %{ix86}
321 %setup -q -T -b %{?with_snap:10}%{?with_shared:2}0 -n %{name}-%{sver}-%{rel}-%{type}-qt.i386-en%{?with_weekly:-%{magicstr}}
322 %endif
323 %ifarch sparc sparc64
324 %setup -q -T -b %{?with_snap:10}%{?with_shared:2}1 -n %{name}-%{sver}-%{rel}-%{type}-qt.sparc-en
325 %endif
326 %ifarch ppc
327 %setup -q -T -b %{?with_snap:10}%{?with_shared:2}2 -n %{name}-%{sver}-%{rel}-%{type}-qt.ppc-en%{?with_weekly:-%{magicstr}}
328 %endif
329
330 %install
331 rm -rf $RPM_BUILD_ROOT
332
333 install -d $RPM_BUILD_ROOT{/etc,%{_libdir},%{_mandir}/man1,%{_pixmapsdir},%{_desktopdir}}
334 ln -s $RPM_BUILD_ROOT/etc  $RPM_BUILD_ROOT%{_prefix}/etc
335
336 sed -i -e 's|/etc|$RPM_BUILD_ROOT%{_sysconfdir}|' \
337         -e 's|OPERA_SCRIPT_PATH=$0|OPERA_SCRIPT_PATH=|' install.sh
338
339 echo y |\
340 sh install.sh \
341         --prefix=$RPM_BUILD_ROOT%{_prefix} \
342         --wrapperdir=$RPM_BUILD_ROOT%{_bindir} \
343         --docdir=$RPM_BUILD_ROOT%{_operadocdir} \
344         --sharedir=$RPM_BUILD_ROOT%{_datadir}/opera \
345         --exec_prefix=$RPM_BUILD_ROOT%{_libdir}/opera/bin \
346         --plugindir=$RPM_BUILD_ROOT%{_plugindir}
347
348 # man install
349 install man/opera.1 $RPM_BUILD_ROOT%{_mandir}/man1
350
351 # wrapper correction
352 sed -i -e "s#$RPM_BUILD_ROOT##" $RPM_BUILD_ROOT%{_bindir}/opera
353
354 # install in kde etc.
355 install images/opera.xpm $RPM_BUILD_ROOT%{_pixmapsdir}
356
357 install %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}
358
359 sed -i -e "s#$RPM_BUILD_ROOT##g" $RPM_BUILD_ROOT%{_datadir}/opera/java/*.policy
360
361 # always use latest possible wrapper
362 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/operamotifwrapper
363 if [ -f "$RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/operamotifwrapper-3" ]; then
364         ln -sf operamotifwrapper-3 $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/operamotifwrapper-1
365         ln -sf operamotifwrapper-3 $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/operamotifwrapper-2
366 elif [ -f "$RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/operamotifwrapper-2" ]; then
367         ln -sf operamotifwrapper-2 $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/operamotifwrapper-1
368         ln -sf operamotifwrapper-2 $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/operamotifwrapper-3
369 elif [ -f "$RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/operamotifwrapper-1" ]; then
370         ln -sf operamotifwrapper-1 $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/operamotifwrapper-2
371         ln -sf operamotifwrapper-1 $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/operamotifwrapper-3
372 fi
373
374 # clean unneeded files
375 rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/config
376
377 %clean
378 rm -rf $RPM_BUILD_ROOT
379
380 %files
381 %defattr(644,root,root,755)
382 %doc LICENSE bugreport
383 %attr(755,root,root) %{_bindir}/*
384 %dir %{_libdir}/opera
385 %dir %{_libdir}/opera/bin
386 %attr(755,root,root) %{_libdir}/opera/bin/*
387 %dir %{_plugindir}
388 %attr(755,root,root) %{_plugindir}/*
389 %dir %{_datadir}/opera
390 %{_datadir}/opera/*.*
391 %{_datadir}/opera/images
392 %{_datadir}/opera/ini
393 %{_datadir}/opera/java
394 %{_datadir}/opera/skin
395 %{_datadir}/opera/styles
396 %dir %{_datadir}/opera/locale
397 %{_datadir}/opera/locale/en
398 %{_datadir}/opera/locale/english.lng
399 %{_pixmapsdir}/opera.xpm
400 %{_desktopdir}/*.desktop
401
402 %{_mandir}/man1/opera.1*
403
404 %config(noreplace) %verify(not md5 mtime size) /etc/opera*rc*
This page took 0.154253 seconds and 2 git commands to generate.