]> git.pld-linux.org Git - packages/opera.git/blob - opera.spec
- try to sort out the tree of conditions
[packages/opera.git] / opera.spec
1 # BRANCHES:
2 # - HEAD - stable version
3 # - DEVEL - development version
4 # - WEEKLY - weekly development version
5
6 # TODO:
7 # - move translations into a separate, noarch package
8 #
9 %bcond_without  shared          # static or shared version
10 %bcond_without  distributable   # distributable or not
11 %bcond_without  incall          # include all tarballs into src.rpm (but splitted into shared/static)
12
13 %define ver             9.24
14 %define sver            9.24
15 %define fix             %{nil}
16 %define dirrel          20071015
17 %define reltype         final
18 %define magicstr        671
19
20 %define shver           %(echo %{ver} | tr -d .)%{fix}
21 %define x86_shared_rel          %{dirrel}.5
22 %define x86_static_rel          %{dirrel}.1
23 %define sparc_shared_rel        %{dirrel}.2
24 %define sparc_static_rel        %{dirrel}.1
25 %define ppc_shared_rel          %{dirrel}.3
26 %define ppc_static_rel          %{dirrel}.1
27
28 %if %{with shared}
29         %define type            shared
30         # We should be able to build src.rpm also on not supported archs
31         %define rel             %{x86_shared_rel}
32         %ifarch sparc sparcv9
33                 %define rel             %{sparc_shared_rel}
34         %else
35                 %ifarch ppc
36                 %define rel             %{ppc_shared_rel}
37                 %endif
38         %endif
39 %else
40         %define type            static
41         %define rel             %{x86_static_rel}
42         %ifarch sparc sparcv9
43                 %define rel             %{sparc_static_rel}
44         %else
45                 %ifarch ppc
46                         %define rel             %{ppc_static_rel}
47                 %endif
48         %endif
49 %endif
50
51 # define to 0 and then redefine to avoid
52 # not defined macros
53 %define need_ix86_shared        0
54 %define need_sparc_shared       0
55 %define need_ppc_shared         0
56 %define need_ix86_static        0
57 %define need_sparc_static       0
58 %define need_ppc_static         0
59
60 %if %{with incall}
61         %if %{with shared}
62                 %define need_ix86_shared        1
63                 %define need_sparc_shared       1
64                 %define need_ppc_shared 1
65         %else
66                 %define need_ix86_static        1
67                 %define need_sparc_static       1
68                 %define need_ppc_static 1
69         %endif
70 %else
71         %ifnarch %{ix86}
72                 %ifarch sparc sparc64
73                         %if     %{with shared}
74                                 %define need_sparc_shared       1
75                         %else
76                                 %define need_sparc_static       1
77                         %endif
78                 %else
79                         %ifarch ppc
80                                 %if     %{with shared}
81                                         %define need_ppc_shared 1
82                                 %else
83                                         %define need_ppc_static 1
84                                 %endif
85                         %endif
86                 %endif
87         %endif
88 %endif
89
90 %define         _rel    2
91 Summary:        World fastest web browser
92 Summary(pl.UTF-8):      Najszybsza przeglądarka WWW na świecie
93 Name:           opera
94 Version:        %{ver}%{fix}
95 Release:        %{_rel}
96 Epoch:          2
97 License:        Distributable
98 Group:          X11/Applications/Networking
99
100 %if %{need_ix86_static}
101 Source0:        ftp://ftp.opera.com/pub/opera/linux/%{shver}/%{reltype}/en/i386/static/%{name}-%{sver}-%{x86_static_rel}-static-qt.i386-en.tar.bz2
102 # Source0-md5:  96b8010ddb0ff250817c7fb314de2d26
103 %{!?with_distributable:NoSource:        0}
104 %endif
105
106 %if %{need_sparc_static}
107 Source1:        ftp://ftp.opera.com/pub/opera/linux/%{shver}/%{reltype}/en/sparc/static/%{name}-%{sver}-%{sparc_static_rel}-static-qt.sparc-en.tar.bz2
108 # Source1-md5:  c8443b4b83b21a56fdd8dc3526eaf46f
109 %{!?with_distributable:NoSource:        1}
110 %endif
111
112 %if %{need_ppc_static}
113 Source2:        ftp://ftp.opera.com/pub/opera/linux/%{shver}/%{reltype}/en/ppc/static/%{name}-%{sver}-%{ppc_static_rel}-static-qt.ppc-en.tar.bz2
114 # Source2-md5:  be68f701224493bbd9a6d62df8eb9b19
115 %{!?with_distributable:NoSource:        2}
116 %endif
117
118 %if %{need_ix86_shared}
119 Source20:       ftp://ftp.opera.com/pub/opera/linux/%{shver}/%{reltype}/en/i386/shared/%{name}-%{sver}-%{x86_shared_rel}-shared-qt.i386-en.tar.bz2
120 # Source20-md5: e7d934c0fe9ce0ef7cec67981b71332d
121 %{!?with_distributable:NoSource:        20}
122 %endif
123
124 %if %{need_sparc_shared}
125 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
126 # Source21-md5: 84df0097ac9c52e95bc74e73407386ee
127 %{!?with_distributable:NoSource:        21}
128 %endif
129
130
131 %if %{need_ppc_shared}
132 Source22:       ftp://ftp.opera.com/pub/opera/linux/%{shver}/%{reltype}/en/ppc/shared/gcc-2.95/%{name}-%{sver}-%{ppc_shared_rel}-shared-qt.ppc-en.tar.bz2
133 # Source22-md5: 07f97223ffcb2d2ab87c921ead880018
134 %{!?with_distributable:NoSource:        22}
135 %endif
136
137 Source4:        %{name}.desktop
138 Patch0:         %{name}-wrapper.patch
139 URL:            http://www.opera.com/
140 BuildRequires:  rpmbuild(macros) >= 1.356
141 BuildRequires:  sed >= 4.0
142 Requires:       browser-plugins >= 2.0
143 Requires:       freetype >= 2
144 Provides:       wwwbrowser
145 ExclusiveArch:  %{ix86} ppc sparc sparcv9
146 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
147
148 %define         _plugindir      %{_libdir}/opera/plugins
149 %define         _operadocdir    %{_docdir}/%{name}-%{ver}
150
151 %description
152 Opera is world fastest web browser. It supports most of nowaday
153 extensions of HTML. And it is quite stable. This version is %{?with_shared:shared}%{!?with_shared:statically}
154 linked with Qt.
155
156 %description -l pl.UTF-8
157 Opera jest najszybszą przeglądarką WWW na świecie. Obsługuje większość
158 dzisiejszych rozszerzeń HTML-a. Dodatkowo jest w miarę stabilna. Ta
159 wersja jest skonsolidowana %{?with_shared:dynamicznie}%{!?with_shared:statycznie} z Qt.
160
161 %prep
162 %ifarch %{ix86}
163 %setup -q -T -b %{?with_shared:2}0 -n %{name}-%{sver}-%{rel}-%{type}-qt.i386-en%{?magicstr:-%{magicstr}}
164 %endif
165 %ifarch sparc sparcv9
166 %setup -q -T -b %{?with_shared:2}1 -n %{name}-%{sver}-%{rel}-%{type}-qt.sparc-en-%{?magicstr:-%{magicstr}}
167 %endif
168 %ifarch ppc
169 %setup -q -T -b %{?with_shared:2}2 -n %{name}-%{sver}-%{rel}-%{type}-qt.ppc-en%{?magicstr:-%{magicstr}}
170 %endif
171 %patch0 -p1
172
173 %install
174 rm -rf $RPM_BUILD_ROOT
175 install -d $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir},%{_sysconfdir}}
176
177 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins -b <<'EOF'
178 # opera does not use for .xpt files
179 *.xpt
180
181 # use mplayerplug-in-opera instead
182 mplayerplug-in*
183
184 # opera uses libjava.so to run java
185 libjavaplugin_oji.so
186 EOF
187
188 sh install.sh \
189         DESTDIR=$RPM_BUILD_ROOT \
190         --prefix=%{_prefix} \
191         --exec_prefix=%{_libdir}/%{name}/bin \
192         --plugindir=%{_libdir}/%{name}/plugins \
193         --docdir=%{_operadocdir}
194
195 # install in kde etc.
196 install %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}
197
198 mv -f $RPM_BUILD_ROOT%{_datadir}/%{name}/config/* $RPM_BUILD_ROOT%{_sysconfdir}
199 install images/opera.xpm $RPM_BUILD_ROOT%{_pixmapsdir}
200
201 %clean
202 rm -rf $RPM_BUILD_ROOT
203
204 %post
205 %update_browser_plugins
206
207 %postun
208 if [ "$1" = 0 ]; then
209         %update_browser_plugins
210 fi
211
212 %files
213 %defattr(644,root,root,755)
214 %doc LICENSE
215 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/opera*rc*
216
217 # browser plugins v2
218 %{_browserpluginsconfdir}/browsers.d/%{name}.*
219 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
220
221 %attr(755,root,root) %{_bindir}/*
222 %dir %{_libdir}/opera
223 %dir %{_libdir}/opera/bin
224 %attr(755,root,root) %{_libdir}/opera/bin/*
225 %dir %{_plugindir}
226 %attr(755,root,root) %{_plugindir}/*
227 %dir %{_datadir}/opera
228 %{_datadir}/opera/*.*
229 %{_datadir}/opera/ini
230 %{_datadir}/opera/java
231 %{_datadir}/opera/images
232 %{_datadir}/opera/skin
233 %{_datadir}/opera/styles
234 %dir %{_datadir}/opera/locale
235 %{_datadir}/opera/locale/en
236 %{_datadir}/opera/locale/english.lng
237 %{_desktopdir}/*.desktop
238 %{_mandir}/man1/opera.1*
239 %{_pixmapsdir}/opera.xpm
This page took 0.165094 seconds and 4 git commands to generate.