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