]>
Commit | Line | Data |
---|---|---|
4833ef5f | 1 | # NOTE |
0f2fa0e4 | 2 | # - to look and update to new version, use update-source.sh script |
a054d194 | 3 | |
ea01ae47 | 4 | %define svnrev 1 |
c4c0335a | 5 | %define flashv 18.0.0.160 |
548b2cd3 | 6 | #define rel %{nil} |
ccf1ba3b | 7 | %define state stable |
c7941520 AM |
8 | %if "%{state}" == "beta" || "%{state}" == "unstable" |
9 | %define gcsuffix -%{state} | |
10 | %endif | |
b678fd32 ER |
11 | Summary: Google Chrome |
12 | Name: google-chrome | |
829d01aa | 13 | Version: 43.0.2357.125 |
548b2cd3 | 14 | Release: %{svnrev}%{?rel:.%{rel}} |
b678fd32 ER |
15 | License: Multiple, see http://chrome.google.com/ |
16 | Group: Applications/Networking | |
b0d47e63 | 17 | Source0: http://dl.google.com/linux/chrome/rpm/stable/i386/%{name}-%{state}-%{version}-%{svnrev}.i386.rpm |
829d01aa | 18 | # NoSource0-md5: cd296cd4eeec349df3a5f468091c5f12 |
fadb1c32 | 19 | NoSource: 0 |
b0d47e63 | 20 | Source1: http://dl.google.com/linux/chrome/rpm/stable/x86_64/%{name}-%{state}-%{version}-%{svnrev}.x86_64.rpm |
829d01aa | 21 | # NoSource1-md5: d314942c8ae41bb8585c27d8c5c497ee |
fadb1c32 | 22 | NoSource: 1 |
b678fd32 ER |
23 | Source2: %{name}.sh |
24 | Source4: find-lang.sh | |
25 | URL: http://chrome.google.com/ | |
26 | BuildRequires: rpm-utils | |
27 | BuildRequires: rpmbuild(macros) >= 1.453 | |
fb2a0216 | 28 | BuildRequires: sed >= 4.0 |
b678fd32 | 29 | Requires: browser-plugins >= 2.0 |
95e0f74d ER |
30 | # crashes if no fontconfig font present |
31 | Requires: fonts-Type1-urw | |
0372c07e | 32 | Requires: hicolor-icon-theme |
13034b9f | 33 | Requires: xdg-utils >= 1.0.2-4 |
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}} | |
b678fd32 ER |
38 | ExclusiveArch: %{ix86} %{x8664} |
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 | |
103 | %ifarch %{ix86} | |
f87433fa | 104 | SOURCE=%{S:0} |
b678fd32 ER |
105 | %endif |
106 | %ifarch %{x8664} | |
f87433fa | 107 | SOURCE=%{S:1} |
b678fd32 ER |
108 | %endif |
109 | ||
4833ef5f ER |
110 | V=$(rpm -qp --nodigest --nosignature --qf '%{V}' $SOURCE) |
111 | R=$(rpm -qp --nodigest --nosignature --qf '%{R}' $SOURCE) | |
548b2cd3 | 112 | if [ version:$V != version:%{crver} -o svnrev:$R != svnrev:%{svnrev} ]; then |
f87433fa ER |
113 | exit 1 |
114 | fi | |
115 | rpm2cpio $SOURCE | cpio -i -d | |
116 | ||
c7941520 | 117 | mv opt/google/chrome%{?gcsuffix} . |
b678fd32 ER |
118 | mv usr/share/man/man1/* . |
119 | mv usr/share/gnome-control-center/default-apps . | |
c7941520 AM |
120 | mv chrome%{?gcsuffix}/default-app-block . |
121 | mv chrome%{?gcsuffix}/product_logo_*.{png,xpm} . | |
122 | mv usr/share/applications/google-chrome%{?gcsuffix}.desktop . | |
123 | mv chrome%{?gcsuffix}/google-chrome* . | |
124 | chmod a+x chrome%{?gcsuffix}/lib*.so* | |
b678fd32 | 125 | |
f6b3cf39 ER |
126 | # separate to subpackage |
127 | install -d browser-plugins | |
c7941520 | 128 | mv chrome%{?gcsuffix}/PepperFlash browser-plugins |
e5492c1c | 129 | chmod a+rx browser-plugins/PepperFlash/*.so |
f6b3cf39 | 130 | |
15e0d90c | 131 | # included in gnome-control-center-2.28.1-3 |
c7941520 | 132 | rm default-app-block default-apps/google-chrome%{?gcsuffix}.xml |
15e0d90c | 133 | |
13034b9f | 134 | # xdg-utils snapshot required |
c7941520 AM |
135 | rm chrome%{?gcsuffix}/xdg-settings |
136 | rm chrome%{?gcsuffix}/xdg-mime | |
13034b9f | 137 | |
75aed2cc | 138 | [ -f *.1.gz ] && gzip -d *.1.gz |
b678fd32 ER |
139 | |
140 | %{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE4} > find-lang.sh | |
c7941520 AM |
141 | %{__sed} -i 's;/opt/google/chrome/product_logo_48.png;%{name}.png;' google-chrome%{?gcsuffix}.desktop |
142 | %{__sed} -i 's;/opt/google/chrome;%{_bindir};' google-chrome%{?gcsuffix}.desktop | |
143 | %{__sed} -i 's;xhtml_xml;xhtml+xml;' google-chrome%{?gcsuffix}.desktop | |
144 | %{__sed} -i 's#google-chrome-\(stable\|beta\|unstable\)#google-chrome#g' google-chrome%{?gcsuffix}.desktop | |
b678fd32 | 145 | |
548b2cd3 | 146 | %build |
e5492c1c ER |
147 | v=$(awk -F'"' '/version/{print $4}' browser-plugins/PepperFlash/manifest.json) |
148 | if [ "$v" != "%{flashv}" ]; then | |
548b2cd3 ER |
149 | : wrong version |
150 | exit 1 | |
151 | fi | |
152 | ||
770f0756 ER |
153 | # create extra file, for simplier scripting in chromium-browser.sh |
154 | echo "version=%{flashv}" > browser-plugins/PepperFlash/manifest.ver | |
155 | ||
b678fd32 ER |
156 | %install |
157 | rm -rf $RPM_BUILD_ROOT | |
d47bc555 ER |
158 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/{plugins,pepper},%{_mandir}/man1,%{_desktopdir},%{_libdir}/%{name}/themes} \ |
159 | $RPM_BUILD_ROOT%{_datadir}/%{name}/extensions | |
b678fd32 ER |
160 | |
161 | install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name} | |
162 | %{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name} | |
c7941520 AM |
163 | cp -a chrome%{?gcsuffix}/* $RPM_BUILD_ROOT%{_libdir}/%{name} |
164 | cp -p google-chrome%{?gcsuffix}.1 $RPM_BUILD_ROOT%{_mandir}/man1/google-chrome.1 | |
b48d09d7 | 165 | # for google-chrome --help |
44efe6ee | 166 | echo ".so google-chrome.1" > $RPM_BUILD_ROOT%{_mandir}/man1/chrome.1 |
c7941520 | 167 | cp -p google-chrome%{?gcsuffix}.desktop $RPM_BUILD_ROOT%{_desktopdir}/google-chrome.desktop |
0372c07e ER |
168 | |
169 | for icon in product_logo_*.png; do | |
170 | size=${icon##product_logo_} | |
171 | size=${size%.png} | |
172 | ||
173 | install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${size}x${size}/apps | |
174 | cp -p $icon $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${size}x${size}/apps/%{name}.png | |
175 | done | |
b678fd32 | 176 | |
f6b3cf39 | 177 | install -d $RPM_BUILD_ROOT%{_browserpluginsdir} |
e5492c1c | 178 | cp -a browser-plugins/* $RPM_BUILD_ROOT%{_browserpluginsdir} |
f6b3cf39 | 179 | |
b678fd32 ER |
180 | %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins |
181 | ||
0c3918d7 ER |
182 | # binary needs to be at that specific location, or it will abort: |
183 | # [1070:1070:3265429789299:FATAL:zygote_host_linux.cc(130)] The SUID sandbox helper binary is missing: /opt/google/chrome/chrome-sandbox Aborting now. | |
184 | # Aborted | |
185 | install -d $RPM_BUILD_ROOT/opt/google | |
b3bb2938 ER |
186 | # see if CHROME_DEVEL_SANDBOX env var helps |
187 | # content/browser/browser_main_loop.cc | |
c7941520 | 188 | ln -s %{_libdir}/%{name} $RPM_BUILD_ROOT/opt/google/chrome%{?gcsuffix} |
0c3918d7 | 189 | |
f5e810fe | 190 | # official rpm just add libudev.so.0 -> libudev.so.1 symlink, so we use similar hack here |
f555d3cb ER |
191 | if grep -qE "libudev\.so\.0" $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome; then |
192 | %{__sed} -i -e 's#libudev\.so\.0#libudev.so.1#g' $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome | |
f5e810fe AM |
193 | else |
194 | echo "Hack no longer needed? No longer linked with libudev.so.0 ?" >&2 | |
195 | exit 1 | |
196 | fi | |
197 | ||
b678fd32 ER |
198 | # find locales |
199 | %find_lang %{name}.lang | |
7d308590 ER |
200 | # always package en-US (in main package) |
201 | %{__sed} -i -e '/en-US.pak/d' %{name}.lang | |
b678fd32 ER |
202 | |
203 | %clean | |
204 | rm -rf $RPM_BUILD_ROOT | |
205 | ||
206 | %post | |
0372c07e | 207 | %update_icon_cache hicolor |
b678fd32 ER |
208 | %update_browser_plugins |
209 | ||
210 | %postun | |
211 | if [ "$1" = 0 ]; then | |
0372c07e | 212 | %update_icon_cache hicolor |
b678fd32 ER |
213 | %update_browser_plugins |
214 | fi | |
215 | ||
f6b3cf39 ER |
216 | %post -n browser-plugin-adobe-flash |
217 | %update_browser_plugins | |
218 | ||
219 | %postun -n browser-plugin-adobe-flash | |
220 | if [ "$1" = 0 ]; then | |
221 | %update_browser_plugins | |
222 | fi | |
223 | ||
f6b3cf39 | 224 | # FIXME: chrome *needs* it to be in application dir. add symlink until it can load from other places |
e5492c1c ER |
225 | # FIXME: link PepperFlash, browser-plugins ignores subdirs, and currently nothing else than chrome browsers can do pepper |
226 | %triggerin -n browser-plugin-adobe-flash -- google-chrome | |
f555d3cb | 227 | test -L %{_libdir}/%{name}/PepperFlash || ln -sf %{_browserpluginsdir}/PepperFlash %{_libdir}/%{name}/PepperFlash |
e5492c1c ER |
228 | |
229 | %triggerun -n browser-plugin-adobe-flash -- google-chrome | |
f555d3cb ER |
230 | if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L %{_libdir}/%{name}/PepperFlash ]; then |
231 | rm -f %{_libdir}/%{name}/PepperFlash | |
e5492c1c ER |
232 | fi |
233 | ||
e5492c1c ER |
234 | %triggerin -n browser-plugin-adobe-flash -- chromium-browser-bin |
235 | test -L %{_libdir}/chromium-browser-bin/PepperFlash || ln -sf %{_browserpluginsdir}/PepperFlash %{_libdir}/chromium-browser-bin/PepperFlash | |
236 | ||
237 | %triggerun -n browser-plugin-adobe-flash -- chromium-browser-bin | |
238 | if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L %{_libdir}/chromium-browser-bin/PepperFlash ]; then | |
239 | rm -f %{_libdir}/chromium-browser-bin/PepperFlash | |
240 | fi | |
f6b3cf39 | 241 | |
bbdd4bed | 242 | %files |
b678fd32 ER |
243 | %defattr(644,root,root,755) |
244 | ||
245 | %{_browserpluginsconfdir}/browsers.d/%{name}.* | |
246 | %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist | |
247 | ||
248 | %attr(755,root,root) %{_bindir}/%{name} | |
249 | %{_mandir}/man1/*.1* | |
b678fd32 | 250 | %{_desktopdir}/*.desktop |
0372c07e ER |
251 | %{_iconsdir}/hicolor/*/apps/%{name}.png |
252 | ||
b678fd32 | 253 | %dir %{_libdir}/%{name} |
7d599979 | 254 | %{_libdir}/%{name}/icudtl.dat |
c5a68d5a | 255 | %{_libdir}/%{name}/chrome_100_percent.pak |
7a6d8c00 | 256 | %{_libdir}/%{name}/chrome_200_percent.pak |
7d599979 | 257 | %{_libdir}/%{name}/resources.pak |
6701b213 AM |
258 | %{_libdir}/%{name}/natives_blob.bin |
259 | %{_libdir}/%{name}/snapshot_blob.bin | |
b678fd32 | 260 | %dir %{_libdir}/%{name}/locales |
7d308590 | 261 | %{_libdir}/%{name}/locales/en-US.pak |
b678fd32 | 262 | %dir %{_libdir}/%{name}/plugins |
d47bc555 ER |
263 | # hardcoded list of pepper plugins chrome can load |
264 | # see https://chromium.googlesource.com/chromium/chromium/+/trunk/chrome/common/chrome_paths.cc | |
265 | %dir %{_libdir}/%{name}/pepper | |
c6e13b17 | 266 | %dir %{_datadir}/%{name} |
d47bc555 ER |
267 | # The path to the external extension <id>.json files. |
268 | # see https://chromium.googlesource.com/chromium/chromium/+/trunk/chrome/common/chrome_paths.cc | |
c6e13b17 | 269 | %dir %{_datadir}/%{name}/extensions |
46df17af | 270 | %{_libdir}/%{name}/default_apps |
b678fd32 ER |
271 | %{_libdir}/%{name}/themes |
272 | %attr(755,root,root) %{_libdir}/%{name}/chrome | |
273 | # These unique permissions are intentional and necessary for the sandboxing | |
274 | %attr(4555,root,root) %{_libdir}/%{name}/chrome-sandbox | |
275 | ||
1bb896c1 ER |
276 | # nacl |
277 | %attr(755,root,root) %{_libdir}/%{name}/nacl_helper | |
278 | %attr(755,root,root) %{_libdir}/%{name}/nacl_helper_bootstrap | |
279 | %attr(755,root,root) %{_libdir}/%{name}/nacl_irt_x86_*.nexe | |
5622b044 AM |
280 | |
281 | # DRM | |
282 | %attr(755,root,root) %{_libdir}/%{name}/libwidevinecdm.so | |
283 | %attr(755,root,root) %{_libdir}/%{name}/libwidevinecdmadapter.so | |
1bb896c1 | 284 | |
b678fd32 ER |
285 | # ffmpeg libs |
286 | %attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so | |
0c3918d7 ER |
287 | |
288 | # hack | |
ebfaf44a | 289 | %dir /opt/google |
c7941520 | 290 | /opt/google/chrome%{?gcsuffix} |
f6b3cf39 | 291 | |
7d308590 ER |
292 | %files l10n -f %{name}.lang |
293 | %defattr(644,root,root,755) | |
294 | ||
f6b3cf39 ER |
295 | %files -n browser-plugin-adobe-flash |
296 | %defattr(644,root,root,755) | |
e5492c1c ER |
297 | %dir %{_browserpluginsdir}/PepperFlash |
298 | %{_browserpluginsdir}/PepperFlash/manifest.json | |
770f0756 | 299 | %{_browserpluginsdir}/PepperFlash/manifest.ver |
e5492c1c | 300 | %attr(755,root,root) %{_browserpluginsdir}/PepperFlash/libpepflashplayer.so |