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