]> git.pld-linux.org Git - packages/google-chrome.git/blob - google-chrome.spec
e8cd82784091e560ce48072ff18b40566f0aca45
[packages/google-chrome.git] / google-chrome.spec
1 # NOTE
2 # - to look and update to new version, use update-source.sh script
3
4 %define         svnrev  1
5 %define         flashv  15.0.0.223
6 #define         rel             %{nil}
7 %define         state   stable
8 %if "%{state}" == "beta" || "%{state}" == "unstable"
9 %define         gcsuffix        -%{state}
10 %endif
11 Summary:        Google Chrome
12 Name:           google-chrome
13 Version:        39.0.2171.65
14 Release:        %{svnrev}%{?rel:.%{rel}}
15 License:        Multiple, see http://chrome.google.com/
16 Group:          Applications/Networking
17 Source0:        http://dl.google.com/linux/chrome/rpm/stable/i386/%{name}-%{state}-%{version}-%{svnrev}.i386.rpm
18 # NoSource0-md5:        aa52ccd4a08814320a229701d1d6ed81
19 NoSource:       0
20 Source1:        http://dl.google.com/linux/chrome/rpm/stable/x86_64/%{name}-%{state}-%{version}-%{svnrev}.x86_64.rpm
21 # NoSource1-md5:        2b6b582aa553c39c7ba62fa37a8f5864
22 NoSource:       1
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
28 BuildRequires:  sed >= 4.0
29 Requires:       browser-plugins >= 2.0
30 # crashes if no fontconfig font present
31 Requires:       fonts-Type1-urw
32 Requires:       hicolor-icon-theme
33 Requires:       xdg-utils >= 1.0.2-4
34 Suggests:       browser-plugin-adobe-flash
35 Suggests:       browser-plugin-chrome-pdf
36 Provides:       wwwbrowser
37 # add conflicts to trigger their update when main package is updated
38 Conflicts:      browser-plugin-adobe-flash < %{flashv}-%{!?rel:1}%{?rel:%{rel}}
39 Conflicts:      browser-plugin-chrome-pdf < %{version}-%{release}
40 ExclusiveArch:  %{ix86} %{x8664}
41 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43 %{expand:%%define       crver %{version}}
44
45 %define         find_lang       sh find-lang.sh %{buildroot}
46
47 %define         _enable_debug_packages  0
48 %define         no_install_post_strip   1
49
50 %define         ffmpeg_caps     libffmpegsumo.so
51 %define         flash_caps      libpepflashplayer.so
52 %define         chrome_caps     libpdf.so
53
54 # list of script capabilities (regexps) not to be used in Provides
55 %define         _noautoprov             %{ffmpeg_caps} %{flash_caps} %{chrome_caps}
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
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
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
85 %package -n browser-plugin-chrome-pdf
86 Summary:        Chrome PDF Viewer
87 Summary(pl.UTF-8):      Wtyczka PDF z Google Chrome
88 Group:          X11/Applications/Graphics
89 Requires:       browser-plugins >= 2.0
90 Conflicts:      google-chrome < 19.0.1084.52
91
92 %description -n browser-plugin-chrome-pdf
93 Google Chrome PDF Viewer.
94
95 %description -n browser-plugin-chrome-pdf -l pl.UTF-8
96 Wtyczka PDF z Google Chrome.
97
98 # IMPORTANT: keep flash plugin defined as last package
99 %package -n browser-plugin-adobe-flash
100 Summary:        Adobe Flash plugin from Google Chrome
101 Summary(pl.UTF-8):      Wtyczka Adobe Flash z Google Chrome
102 Version:        %{flashv}
103 Release:        %{!?rel:1}%{?rel:%{rel}}
104 License:        Free to use, non-distributable
105 Group:          X11/Applications/Multimedia
106 Requires:       browser-plugins >= 2.0
107 Conflicts:      google-chrome < 19.0.1084.52
108
109 %description -n browser-plugin-adobe-flash
110 Adobe Flash plugin from Google Chrome, which is not available in
111 Chromium.
112
113 %description -n browser-plugin-adobe-flash -l pl.UTF-8
114 Wtyczka Adobe Flash z Google Chrome, która nie jest dostępna w
115 Chromium.
116
117 %prep
118 %setup -qcT
119 %ifarch %{ix86}
120 SOURCE=%{S:0}
121 %endif
122 %ifarch %{x8664}
123 SOURCE=%{S:1}
124 %endif
125
126 V=$(rpm -qp --nodigest --nosignature --qf '%{V}' $SOURCE)
127 R=$(rpm -qp --nodigest --nosignature --qf '%{R}' $SOURCE)
128 if [ version:$V != version:%{crver} -o svnrev:$R != svnrev:%{svnrev} ]; then
129         exit 1
130 fi
131 rpm2cpio $SOURCE | cpio -i -d
132
133 mv opt/google/chrome%{?gcsuffix} .
134 mv usr/share/man/man1/* .
135 mv usr/share/gnome-control-center/default-apps .
136 mv chrome%{?gcsuffix}/default-app-block .
137 mv chrome%{?gcsuffix}/product_logo_*.{png,xpm} .
138 mv usr/share/applications/google-chrome%{?gcsuffix}.desktop .
139 mv chrome%{?gcsuffix}/google-chrome* .
140 chmod a+x chrome%{?gcsuffix}/lib*.so*
141
142 # separate to subpackage
143 install -d browser-plugins
144 mv chrome%{?gcsuffix}/libpdf.so browser-plugins
145 mv chrome%{?gcsuffix}/PepperFlash browser-plugins
146 chmod a+rx browser-plugins/PepperFlash/*.so
147
148 # included in gnome-control-center-2.28.1-3
149 rm default-app-block default-apps/google-chrome%{?gcsuffix}.xml
150
151 # xdg-utils snapshot required
152 rm chrome%{?gcsuffix}/xdg-settings
153 rm chrome%{?gcsuffix}/xdg-mime
154
155 [ -f *.1.gz ] && gzip -d *.1.gz
156
157 %{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE4} > find-lang.sh
158 %{__sed} -i 's;/opt/google/chrome/product_logo_48.png;%{name}.png;' google-chrome%{?gcsuffix}.desktop
159 %{__sed} -i 's;/opt/google/chrome;%{_bindir};' google-chrome%{?gcsuffix}.desktop
160 %{__sed} -i 's;xhtml_xml;xhtml+xml;' google-chrome%{?gcsuffix}.desktop
161 %{__sed} -i 's#google-chrome-\(stable\|beta\|unstable\)#google-chrome#g' google-chrome%{?gcsuffix}.desktop
162
163 %build
164 v=$(awk -F'"' '/version/{print $4}' browser-plugins/PepperFlash/manifest.json)
165 if [ "$v" != "%{flashv}" ]; then
166         : wrong version
167         exit 1
168 fi
169
170 # create extra file, for simplier scripting in chromium-browser.sh
171 echo "version=%{flashv}" > browser-plugins/PepperFlash/manifest.ver
172
173 %install
174 rm -rf $RPM_BUILD_ROOT
175 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/{plugins,pepper},%{_mandir}/man1,%{_desktopdir},%{_libdir}/%{name}/themes} \
176         $RPM_BUILD_ROOT%{_datadir}/%{name}/extensions
177
178 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
179 %{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
180 cp -a chrome%{?gcsuffix}/* $RPM_BUILD_ROOT%{_libdir}/%{name}
181 cp -p google-chrome%{?gcsuffix}.1 $RPM_BUILD_ROOT%{_mandir}/man1/google-chrome.1
182 # for google-chrome --help
183 echo ".so google-chrome.1" > $RPM_BUILD_ROOT%{_mandir}/man1/chrome.1
184 cp -p google-chrome%{?gcsuffix}.desktop $RPM_BUILD_ROOT%{_desktopdir}/google-chrome.desktop
185
186 for icon in product_logo_*.png; do
187         size=${icon##product_logo_}
188         size=${size%.png}
189
190         install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${size}x${size}/apps
191         cp -p $icon $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${size}x${size}/apps/%{name}.png
192 done
193
194 install -d $RPM_BUILD_ROOT%{_browserpluginsdir}
195 cp -a browser-plugins/* $RPM_BUILD_ROOT%{_browserpluginsdir}
196
197 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins
198
199 # binary needs to be at that specific location, or it will abort:
200 # [1070:1070:3265429789299:FATAL:zygote_host_linux.cc(130)] The SUID sandbox helper binary is missing: /opt/google/chrome/chrome-sandbox Aborting now.
201 # Aborted
202 install -d $RPM_BUILD_ROOT/opt/google
203 # see if CHROME_DEVEL_SANDBOX env var helps
204 # content/browser/browser_main_loop.cc
205 ln -s %{_libdir}/%{name} $RPM_BUILD_ROOT/opt/google/chrome%{?gcsuffix}
206
207 # official rpm just add libudev.so.0 -> libudev.so.1 symlink, so we use similar hack here
208 if grep -qE "libudev\.so\.0" $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome; then
209         %{__sed} -i -e 's#libudev\.so\.0#libudev.so.1#g' $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome
210 else
211         echo "Hack no longer needed? No longer linked with libudev.so.0 ?" >&2
212         exit 1
213 fi
214
215 # find locales
216 %find_lang %{name}.lang
217 # always package en-US (in main package)
218 %{__sed} -i -e '/en-US.pak/d' %{name}.lang
219
220 %clean
221 rm -rf $RPM_BUILD_ROOT
222
223 %post
224 %update_icon_cache hicolor
225 %update_browser_plugins
226
227 %postun
228 if [ "$1" = 0 ]; then
229         %update_icon_cache hicolor
230         %update_browser_plugins
231 fi
232
233 %post -n browser-plugin-adobe-flash
234 %update_browser_plugins
235
236 %postun -n browser-plugin-adobe-flash
237 if [ "$1" = 0 ]; then
238         %update_browser_plugins
239 fi
240
241 %post -n browser-plugin-chrome-pdf
242 %update_browser_plugins
243
244 %postun -n browser-plugin-chrome-pdf
245 if [ "$1" = 0 ]; then
246         %update_browser_plugins
247 fi
248
249 # FIXME: chrome *needs* it to be in application dir. add symlink until it can load from other places
250 # FIXME: link PepperFlash, browser-plugins ignores subdirs, and currently nothing else than chrome browsers can do pepper
251 %triggerin -n browser-plugin-adobe-flash -- google-chrome
252 test -L %{_libdir}/%{name}/PepperFlash || ln -sf %{_browserpluginsdir}/PepperFlash %{_libdir}/%{name}/PepperFlash
253
254 %triggerun -n browser-plugin-adobe-flash -- google-chrome
255 if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L %{_libdir}/%{name}/PepperFlash ]; then
256         rm -f %{_libdir}/%{name}/PepperFlash
257 fi
258
259 %triggerin -n browser-plugin-chrome-pdf -- google-chrome
260 test -L %{_libdir}/%{name}/libpdf.so || ln -sf plugins/libpdf.so %{_libdir}/%{name}/libpdf.so
261
262 %triggerun -n browser-plugin-chrome-pdf -- google-chrome
263 if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L %{_libdir}/%{name}/libpdf.so ]; then
264         rm -f %{_libdir}/%{name}/libpdf.so
265 fi
266
267 %triggerin -n browser-plugin-adobe-flash -- chromium-browser-bin
268 test -L %{_libdir}/chromium-browser-bin/PepperFlash || ln -sf %{_browserpluginsdir}/PepperFlash %{_libdir}/chromium-browser-bin/PepperFlash
269
270 %triggerun -n browser-plugin-adobe-flash -- chromium-browser-bin
271 if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L %{_libdir}/chromium-browser-bin/PepperFlash ]; then
272         rm -f %{_libdir}/chromium-browser-bin/PepperFlash
273 fi
274
275 %triggerin -n browser-plugin-chrome-pdf -- chromium-browser-bin
276 test -L %{_libdir}/chromium-browser-bin/libpdf.so || ln -sf plugins/libpdf.so %{_libdir}/chromium-browser-bin/libpdf.so
277
278 %triggerun -n browser-plugin-chrome-pdf -- chromium-browser-bin
279 if [ "$1" = "0" ] || [ "$2" = "0" ] && [-L %{_libdir}/chromium-browser-bin/libpdf.so ]; then
280         rm -f %{_libdir}/chromium-browser-bin/libpdf.so
281 fi
282
283 %files
284 %defattr(644,root,root,755)
285
286 %{_browserpluginsconfdir}/browsers.d/%{name}.*
287 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
288
289 %attr(755,root,root) %{_bindir}/%{name}
290 %{_mandir}/man1/*.1*
291 %{_desktopdir}/*.desktop
292 %{_iconsdir}/hicolor/*/apps/%{name}.png
293
294 %dir %{_libdir}/%{name}
295 %dir %{_libdir}/%{name}/lib
296 %{_libdir}/%{name}/icudtl.dat
297 %{_libdir}/%{name}/chrome_100_percent.pak
298 %{_libdir}/%{name}/resources.pak
299 %dir %{_libdir}/%{name}/locales
300 %{_libdir}/%{name}/locales/en-US.pak
301 %dir %{_libdir}/%{name}/plugins
302 # hardcoded list of pepper plugins chrome can load
303 # see https://chromium.googlesource.com/chromium/chromium/+/trunk/chrome/common/chrome_paths.cc
304 %dir %{_libdir}/%{name}/pepper
305 %dir %{_datadir}/%{name}
306 # The path to the external extension <id>.json files.
307 # see https://chromium.googlesource.com/chromium/chromium/+/trunk/chrome/common/chrome_paths.cc
308 %dir %{_datadir}/%{name}/extensions
309 %{_libdir}/%{name}/default_apps
310 %{_libdir}/%{name}/themes
311 %attr(755,root,root) %{_libdir}/%{name}/chrome
312 %attr(755,root,root) %{_libdir}/%{name}/lib/libpeerconnection.so
313 # These unique permissions are intentional and necessary for the sandboxing
314 %attr(4555,root,root) %{_libdir}/%{name}/chrome-sandbox
315
316 # nacl
317 %attr(755,root,root) %{_libdir}/%{name}/nacl_helper
318 %attr(755,root,root) %{_libdir}/%{name}/nacl_helper_bootstrap
319 %attr(755,root,root) %{_libdir}/%{name}/nacl_irt_x86_*.nexe
320
321 # DRM
322 %attr(755,root,root) %{_libdir}/%{name}/libwidevinecdm.so
323 %attr(755,root,root) %{_libdir}/%{name}/libwidevinecdmadapter.so
324
325 # ffmpeg libs
326 %attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so
327
328 # hack
329 %dir /opt/google
330 /opt/google/chrome%{?gcsuffix}
331
332 %files l10n -f %{name}.lang
333 %defattr(644,root,root,755)
334
335 %files -n browser-plugin-chrome-pdf
336 %defattr(644,root,root,755)
337 %attr(755,root,root) %{_browserpluginsdir}/libpdf.so
338
339 %files -n browser-plugin-adobe-flash
340 %defattr(644,root,root,755)
341 %dir %{_browserpluginsdir}/PepperFlash
342 %{_browserpluginsdir}/PepperFlash/manifest.json
343 %{_browserpluginsdir}/PepperFlash/manifest.ver
344 %attr(755,root,root) %{_browserpluginsdir}/PepperFlash/libpepflashplayer.so
This page took 0.03809 seconds and 2 git commands to generate.