]>
Commit | Line | Data |
---|---|---|
1 | # NOTE | |
2 | # - to look and update to new version, use update-source.sh script | |
3 | # | |
4 | # Conditional build: | |
5 | %bcond_with ffmpegsumo # using ffmpegsumo | |
6 | ||
7 | %define flashv 20.0.0.306 | |
8 | %define state stable | |
9 | %if "%{state}" == "beta" || "%{state}" == "unstable" | |
10 | %define gcsuffix -%{state} | |
11 | %endif | |
12 | Summary: Google Chrome | |
13 | Name: google-chrome | |
14 | Version: 49.0.2623.87 | |
15 | Release: 1 | |
16 | License: Multiple, see http://chrome.google.com/ | |
17 | Group: Applications/Networking | |
18 | Source0: http://dl.google.com/linux/chrome/rpm/stable/x86_64/%{name}-%{state}-%{version}-%{release}.x86_64.rpm | |
19 | # NoSource0-md5: 726e3e5abe020f6c7adf4111219315fb | |
20 | NoSource: 0 | |
21 | Source1: %{name}.sh | |
22 | Source2: find-lang.sh | |
23 | URL: http://chrome.google.com/ | |
24 | BuildRequires: rpm-utils | |
25 | BuildRequires: rpmbuild(macros) >= 1.453 | |
26 | BuildRequires: sed >= 4.0 | |
27 | Requires: browser-plugins >= 2.0 | |
28 | # crashes if no fontconfig font present | |
29 | Requires: fonts-Type1-urw | |
30 | Requires: hicolor-icon-theme | |
31 | Requires: xdg-utils >= 1.0.2-4 | |
32 | # https://www.phoronix.com/scan.php?page=news_item&px=Google-Chrome-TSYNC-Kernel | |
33 | Requires: uname(release) >= 3.17 | |
34 | Suggests: browser-plugin-adobe-flash | |
35 | Provides: wwwbrowser | |
36 | # add conflicts to trigger their update when main package is updated | |
37 | Conflicts: browser-plugin-adobe-flash < %{flashv}-%{!?rel:1}%{?rel:%{rel}} | |
38 | ExclusiveArch: %{x8664} | |
39 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
40 | ||
41 | %{expand:%%define crver %{version}} | |
42 | ||
43 | %define find_lang sh find-lang.sh %{buildroot} | |
44 | ||
45 | %define _enable_debug_packages 0 | |
46 | %define no_install_post_strip 1 | |
47 | ||
48 | %define ffmpeg_caps libffmpegsumo.so | |
49 | %define flash_caps libpepflashplayer.so | |
50 | ||
51 | # list of script capabilities (regexps) not to be used in Provides | |
52 | %define _noautoprov %{ffmpeg_caps} %{flash_caps} | |
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 | ||
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 | ||
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 | ||
82 | # IMPORTANT: keep flash plugin defined as last package | |
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 | |
86 | Version: %{flashv} | |
87 | Release: %{!?rel:1}%{?rel:%{rel}} | |
88 | License: Free to use, non-distributable | |
89 | Group: X11/Applications/Multimedia | |
90 | Requires: browser-plugins >= 2.0 | |
91 | Conflicts: google-chrome < 19.0.1084.52 | |
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 | ||
101 | %prep | |
102 | %setup -qcT | |
103 | SOURCE=%{S:0} | |
104 | ||
105 | V=$(rpm -qp --nodigest --nosignature --qf '%{V}' $SOURCE) | |
106 | R=$(rpm -qp --nodigest --nosignature --qf '%{R}' $SOURCE) | |
107 | if [ version:$V != version:%{crver} -o release:$R != release:%{release} ]; then | |
108 | exit 1 | |
109 | fi | |
110 | rpm2cpio $SOURCE | cpio -i -d | |
111 | ||
112 | mv opt/google/chrome%{?gcsuffix} . | |
113 | mv usr/share/man/man1/* . | |
114 | mv usr/share/gnome-control-center/default-apps . | |
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* | |
120 | ||
121 | # separate to subpackage | |
122 | install -d browser-plugins | |
123 | mv chrome%{?gcsuffix}/PepperFlash browser-plugins | |
124 | chmod a+rx browser-plugins/PepperFlash/*.so | |
125 | ||
126 | # included in gnome-control-center-2.28.1-3 | |
127 | rm default-app-block default-apps/google-chrome%{?gcsuffix}.xml | |
128 | ||
129 | # xdg-utils snapshot required | |
130 | rm chrome%{?gcsuffix}/xdg-settings | |
131 | rm chrome%{?gcsuffix}/xdg-mime | |
132 | ||
133 | [ -f *.1.gz ] && gzip -d *.1.gz | |
134 | ||
135 | %{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE2} > find-lang.sh | |
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 | |
140 | ||
141 | %build | |
142 | v=$(awk -F'"' '/version/{print $4}' browser-plugins/PepperFlash/manifest.json) | |
143 | if [ "$v" != "%{flashv}" ]; then | |
144 | : wrong version | |
145 | exit 1 | |
146 | fi | |
147 | ||
148 | # create extra file, for simplier scripting in chromium-browser.sh | |
149 | echo "version=%{flashv}" > browser-plugins/PepperFlash/manifest.ver | |
150 | ||
151 | %install | |
152 | rm -rf $RPM_BUILD_ROOT | |
153 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/{plugins,pepper},%{_mandir}/man1,%{_desktopdir},%{_libdir}/%{name}/themes} \ | |
154 | $RPM_BUILD_ROOT%{_datadir}/%{name}/extensions | |
155 | ||
156 | install -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/%{name} | |
157 | %{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name} | |
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 | |
160 | # for google-chrome --help | |
161 | echo ".so google-chrome.1" > $RPM_BUILD_ROOT%{_mandir}/man1/chrome.1 | |
162 | cp -p google-chrome%{?gcsuffix}.desktop $RPM_BUILD_ROOT%{_desktopdir}/google-chrome.desktop | |
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 | |
171 | ||
172 | install -d $RPM_BUILD_ROOT%{_browserpluginsdir} | |
173 | cp -a browser-plugins/* $RPM_BUILD_ROOT%{_browserpluginsdir} | |
174 | ||
175 | %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins | |
176 | ||
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 | |
181 | # see if CHROME_DEVEL_SANDBOX env var helps | |
182 | # content/browser/browser_main_loop.cc | |
183 | ln -s %{_libdir}/%{name} $RPM_BUILD_ROOT/opt/google/chrome%{?gcsuffix} | |
184 | ||
185 | # official rpm just add libudev.so.0 -> libudev.so.1 symlink, so we use similar hack here | |
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 | |
188 | else | |
189 | echo "Hack no longer needed? No longer linked with libudev.so.0 ?" >&2 | |
190 | exit 1 | |
191 | fi | |
192 | ||
193 | # find locales | |
194 | %find_lang %{name}.lang | |
195 | # always package en-US (in main package) | |
196 | %{__sed} -i -e '/en-US.pak/d' %{name}.lang | |
197 | ||
198 | %clean | |
199 | rm -rf $RPM_BUILD_ROOT | |
200 | ||
201 | %post | |
202 | %update_icon_cache hicolor | |
203 | %update_browser_plugins | |
204 | ||
205 | %postun | |
206 | if [ "$1" = 0 ]; then | |
207 | %update_icon_cache hicolor | |
208 | %update_browser_plugins | |
209 | fi | |
210 | ||
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 | ||
219 | # FIXME: chrome *needs* it to be in application dir. add symlink until it can load from other places | |
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 | |
222 | test -L %{_libdir}/%{name}/PepperFlash || ln -sf %{_browserpluginsdir}/PepperFlash %{_libdir}/%{name}/PepperFlash | |
223 | ||
224 | %triggerun -n browser-plugin-adobe-flash -- google-chrome | |
225 | if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L %{_libdir}/%{name}/PepperFlash ]; then | |
226 | rm -f %{_libdir}/%{name}/PepperFlash | |
227 | fi | |
228 | ||
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 | |
236 | ||
237 | %files | |
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* | |
245 | %{_desktopdir}/*.desktop | |
246 | %{_iconsdir}/hicolor/*/apps/%{name}.png | |
247 | ||
248 | %dir %{_libdir}/%{name} | |
249 | %{_libdir}/%{name}/icudtl.dat | |
250 | %{_libdir}/%{name}/chrome_*_percent.pak | |
251 | %{_libdir}/%{name}/resources.pak | |
252 | %{_libdir}/%{name}/natives_blob.bin | |
253 | %{_libdir}/%{name}/snapshot_blob.bin | |
254 | %dir %{_libdir}/%{name}/locales | |
255 | %{_libdir}/%{name}/locales/en-US.pak | |
256 | %{_libdir}/%{name}/locales/fake-bidi.pak | |
257 | %dir %{_libdir}/%{name}/plugins | |
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 | |
261 | %dir %{_datadir}/%{name} | |
262 | # The path to the external extension <id>.json files. | |
263 | # see https://chromium.googlesource.com/chromium/chromium/+/trunk/chrome/common/chrome_paths.cc | |
264 | %dir %{_datadir}/%{name}/extensions | |
265 | %{_libdir}/%{name}/default_apps | |
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 | ||
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 | |
275 | ||
276 | # DRM | |
277 | %attr(755,root,root) %{_libdir}/%{name}/libwidevinecdm.so | |
278 | %attr(755,root,root) %{_libdir}/%{name}/libwidevinecdmadapter.so | |
279 | ||
280 | # ffmpeg libs | |
281 | %if %{with ffmpegsumo} | |
282 | %attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so | |
283 | %endif | |
284 | ||
285 | # hack | |
286 | %dir /opt/google | |
287 | /opt/google/chrome%{?gcsuffix} | |
288 | ||
289 | %files l10n -f %{name}.lang | |
290 | %defattr(644,root,root,755) | |
291 | ||
292 | %files -n browser-plugin-adobe-flash | |
293 | %defattr(644,root,root,755) | |
294 | %dir %{_browserpluginsdir}/PepperFlash | |
295 | %{_browserpluginsdir}/PepperFlash/manifest.json | |
296 | %{_browserpluginsdir}/PepperFlash/manifest.ver | |
297 | %attr(755,root,root) %{_browserpluginsdir}/PepperFlash/libpepflashplayer.so |