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