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