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