]> git.pld-linux.org Git - packages/google-chrome.git/blob - google-chrome.spec
- up to 20.0.1132.47 stable, adobe flash (known as pepperflash) 11.3.31.109 present...
[packages/google-chrome.git] / google-chrome.spec
1 # NOTE
2 # - to look and update to new version, use update-source.sh script
3
4 %define         flashv  11.3.31.109
5 %define         svnrev  144678
6 #define         rel             %{nil}
7 %define         state   stable
8 Summary:        Google Chrome
9 Name:           google-chrome
10 Version:        20.0.1132.47
11 Release:        %{svnrev}%{?rel:.%{rel}}
12 License:        Multiple, see http://chrome.google.com/
13 Group:          Applications/Networking
14 Source0:        http://dl.google.com/linux/chrome/rpm/%{state}/i386/%{name}-%{state}-%{version}-%{svnrev}.i386.rpm
15 # NoSource0-md5:        2019a1388056b8bf5f7349cdfa0af9f2
16 NoSource:       0
17 Source1:        http://dl.google.com/linux/chrome/rpm/%{state}/x86_64/%{name}-%{state}-%{version}-%{svnrev}.x86_64.rpm
18 # NoSource1-md5:        3569ed25382cf39c81f1b138bafd7485
19 NoSource:       1
20 Source2:        %{name}.sh
21 Source4:        find-lang.sh
22 Patch0:         chrome-desktop.patch
23 URL:            http://chrome.google.com/
24 BuildRequires:  rpm-utils
25 BuildRequires:  rpmbuild(macros) >= 1.453
26 BuildRequires:  sed >= 4.0
27 Requires:       browser-plugins >= 2.0
28 Requires:       hicolor-icon-theme
29 Requires:       xdg-utils >= 1.0.2-4
30 Suggests:       browser-plugin-adobe-flash
31 Suggests:       browser-plugin-chrome-pdf
32 Provides:       wwwbrowser
33 ExclusiveArch:  %{ix86} %{x8664}
34 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36 %{expand:%%define       crver %{version}}
37
38 %define         find_lang       sh find-lang.sh %{buildroot}
39
40 %define         _enable_debug_packages  0
41 %define         no_install_post_strip   1
42
43 %define         ffmpeg_caps     libffmpegsumo.so
44 %define         flash_caps      libpepflashplayer.so
45 %define         chrome_caps     libpdf.so libppGoogleNaClPluginChrome.so
46
47 # list of script capabilities (regexps) not to be used in Provides
48 %define         _noautoprov             %{ffmpeg_caps} %{flash_caps} %{chrome_caps}
49 # do not require them either
50 %define         _noautoreq              %{_noautoprov}
51
52 %description
53 The web browser from Google
54
55 Google Chrome is a browser that combines a minimal design with
56 sophisticated technology to make the web faster, safer, and easier.
57
58 %description -l hu.UTF-8
59 Webböngésző a Google-től.
60
61 Google Chrome egy böngésző, amely a minimalista külsőt házasítja össze
62 a kifinomult technológiával, hogy a webböngészés gyorsabb,
63 biztonságosabb és könnyebb legyen.
64
65 %package l10n
66 Summary:        google chrome language packages
67 Group:          I18n
68 Requires:       %{name} = %{version}-%{release}
69
70 %description l10n
71 This package contains language packages for 50 languages:
72
73 ar, bg, bn, ca, cs, da, de, el, en-GB, es-LA, es, et, fi, fil, fr, gu,
74 he, hi, hr, hu, id, it, ja, kn, ko, lt, lv, ml, mr, nb, nl, or, pl,
75 pt-BR, pt-PT, ro, ru, sk, sl, sr, sv, ta, te, th, tr, uk, vi, zh-CN,
76 zh-TW
77
78 %package -n browser-plugin-chrome-pdf
79 Summary:        Chrome PDF Viewer
80 Summary(pl.UTF-8):      Wtyczka PDF z Google Chrome
81 Group:          X11/Applications/Graphics
82 Requires:       browser-plugins >= 2.0
83 Conflicts:      google-chrome < 16.0.912.75
84
85 %description -n browser-plugin-chrome-pdf
86 Google Chrome PDF Viewer.
87
88 %description -n browser-plugin-chrome-pdf -l pl.UTF-8
89 Wtyczka PDF z Google Chrome.
90
91 # IMPORTANT: keep flash plugin defined as last package
92 %package -n browser-plugin-adobe-flash
93 Summary:        Adobe Flash plugin from Google Chrome
94 Summary(pl.UTF-8):      Wtyczka Adobe Flash z Google Chrome
95 Version:        %{flashv}
96 Release:        %{!?rel:1}%{?rel:%{rel}}
97 License:        Free to use, non-distributable
98 Group:          X11/Applications/Multimedia
99 Requires:       browser-plugins >= 2.0
100 Conflicts:      google-chrome < 16.0.912.75
101
102 %description -n browser-plugin-adobe-flash
103 Adobe Flash plugin from Google Chrome, which is not available in
104 Chromium.
105
106 %description -n browser-plugin-adobe-flash -l pl.UTF-8
107 Wtyczka Adobe Flash z Google Chrome, która nie jest dostępna w
108 Chromium.
109
110 %prep
111 %setup -qcT
112 %ifarch %{ix86}
113 SOURCE=%{S:0}
114 %endif
115 %ifarch %{x8664}
116 SOURCE=%{S:1}
117 %endif
118
119 V=$(rpm -qp --nodigest --nosignature --qf '%{V}' $SOURCE)
120 R=$(rpm -qp --nodigest --nosignature --qf '%{R}' $SOURCE)
121 if [ version:$V != version:%{crver} -o svnrev:$R != svnrev:%{svnrev} ]; then
122         exit 1
123 fi
124 rpm2cpio $SOURCE | cpio -i -d
125
126 mv opt/google/chrome .
127 mv usr/share/man/man1/* .
128 mv usr/share/gnome-control-center/default-apps .
129 mv chrome/default-app-block .
130 mv chrome/product_logo_*.{png,xpm} .
131 mv chrome/google-chrome.desktop .
132 mv chrome/google-chrome .
133 chmod a+x chrome/lib*.so*
134
135 # separate to subpackage
136 install -d browser-plugins
137 mv chrome/libpdf.so browser-plugins
138 mv chrome/PepperFlash browser-plugins
139 chmod a+rx browser-plugins/PepperFlash/*.so
140
141 # included in gnome-control-center-2.28.1-3
142 rm default-app-block default-apps/google-chrome.xml
143
144 # xdg-utils snapshot required
145 rm chrome/xdg-settings
146 rm chrome/xdg-mime
147
148 [ -f *.1.gz ] && gzip -d *.1.gz
149
150 %patch0 -p1
151
152 %{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE4} > find-lang.sh
153 %{__sed} -i 's;/opt/google/chrome/product_logo_48.png;%{name}.png;' google-chrome.desktop
154 %{__sed} -i 's;/opt/google/chrome;%{_bindir};' google-chrome.desktop
155
156 %build
157 v=$(awk -F'"' '/version/{print $4}' browser-plugins/PepperFlash/manifest.json)
158 if [ "$v" != "%{flashv}" ]; then
159         : wrong version
160         exit 1
161 fi
162
163 %install
164 rm -rf $RPM_BUILD_ROOT
165 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/plugins,%{_mandir}/man1,%{_desktopdir},%{_libdir}/%{name}/themes}
166
167 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
168 %{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
169 cp -a chrome/* $RPM_BUILD_ROOT%{_libdir}/%{name}
170 cp -p google-chrome.1 $RPM_BUILD_ROOT%{_mandir}/man1
171 # for google-chrome --help
172 echo ".so google-chrome.1" > $RPM_BUILD_ROOT%{_mandir}/man1/chrome.1
173 cp -p google-chrome.desktop $RPM_BUILD_ROOT%{_desktopdir}
174
175 for icon in product_logo_*.png; do
176         size=${icon##product_logo_}
177         size=${size%.png}
178
179         install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${size}x${size}/apps
180         cp -p $icon $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${size}x${size}/apps/%{name}.png
181 done
182
183 install -d $RPM_BUILD_ROOT%{_browserpluginsdir}
184 cp -a browser-plugins/* $RPM_BUILD_ROOT%{_browserpluginsdir}
185
186 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins
187
188 # binary needs to be at that specific location, or it will abort:
189 # [1070:1070:3265429789299:FATAL:zygote_host_linux.cc(130)] The SUID sandbox helper binary is missing: /opt/google/chrome/chrome-sandbox Aborting now.
190 # Aborted
191 install -d $RPM_BUILD_ROOT/opt/google
192 ln -s %{_libdir}/%{name} $RPM_BUILD_ROOT/opt/google/chrome
193
194 # find locales
195 %find_lang %{name}.lang
196 # always package en-US (in main package)
197 %{__sed} -i -e '/en-US.pak/d' %{name}.lang
198
199 %clean
200 rm -rf $RPM_BUILD_ROOT
201
202 %post
203 %update_icon_cache hicolor
204 %update_browser_plugins
205
206 %postun
207 if [ "$1" = 0 ]; then
208         %update_icon_cache hicolor
209         %update_browser_plugins
210 fi
211
212 %post -n browser-plugin-adobe-flash
213 %update_browser_plugins
214
215 %postun -n browser-plugin-adobe-flash
216 if [ "$1" = 0 ]; then
217         %update_browser_plugins
218 fi
219
220 %post -n browser-plugin-chrome-pdf
221 %update_browser_plugins
222
223 %postun -n browser-plugin-chrome-pdf
224 if [ "$1" = 0 ]; then
225         %update_browser_plugins
226 fi
227
228 # FIXME: chrome *needs* it to be in application dir. add symlink until it can load from other places
229 # for chromium, we could likely patch source
230 # FIXME: link PepperFlash, browser-plugins ignores subdirs, and currently nothing else than chrome browsers can do pepper
231 %triggerin -n browser-plugin-adobe-flash -- google-chrome
232 test -L %{_libdir}/google-chrome/PepperFlash || ln -sf %{_browserpluginsdir}/PepperFlash %{_libdir}/google-chrome/PepperFlash
233
234 %triggerun -n browser-plugin-adobe-flash -- google-chrome
235 if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L %{_libdir}/google-chrome/PepperFlash ]; then
236         rm -f %{_libdir}/google-chrome/PepperFlash
237 fi
238
239 %triggerin -n browser-plugin-chrome-pdf -- google-chrome
240 test -L %{_libdir}/google-chrome/libpdf.so || ln -sf plugins/libpdf.so %{_libdir}/google-chrome/libpdf.so
241
242 %triggerun -n browser-plugin-chrome-pdf -- google-chrome
243 if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L %{_libdir}/google-chrome/libpdf.so ]; then
244         rm -f %{_libdir}/google-chrome/libpdf.so
245 fi
246
247 %triggerin -n browser-plugin-adobe-flash -- chromium-browser
248 test -L %{_libdir}/chromium-browser/PepperFlash || ln -sf %{_browserpluginsdir}/PepperFlash %{_libdir}/chromium-browser/PepperFlash
249
250 %triggerun -n browser-plugin-adobe-flash -- chromium-browser
251 if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L %{_libdir}/chromium-browser/PepperFlash ]; then
252         rm -f %{_libdir}/chromium-browser/PepperFlash
253 fi
254
255 %triggerin -n browser-plugin-chrome-pdf -- chromium-browser
256 test -L %{_libdir}/chromium-browser/libpdf.so || ln -sf plugins/libpdf.so %{_libdir}/chromium-browser/libpdf.so
257
258 %triggerun -n browser-plugin-chrome-pdf -- chromium-browser
259 if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L %{_libdir}/chromium-browser/libpdf.so ]; then
260         rm -f %{_libdir}/chromium-browser/libpdf.so
261 fi
262
263 %triggerin -n browser-plugin-adobe-flash -- chromium-browser-bin
264 test -L %{_libdir}/chromium-browser-bin/PepperFlash || ln -sf %{_browserpluginsdir}/PepperFlash %{_libdir}/chromium-browser-bin/PepperFlash
265
266 %triggerun -n browser-plugin-adobe-flash -- chromium-browser-bin
267 if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L %{_libdir}/chromium-browser-bin/PepperFlash ]; then
268         rm -f %{_libdir}/chromium-browser-bin/PepperFlash
269 fi
270
271 %triggerin -n browser-plugin-chrome-pdf -- chromium-browser-bin
272 test -L %{_libdir}/chromium-browser-bin/libpdf.so || ln -sf plugins/libpdf.so %{_libdir}/chromium-browser-bin/libpdf.so
273
274 %triggerun -n browser-plugin-chrome-pdf -- chromium-browser-bin
275 if [ "$1" = "0" ] || [ "$2" = "0" ] && [-L %{_libdir}/chromium-browser-bin/libpdf.so ]; then
276         rm -f %{_libdir}/chromium-browser-bin/libpdf.so
277 fi
278
279 %files -f %{name}.lang
280 %defattr(644,root,root,755)
281
282 %{_browserpluginsconfdir}/browsers.d/%{name}.*
283 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
284
285 %attr(755,root,root) %{_bindir}/%{name}
286 %{_mandir}/man1/*.1*
287 %{_desktopdir}/*.desktop
288 %{_iconsdir}/hicolor/*/apps/%{name}.png
289
290 %dir %{_libdir}/%{name}
291 %{_libdir}/%{name}/chrome.pak
292 %{_libdir}/%{name}/resources.pak
293 %{_libdir}/%{name}/theme_resources_standard.pak
294 %{_libdir}/%{name}/ui_resources_standard.pak
295 %dir %{_libdir}/%{name}/locales
296 %{_libdir}/%{name}/locales/en-US.pak
297 %dir %{_libdir}/%{name}/plugins
298 %{_libdir}/%{name}/default_apps
299 %{_libdir}/%{name}/themes
300 %attr(755,root,root) %{_libdir}/%{name}/chrome
301 # These unique permissions are intentional and necessary for the sandboxing
302 %attr(4555,root,root) %{_libdir}/%{name}/chrome-sandbox
303
304 # Native Client plugin, to use launch with --enable-nacl
305 %attr(755,root,root) %{_libdir}/%{name}/libppGoogleNaClPluginChrome.so
306
307 # nacl
308 %attr(755,root,root) %{_libdir}/%{name}/nacl_helper
309 %attr(755,root,root) %{_libdir}/%{name}/nacl_helper_bootstrap
310 %attr(755,root,root) %{_libdir}/%{name}/nacl_irt_x86_*.nexe
311
312 # ffmpeg libs
313 %attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so
314
315 # hack
316 %dir /opt/google
317 /opt/google/chrome
318
319 %files l10n -f %{name}.lang
320 %defattr(644,root,root,755)
321
322 %files -n browser-plugin-chrome-pdf
323 %defattr(644,root,root,755)
324 %attr(755,root,root) %{_browserpluginsdir}/libpdf.so
325
326 %files -n browser-plugin-adobe-flash
327 %defattr(644,root,root,755)
328 %dir %{_browserpluginsdir}/PepperFlash
329 %{_browserpluginsdir}/PepperFlash/manifest.json
330 %attr(755,root,root) %{_browserpluginsdir}/PepperFlash/libpepflashplayer.so
This page took 0.08912 seconds and 4 git commands to generate.