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