2 # - to look and update to new version, use update-source.sh script
5 %define flashv 15.0.0.223
8 %if "%{state}" == "beta" || "%{state}" == "unstable"
9 %define gcsuffix -%{state}
11 Summary: Google Chrome
14 Release: %{svnrev}%{?rel:.%{rel}}
15 License: Multiple, see http://chrome.google.com/
16 Group: Applications/Networking
17 Source0: http://dl.google.com/linux/chrome/rpm/stable/i386/%{name}-%{state}-%{version}-%{svnrev}.i386.rpm
18 # NoSource0-md5: aa52ccd4a08814320a229701d1d6ed81
20 Source1: http://dl.google.com/linux/chrome/rpm/stable/x86_64/%{name}-%{state}-%{version}-%{svnrev}.x86_64.rpm
21 # NoSource1-md5: 2b6b582aa553c39c7ba62fa37a8f5864
25 URL: http://chrome.google.com/
26 BuildRequires: rpm-utils
27 BuildRequires: rpmbuild(macros) >= 1.453
28 BuildRequires: sed >= 4.0
29 Requires: browser-plugins >= 2.0
30 # crashes if no fontconfig font present
31 Requires: fonts-Type1-urw
32 Requires: hicolor-icon-theme
33 Requires: xdg-utils >= 1.0.2-4
34 Suggests: browser-plugin-adobe-flash
35 Suggests: browser-plugin-chrome-pdf
37 # add conflicts to trigger their update when main package is updated
38 Conflicts: browser-plugin-adobe-flash < %{flashv}-%{!?rel:1}%{?rel:%{rel}}
39 Conflicts: browser-plugin-chrome-pdf < %{version}-%{release}
40 ExclusiveArch: %{ix86} %{x8664}
41 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 %{expand:%%define crver %{version}}
45 %define find_lang sh find-lang.sh %{buildroot}
47 %define _enable_debug_packages 0
48 %define no_install_post_strip 1
50 %define ffmpeg_caps libffmpegsumo.so
51 %define flash_caps libpepflashplayer.so
52 %define chrome_caps libpdf.so
54 # list of script capabilities (regexps) not to be used in Provides
55 %define _noautoprov %{ffmpeg_caps} %{flash_caps} %{chrome_caps}
56 # do not require them either
57 %define _noautoreq %{_noautoprov}
60 The web browser from Google
62 Google Chrome is a browser that combines a minimal design with
63 sophisticated technology to make the web faster, safer, and easier.
65 %description -l hu.UTF-8
66 Webböngésző a Google-től.
68 Google Chrome egy böngésző, amely a minimalista külsőt házasítja össze
69 a kifinomult technológiával, hogy a webböngészés gyorsabb,
70 biztonságosabb és könnyebb legyen.
73 Summary: google chrome language packages
75 Requires: %{name} = %{version}-%{release}
78 This package contains language packages for 50 languages:
80 ar, bg, bn, ca, cs, da, de, el, en-GB, es-LA, es, et, fi, fil, fr, gu,
81 he, hi, hr, hu, id, it, ja, kn, ko, lt, lv, ml, mr, nb, nl, or, pl,
82 pt-BR, pt-PT, ro, ru, sk, sl, sr, sv, ta, te, th, tr, uk, vi, zh-CN,
85 %package -n browser-plugin-chrome-pdf
86 Summary: Chrome PDF Viewer
87 Summary(pl.UTF-8): Wtyczka PDF z Google Chrome
88 Group: X11/Applications/Graphics
89 Requires: browser-plugins >= 2.0
90 Conflicts: google-chrome < 19.0.1084.52
92 %description -n browser-plugin-chrome-pdf
93 Google Chrome PDF Viewer.
95 %description -n browser-plugin-chrome-pdf -l pl.UTF-8
96 Wtyczka PDF z Google Chrome.
98 # IMPORTANT: keep flash plugin defined as last package
99 %package -n browser-plugin-adobe-flash
100 Summary: Adobe Flash plugin from Google Chrome
101 Summary(pl.UTF-8): Wtyczka Adobe Flash z Google Chrome
103 Release: %{!?rel:1}%{?rel:%{rel}}
104 License: Free to use, non-distributable
105 Group: X11/Applications/Multimedia
106 Requires: browser-plugins >= 2.0
107 Conflicts: google-chrome < 19.0.1084.52
109 %description -n browser-plugin-adobe-flash
110 Adobe Flash plugin from Google Chrome, which is not available in
113 %description -n browser-plugin-adobe-flash -l pl.UTF-8
114 Wtyczka Adobe Flash z Google Chrome, która nie jest dostępna w
126 V=$(rpm -qp --nodigest --nosignature --qf '%{V}' $SOURCE)
127 R=$(rpm -qp --nodigest --nosignature --qf '%{R}' $SOURCE)
128 if [ version:$V != version:%{crver} -o svnrev:$R != svnrev:%{svnrev} ]; then
131 rpm2cpio $SOURCE | cpio -i -d
133 mv opt/google/chrome%{?gcsuffix} .
134 mv usr/share/man/man1/* .
135 mv usr/share/gnome-control-center/default-apps .
136 mv chrome%{?gcsuffix}/default-app-block .
137 mv chrome%{?gcsuffix}/product_logo_*.{png,xpm} .
138 mv usr/share/applications/google-chrome%{?gcsuffix}.desktop .
139 mv chrome%{?gcsuffix}/google-chrome* .
140 chmod a+x chrome%{?gcsuffix}/lib*.so*
142 # separate to subpackage
143 install -d browser-plugins
144 mv chrome%{?gcsuffix}/libpdf.so browser-plugins
145 mv chrome%{?gcsuffix}/PepperFlash browser-plugins
146 chmod a+rx browser-plugins/PepperFlash/*.so
148 # included in gnome-control-center-2.28.1-3
149 rm default-app-block default-apps/google-chrome%{?gcsuffix}.xml
151 # xdg-utils snapshot required
152 rm chrome%{?gcsuffix}/xdg-settings
153 rm chrome%{?gcsuffix}/xdg-mime
155 [ -f *.1.gz ] && gzip -d *.1.gz
157 %{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE4} > find-lang.sh
158 %{__sed} -i 's;/opt/google/chrome/product_logo_48.png;%{name}.png;' google-chrome%{?gcsuffix}.desktop
159 %{__sed} -i 's;/opt/google/chrome;%{_bindir};' google-chrome%{?gcsuffix}.desktop
160 %{__sed} -i 's;xhtml_xml;xhtml+xml;' google-chrome%{?gcsuffix}.desktop
161 %{__sed} -i 's#google-chrome-\(stable\|beta\|unstable\)#google-chrome#g' google-chrome%{?gcsuffix}.desktop
164 v=$(awk -F'"' '/version/{print $4}' browser-plugins/PepperFlash/manifest.json)
165 if [ "$v" != "%{flashv}" ]; then
170 # create extra file, for simplier scripting in chromium-browser.sh
171 echo "version=%{flashv}" > browser-plugins/PepperFlash/manifest.ver
174 rm -rf $RPM_BUILD_ROOT
175 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/{plugins,pepper},%{_mandir}/man1,%{_desktopdir},%{_libdir}/%{name}/themes} \
176 $RPM_BUILD_ROOT%{_datadir}/%{name}/extensions
178 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
179 %{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
180 cp -a chrome%{?gcsuffix}/* $RPM_BUILD_ROOT%{_libdir}/%{name}
181 cp -p google-chrome%{?gcsuffix}.1 $RPM_BUILD_ROOT%{_mandir}/man1/google-chrome.1
182 # for google-chrome --help
183 echo ".so google-chrome.1" > $RPM_BUILD_ROOT%{_mandir}/man1/chrome.1
184 cp -p google-chrome%{?gcsuffix}.desktop $RPM_BUILD_ROOT%{_desktopdir}/google-chrome.desktop
186 for icon in product_logo_*.png; do
187 size=${icon##product_logo_}
190 install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${size}x${size}/apps
191 cp -p $icon $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${size}x${size}/apps/%{name}.png
194 install -d $RPM_BUILD_ROOT%{_browserpluginsdir}
195 cp -a browser-plugins/* $RPM_BUILD_ROOT%{_browserpluginsdir}
197 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins
199 # binary needs to be at that specific location, or it will abort:
200 # [1070:1070:3265429789299:FATAL:zygote_host_linux.cc(130)] The SUID sandbox helper binary is missing: /opt/google/chrome/chrome-sandbox Aborting now.
202 install -d $RPM_BUILD_ROOT/opt/google
203 # see if CHROME_DEVEL_SANDBOX env var helps
204 # content/browser/browser_main_loop.cc
205 ln -s %{_libdir}/%{name} $RPM_BUILD_ROOT/opt/google/chrome%{?gcsuffix}
207 # official rpm just add libudev.so.0 -> libudev.so.1 symlink, so we use similar hack here
208 if grep -qE "libudev\.so\.0" $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome; then
209 %{__sed} -i -e 's#libudev\.so\.0#libudev.so.1#g' $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome
211 echo "Hack no longer needed? No longer linked with libudev.so.0 ?" >&2
216 %find_lang %{name}.lang
217 # always package en-US (in main package)
218 %{__sed} -i -e '/en-US.pak/d' %{name}.lang
221 rm -rf $RPM_BUILD_ROOT
224 %update_icon_cache hicolor
225 %update_browser_plugins
228 if [ "$1" = 0 ]; then
229 %update_icon_cache hicolor
230 %update_browser_plugins
233 %post -n browser-plugin-adobe-flash
234 %update_browser_plugins
236 %postun -n browser-plugin-adobe-flash
237 if [ "$1" = 0 ]; then
238 %update_browser_plugins
241 %post -n browser-plugin-chrome-pdf
242 %update_browser_plugins
244 %postun -n browser-plugin-chrome-pdf
245 if [ "$1" = 0 ]; then
246 %update_browser_plugins
249 # FIXME: chrome *needs* it to be in application dir. add symlink until it can load from other places
250 # FIXME: link PepperFlash, browser-plugins ignores subdirs, and currently nothing else than chrome browsers can do pepper
251 %triggerin -n browser-plugin-adobe-flash -- google-chrome
252 test -L %{_libdir}/%{name}/PepperFlash || ln -sf %{_browserpluginsdir}/PepperFlash %{_libdir}/%{name}/PepperFlash
254 %triggerun -n browser-plugin-adobe-flash -- google-chrome
255 if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L %{_libdir}/%{name}/PepperFlash ]; then
256 rm -f %{_libdir}/%{name}/PepperFlash
259 %triggerin -n browser-plugin-chrome-pdf -- google-chrome
260 test -L %{_libdir}/%{name}/libpdf.so || ln -sf plugins/libpdf.so %{_libdir}/%{name}/libpdf.so
262 %triggerun -n browser-plugin-chrome-pdf -- google-chrome
263 if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L %{_libdir}/%{name}/libpdf.so ]; then
264 rm -f %{_libdir}/%{name}/libpdf.so
267 %triggerin -n browser-plugin-adobe-flash -- chromium-browser-bin
268 test -L %{_libdir}/chromium-browser-bin/PepperFlash || ln -sf %{_browserpluginsdir}/PepperFlash %{_libdir}/chromium-browser-bin/PepperFlash
270 %triggerun -n browser-plugin-adobe-flash -- chromium-browser-bin
271 if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L %{_libdir}/chromium-browser-bin/PepperFlash ]; then
272 rm -f %{_libdir}/chromium-browser-bin/PepperFlash
275 %triggerin -n browser-plugin-chrome-pdf -- chromium-browser-bin
276 test -L %{_libdir}/chromium-browser-bin/libpdf.so || ln -sf plugins/libpdf.so %{_libdir}/chromium-browser-bin/libpdf.so
278 %triggerun -n browser-plugin-chrome-pdf -- chromium-browser-bin
279 if [ "$1" = "0" ] || [ "$2" = "0" ] && [-L %{_libdir}/chromium-browser-bin/libpdf.so ]; then
280 rm -f %{_libdir}/chromium-browser-bin/libpdf.so
284 %defattr(644,root,root,755)
286 %{_browserpluginsconfdir}/browsers.d/%{name}.*
287 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
289 %attr(755,root,root) %{_bindir}/%{name}
291 %{_desktopdir}/*.desktop
292 %{_iconsdir}/hicolor/*/apps/%{name}.png
294 %dir %{_libdir}/%{name}
295 %dir %{_libdir}/%{name}/lib
296 %{_libdir}/%{name}/icudtl.dat
297 %{_libdir}/%{name}/chrome_100_percent.pak
298 %{_libdir}/%{name}/resources.pak
299 %dir %{_libdir}/%{name}/locales
300 %{_libdir}/%{name}/locales/en-US.pak
301 %dir %{_libdir}/%{name}/plugins
302 # hardcoded list of pepper plugins chrome can load
303 # see https://chromium.googlesource.com/chromium/chromium/+/trunk/chrome/common/chrome_paths.cc
304 %dir %{_libdir}/%{name}/pepper
305 %dir %{_datadir}/%{name}
306 # The path to the external extension <id>.json files.
307 # see https://chromium.googlesource.com/chromium/chromium/+/trunk/chrome/common/chrome_paths.cc
308 %dir %{_datadir}/%{name}/extensions
309 %{_libdir}/%{name}/default_apps
310 %{_libdir}/%{name}/themes
311 %attr(755,root,root) %{_libdir}/%{name}/chrome
312 %attr(755,root,root) %{_libdir}/%{name}/lib/libpeerconnection.so
313 # These unique permissions are intentional and necessary for the sandboxing
314 %attr(4555,root,root) %{_libdir}/%{name}/chrome-sandbox
317 %attr(755,root,root) %{_libdir}/%{name}/nacl_helper
318 %attr(755,root,root) %{_libdir}/%{name}/nacl_helper_bootstrap
319 %attr(755,root,root) %{_libdir}/%{name}/nacl_irt_x86_*.nexe
322 %attr(755,root,root) %{_libdir}/%{name}/libwidevinecdm.so
323 %attr(755,root,root) %{_libdir}/%{name}/libwidevinecdmadapter.so
326 %attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so
330 /opt/google/chrome%{?gcsuffix}
332 %files l10n -f %{name}.lang
333 %defattr(644,root,root,755)
335 %files -n browser-plugin-chrome-pdf
336 %defattr(644,root,root,755)
337 %attr(755,root,root) %{_browserpluginsdir}/libpdf.so
339 %files -n browser-plugin-adobe-flash
340 %defattr(644,root,root,755)
341 %dir %{_browserpluginsdir}/PepperFlash
342 %{_browserpluginsdir}/PepperFlash/manifest.json
343 %{_browserpluginsdir}/PepperFlash/manifest.ver
344 %attr(755,root,root) %{_browserpluginsdir}/PepperFlash/libpepflashplayer.so