]>
Commit | Line | Data |
---|---|---|
4833ef5f | 1 | # NOTE |
0f2fa0e4 | 2 | # - to look and update to new version, use update-source.sh script |
f90488f9 ER |
3 | # |
4 | # Conditional build: | |
8fb7d086 | 5 | %bcond_with ffmpegsumo # using ffmpegsumo |
a054d194 | 6 | |
24a18878 | 7 | %define flashv 18.0.0.209 |
ccf1ba3b | 8 | %define state stable |
c7941520 AM |
9 | %if "%{state}" == "beta" || "%{state}" == "unstable" |
10 | %define gcsuffix -%{state} | |
11 | %endif | |
b678fd32 ER |
12 | Summary: Google Chrome |
13 | Name: google-chrome | |
d2d63271 | 14 | Version: 44.0.2403.130 |
b6c0552a | 15 | Release: 1 |
b678fd32 ER |
16 | License: Multiple, see http://chrome.google.com/ |
17 | Group: Applications/Networking | |
b6c0552a | 18 | Source0: http://dl.google.com/linux/chrome/rpm/stable/i386/%{name}-%{state}-%{version}-%{release}.i386.rpm |
d2d63271 | 19 | # NoSource0-md5: 70a46cfc77f8ddd59d77d3898988e3dc |
fadb1c32 | 20 | NoSource: 0 |
b6c0552a | 21 | Source1: http://dl.google.com/linux/chrome/rpm/stable/x86_64/%{name}-%{state}-%{version}-%{release}.x86_64.rpm |
d2d63271 | 22 | # NoSource1-md5: 353b323ba8c952c325c9521260903f8d |
fadb1c32 | 23 | NoSource: 1 |
b678fd32 ER |
24 | Source2: %{name}.sh |
25 | Source4: find-lang.sh | |
26 | URL: http://chrome.google.com/ | |
27 | BuildRequires: rpm-utils | |
28 | BuildRequires: rpmbuild(macros) >= 1.453 | |
fb2a0216 | 29 | BuildRequires: sed >= 4.0 |
b678fd32 | 30 | Requires: browser-plugins >= 2.0 |
95e0f74d ER |
31 | # crashes if no fontconfig font present |
32 | Requires: fonts-Type1-urw | |
0372c07e | 33 | Requires: hicolor-icon-theme |
13034b9f | 34 | Requires: xdg-utils >= 1.0.2-4 |
3b9c390e AM |
35 | # https://www.phoronix.com/scan.php?page=news_item&px=Google-Chrome-TSYNC-Kernel |
36 | Requires: uname(release) >= 3.17 | |
f6b3cf39 | 37 | Suggests: browser-plugin-adobe-flash |
e5492c1c | 38 | Provides: wwwbrowser |
fd243dcf ER |
39 | # add conflicts to trigger their update when main package is updated |
40 | Conflicts: browser-plugin-adobe-flash < %{flashv}-%{!?rel:1}%{?rel:%{rel}} | |
b678fd32 ER |
41 | ExclusiveArch: %{ix86} %{x8664} |
42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
43 | ||
548b2cd3 ER |
44 | %{expand:%%define crver %{version}} |
45 | ||
b678fd32 ER |
46 | %define find_lang sh find-lang.sh %{buildroot} |
47 | ||
48 | %define _enable_debug_packages 0 | |
49 | %define no_install_post_strip 1 | |
50 | ||
b678fd32 | 51 | %define ffmpeg_caps libffmpegsumo.so |
e5492c1c | 52 | %define flash_caps libpepflashplayer.so |
b678fd32 ER |
53 | |
54 | # list of script capabilities (regexps) not to be used in Provides | |
876c36c7 | 55 | %define _noautoprov %{ffmpeg_caps} %{flash_caps} |
b678fd32 ER |
56 | # do not require them either |
57 | %define _noautoreq %{_noautoprov} | |
58 | ||
59 | %description | |
60 | The web browser from Google | |
61 | ||
62 | Google Chrome is a browser that combines a minimal design with | |
63 | sophisticated technology to make the web faster, safer, and easier. | |
64 | ||
e086d25f ZU |
65 | %description -l hu.UTF-8 |
66 | Webböngésző a Google-től. | |
67 | ||
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. | |
71 | ||
7d308590 ER |
72 | %package l10n |
73 | Summary: google chrome language packages | |
74 | Group: I18n | |
75 | Requires: %{name} = %{version}-%{release} | |
76 | ||
77 | %description l10n | |
78 | This package contains language packages for 50 languages: | |
79 | ||
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, | |
83 | zh-TW | |
84 | ||
548b2cd3 | 85 | # IMPORTANT: keep flash plugin defined as last package |
f6b3cf39 ER |
86 | %package -n browser-plugin-adobe-flash |
87 | Summary: Adobe Flash plugin from Google Chrome | |
88 | Summary(pl.UTF-8): Wtyczka Adobe Flash z Google Chrome | |
548b2cd3 ER |
89 | Version: %{flashv} |
90 | Release: %{!?rel:1}%{?rel:%{rel}} | |
91 | License: Free to use, non-distributable | |
f6b3cf39 ER |
92 | Group: X11/Applications/Multimedia |
93 | Requires: browser-plugins >= 2.0 | |
73c8759f | 94 | Conflicts: google-chrome < 19.0.1084.52 |
f6b3cf39 ER |
95 | |
96 | %description -n browser-plugin-adobe-flash | |
97 | Adobe Flash plugin from Google Chrome, which is not available in | |
98 | Chromium. | |
99 | ||
100 | %description -n browser-plugin-adobe-flash -l pl.UTF-8 | |
101 | Wtyczka Adobe Flash z Google Chrome, która nie jest dostępna w | |
102 | Chromium. | |
103 | ||
b678fd32 ER |
104 | %prep |
105 | %setup -qcT | |
106 | %ifarch %{ix86} | |
f87433fa | 107 | SOURCE=%{S:0} |
b678fd32 ER |
108 | %endif |
109 | %ifarch %{x8664} | |
f87433fa | 110 | SOURCE=%{S:1} |
b678fd32 ER |
111 | %endif |
112 | ||
4833ef5f ER |
113 | V=$(rpm -qp --nodigest --nosignature --qf '%{V}' $SOURCE) |
114 | R=$(rpm -qp --nodigest --nosignature --qf '%{R}' $SOURCE) | |
b6c0552a | 115 | if [ version:$V != version:%{crver} -o release:$R != release:%{release} ]; then |
f87433fa ER |
116 | exit 1 |
117 | fi | |
118 | rpm2cpio $SOURCE | cpio -i -d | |
119 | ||
c7941520 | 120 | mv opt/google/chrome%{?gcsuffix} . |
b678fd32 ER |
121 | mv usr/share/man/man1/* . |
122 | mv usr/share/gnome-control-center/default-apps . | |
c7941520 AM |
123 | mv chrome%{?gcsuffix}/default-app-block . |
124 | mv chrome%{?gcsuffix}/product_logo_*.{png,xpm} . | |
125 | mv usr/share/applications/google-chrome%{?gcsuffix}.desktop . | |
126 | mv chrome%{?gcsuffix}/google-chrome* . | |
127 | chmod a+x chrome%{?gcsuffix}/lib*.so* | |
b678fd32 | 128 | |
f6b3cf39 ER |
129 | # separate to subpackage |
130 | install -d browser-plugins | |
c7941520 | 131 | mv chrome%{?gcsuffix}/PepperFlash browser-plugins |
e5492c1c | 132 | chmod a+rx browser-plugins/PepperFlash/*.so |
f6b3cf39 | 133 | |
15e0d90c | 134 | # included in gnome-control-center-2.28.1-3 |
c7941520 | 135 | rm default-app-block default-apps/google-chrome%{?gcsuffix}.xml |
15e0d90c | 136 | |
13034b9f | 137 | # xdg-utils snapshot required |
c7941520 AM |
138 | rm chrome%{?gcsuffix}/xdg-settings |
139 | rm chrome%{?gcsuffix}/xdg-mime | |
13034b9f | 140 | |
75aed2cc | 141 | [ -f *.1.gz ] && gzip -d *.1.gz |
b678fd32 ER |
142 | |
143 | %{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE4} > find-lang.sh | |
c7941520 AM |
144 | %{__sed} -i 's;/opt/google/chrome/product_logo_48.png;%{name}.png;' google-chrome%{?gcsuffix}.desktop |
145 | %{__sed} -i 's;/opt/google/chrome;%{_bindir};' google-chrome%{?gcsuffix}.desktop | |
146 | %{__sed} -i 's;xhtml_xml;xhtml+xml;' google-chrome%{?gcsuffix}.desktop | |
147 | %{__sed} -i 's#google-chrome-\(stable\|beta\|unstable\)#google-chrome#g' google-chrome%{?gcsuffix}.desktop | |
b678fd32 | 148 | |
548b2cd3 | 149 | %build |
e5492c1c ER |
150 | v=$(awk -F'"' '/version/{print $4}' browser-plugins/PepperFlash/manifest.json) |
151 | if [ "$v" != "%{flashv}" ]; then | |
548b2cd3 ER |
152 | : wrong version |
153 | exit 1 | |
154 | fi | |
155 | ||
770f0756 ER |
156 | # create extra file, for simplier scripting in chromium-browser.sh |
157 | echo "version=%{flashv}" > browser-plugins/PepperFlash/manifest.ver | |
158 | ||
b678fd32 ER |
159 | %install |
160 | rm -rf $RPM_BUILD_ROOT | |
d47bc555 ER |
161 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/{plugins,pepper},%{_mandir}/man1,%{_desktopdir},%{_libdir}/%{name}/themes} \ |
162 | $RPM_BUILD_ROOT%{_datadir}/%{name}/extensions | |
b678fd32 ER |
163 | |
164 | install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name} | |
165 | %{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name} | |
c7941520 AM |
166 | cp -a chrome%{?gcsuffix}/* $RPM_BUILD_ROOT%{_libdir}/%{name} |
167 | cp -p google-chrome%{?gcsuffix}.1 $RPM_BUILD_ROOT%{_mandir}/man1/google-chrome.1 | |
b48d09d7 | 168 | # for google-chrome --help |
44efe6ee | 169 | echo ".so google-chrome.1" > $RPM_BUILD_ROOT%{_mandir}/man1/chrome.1 |
c7941520 | 170 | cp -p google-chrome%{?gcsuffix}.desktop $RPM_BUILD_ROOT%{_desktopdir}/google-chrome.desktop |
0372c07e ER |
171 | |
172 | for icon in product_logo_*.png; do | |
173 | size=${icon##product_logo_} | |
174 | size=${size%.png} | |
175 | ||
176 | install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${size}x${size}/apps | |
177 | cp -p $icon $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${size}x${size}/apps/%{name}.png | |
178 | done | |
b678fd32 | 179 | |
f6b3cf39 | 180 | install -d $RPM_BUILD_ROOT%{_browserpluginsdir} |
e5492c1c | 181 | cp -a browser-plugins/* $RPM_BUILD_ROOT%{_browserpluginsdir} |
f6b3cf39 | 182 | |
b678fd32 ER |
183 | %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins |
184 | ||
0c3918d7 ER |
185 | # binary needs to be at that specific location, or it will abort: |
186 | # [1070:1070:3265429789299:FATAL:zygote_host_linux.cc(130)] The SUID sandbox helper binary is missing: /opt/google/chrome/chrome-sandbox Aborting now. | |
187 | # Aborted | |
188 | install -d $RPM_BUILD_ROOT/opt/google | |
b3bb2938 ER |
189 | # see if CHROME_DEVEL_SANDBOX env var helps |
190 | # content/browser/browser_main_loop.cc | |
c7941520 | 191 | ln -s %{_libdir}/%{name} $RPM_BUILD_ROOT/opt/google/chrome%{?gcsuffix} |
0c3918d7 | 192 | |
f5e810fe | 193 | # official rpm just add libudev.so.0 -> libudev.so.1 symlink, so we use similar hack here |
f555d3cb ER |
194 | if grep -qE "libudev\.so\.0" $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome; then |
195 | %{__sed} -i -e 's#libudev\.so\.0#libudev.so.1#g' $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome | |
f5e810fe AM |
196 | else |
197 | echo "Hack no longer needed? No longer linked with libudev.so.0 ?" >&2 | |
198 | exit 1 | |
199 | fi | |
200 | ||
b678fd32 ER |
201 | # find locales |
202 | %find_lang %{name}.lang | |
7d308590 ER |
203 | # always package en-US (in main package) |
204 | %{__sed} -i -e '/en-US.pak/d' %{name}.lang | |
b678fd32 ER |
205 | |
206 | %clean | |
207 | rm -rf $RPM_BUILD_ROOT | |
208 | ||
209 | %post | |
0372c07e | 210 | %update_icon_cache hicolor |
b678fd32 ER |
211 | %update_browser_plugins |
212 | ||
213 | %postun | |
214 | if [ "$1" = 0 ]; then | |
0372c07e | 215 | %update_icon_cache hicolor |
b678fd32 ER |
216 | %update_browser_plugins |
217 | fi | |
218 | ||
f6b3cf39 ER |
219 | %post -n browser-plugin-adobe-flash |
220 | %update_browser_plugins | |
221 | ||
222 | %postun -n browser-plugin-adobe-flash | |
223 | if [ "$1" = 0 ]; then | |
224 | %update_browser_plugins | |
225 | fi | |
226 | ||
f6b3cf39 | 227 | # FIXME: chrome *needs* it to be in application dir. add symlink until it can load from other places |
e5492c1c ER |
228 | # FIXME: link PepperFlash, browser-plugins ignores subdirs, and currently nothing else than chrome browsers can do pepper |
229 | %triggerin -n browser-plugin-adobe-flash -- google-chrome | |
f555d3cb | 230 | test -L %{_libdir}/%{name}/PepperFlash || ln -sf %{_browserpluginsdir}/PepperFlash %{_libdir}/%{name}/PepperFlash |
e5492c1c ER |
231 | |
232 | %triggerun -n browser-plugin-adobe-flash -- google-chrome | |
f555d3cb ER |
233 | if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L %{_libdir}/%{name}/PepperFlash ]; then |
234 | rm -f %{_libdir}/%{name}/PepperFlash | |
e5492c1c ER |
235 | fi |
236 | ||
e5492c1c ER |
237 | %triggerin -n browser-plugin-adobe-flash -- chromium-browser-bin |
238 | test -L %{_libdir}/chromium-browser-bin/PepperFlash || ln -sf %{_browserpluginsdir}/PepperFlash %{_libdir}/chromium-browser-bin/PepperFlash | |
239 | ||
240 | %triggerun -n browser-plugin-adobe-flash -- chromium-browser-bin | |
241 | if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L %{_libdir}/chromium-browser-bin/PepperFlash ]; then | |
242 | rm -f %{_libdir}/chromium-browser-bin/PepperFlash | |
243 | fi | |
f6b3cf39 | 244 | |
bbdd4bed | 245 | %files |
b678fd32 ER |
246 | %defattr(644,root,root,755) |
247 | ||
248 | %{_browserpluginsconfdir}/browsers.d/%{name}.* | |
249 | %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist | |
250 | ||
251 | %attr(755,root,root) %{_bindir}/%{name} | |
252 | %{_mandir}/man1/*.1* | |
b678fd32 | 253 | %{_desktopdir}/*.desktop |
0372c07e ER |
254 | %{_iconsdir}/hicolor/*/apps/%{name}.png |
255 | ||
b678fd32 | 256 | %dir %{_libdir}/%{name} |
7d599979 | 257 | %{_libdir}/%{name}/icudtl.dat |
c5a68d5a | 258 | %{_libdir}/%{name}/chrome_100_percent.pak |
7a6d8c00 | 259 | %{_libdir}/%{name}/chrome_200_percent.pak |
7d599979 | 260 | %{_libdir}/%{name}/resources.pak |
6701b213 AM |
261 | %{_libdir}/%{name}/natives_blob.bin |
262 | %{_libdir}/%{name}/snapshot_blob.bin | |
b678fd32 | 263 | %dir %{_libdir}/%{name}/locales |
7d308590 | 264 | %{_libdir}/%{name}/locales/en-US.pak |
b678fd32 | 265 | %dir %{_libdir}/%{name}/plugins |
d47bc555 ER |
266 | # hardcoded list of pepper plugins chrome can load |
267 | # see https://chromium.googlesource.com/chromium/chromium/+/trunk/chrome/common/chrome_paths.cc | |
268 | %dir %{_libdir}/%{name}/pepper | |
c6e13b17 | 269 | %dir %{_datadir}/%{name} |
d47bc555 ER |
270 | # The path to the external extension <id>.json files. |
271 | # see https://chromium.googlesource.com/chromium/chromium/+/trunk/chrome/common/chrome_paths.cc | |
c6e13b17 | 272 | %dir %{_datadir}/%{name}/extensions |
46df17af | 273 | %{_libdir}/%{name}/default_apps |
b678fd32 ER |
274 | %{_libdir}/%{name}/themes |
275 | %attr(755,root,root) %{_libdir}/%{name}/chrome | |
276 | # These unique permissions are intentional and necessary for the sandboxing | |
277 | %attr(4555,root,root) %{_libdir}/%{name}/chrome-sandbox | |
278 | ||
1bb896c1 ER |
279 | # nacl |
280 | %attr(755,root,root) %{_libdir}/%{name}/nacl_helper | |
281 | %attr(755,root,root) %{_libdir}/%{name}/nacl_helper_bootstrap | |
282 | %attr(755,root,root) %{_libdir}/%{name}/nacl_irt_x86_*.nexe | |
5622b044 AM |
283 | |
284 | # DRM | |
285 | %attr(755,root,root) %{_libdir}/%{name}/libwidevinecdm.so | |
286 | %attr(755,root,root) %{_libdir}/%{name}/libwidevinecdmadapter.so | |
1bb896c1 | 287 | |
b678fd32 | 288 | # ffmpeg libs |
f90488f9 | 289 | %if %{with ffmpegsumo} |
b678fd32 | 290 | %attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so |
f90488f9 | 291 | %endif |
0c3918d7 ER |
292 | |
293 | # hack | |
ebfaf44a | 294 | %dir /opt/google |
c7941520 | 295 | /opt/google/chrome%{?gcsuffix} |
f6b3cf39 | 296 | |
7d308590 ER |
297 | %files l10n -f %{name}.lang |
298 | %defattr(644,root,root,755) | |
299 | ||
f6b3cf39 ER |
300 | %files -n browser-plugin-adobe-flash |
301 | %defattr(644,root,root,755) | |
e5492c1c ER |
302 | %dir %{_browserpluginsdir}/PepperFlash |
303 | %{_browserpluginsdir}/PepperFlash/manifest.json | |
770f0756 | 304 | %{_browserpluginsdir}/PepperFlash/manifest.ver |
e5492c1c | 305 | %attr(755,root,root) %{_browserpluginsdir}/PepperFlash/libpepflashplayer.so |