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