]> git.pld-linux.org Git - packages/google-chrome.git/blob - google-chrome.spec
3beae22709ddd5b2385a7a1e50bba608a454b839
[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         flashv  11.7.700.169
5 %define         svnrev  192696
6 #define         rel             %{nil}
7 %define         state   stable
8 Summary:        Google Chrome
9 Name:           google-chrome
10 Version:        26.0.1410.63
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:        ee56afab6fc94940f3eeeff83a6fcabb
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:        fd9b9df6aaa2ee62e35abbf65999c0c7
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 chrome/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
161 %build
162 v=$(awk -F'"' '/version/{print $4}' browser-plugins/PepperFlash/manifest.json)
163 if [ "$v" != "%{flashv}" ]; then
164         : wrong version
165         exit 1
166 fi
167
168 # create extra file, for simplier scripting in chromium-browser.sh
169 echo "version=%{flashv}" > browser-plugins/PepperFlash/manifest.ver
170
171 %install
172 rm -rf $RPM_BUILD_ROOT
173 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/plugins,%{_mandir}/man1,%{_desktopdir},%{_libdir}/%{name}/themes}
174
175 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
176 %{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
177 cp -a chrome/* $RPM_BUILD_ROOT%{_libdir}/%{name}
178 cp -p google-chrome.1 $RPM_BUILD_ROOT%{_mandir}/man1
179 # for google-chrome --help
180 echo ".so google-chrome.1" > $RPM_BUILD_ROOT%{_mandir}/man1/chrome.1
181 cp -p google-chrome.desktop $RPM_BUILD_ROOT%{_desktopdir}
182
183 for icon in product_logo_*.png; do
184         size=${icon##product_logo_}
185         size=${size%.png}
186
187         install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${size}x${size}/apps
188         cp -p $icon $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${size}x${size}/apps/%{name}.png
189 done
190
191 install -d $RPM_BUILD_ROOT%{_browserpluginsdir}
192 cp -a browser-plugins/* $RPM_BUILD_ROOT%{_browserpluginsdir}
193
194 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins
195
196 # binary needs to be at that specific location, or it will abort:
197 # [1070:1070:3265429789299:FATAL:zygote_host_linux.cc(130)] The SUID sandbox helper binary is missing: /opt/google/chrome/chrome-sandbox Aborting now.
198 # Aborted
199 install -d $RPM_BUILD_ROOT/opt/google
200 # see if CHROME_DEVEL_SANDBOX env var helps
201 # content/browser/browser_main_loop.cc
202 ln -s %{_libdir}/%{name} $RPM_BUILD_ROOT/opt/google/chrome
203
204 # official rpm just add libudev.so.0 -> libudev.so.1 symlink, so we use similar hack here
205 if grep -qE "libudev\.so\.0" $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome; then
206         %{__sed} -i -e 's#libudev\.so\.0#libudev.so.1#g' $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome
207 else
208         echo "Hack no longer needed? No longer linked with libudev.so.0 ?" >&2
209         exit 1
210 fi
211
212 # find locales
213 %find_lang %{name}.lang
214 # always package en-US (in main package)
215 %{__sed} -i -e '/en-US.pak/d' %{name}.lang
216
217 %clean
218 rm -rf $RPM_BUILD_ROOT
219
220 %post
221 %update_icon_cache hicolor
222 %update_browser_plugins
223
224 %postun
225 if [ "$1" = 0 ]; then
226         %update_icon_cache hicolor
227         %update_browser_plugins
228 fi
229
230 %post -n browser-plugin-adobe-flash
231 %update_browser_plugins
232
233 %postun -n browser-plugin-adobe-flash
234 if [ "$1" = 0 ]; then
235         %update_browser_plugins
236 fi
237
238 %post -n browser-plugin-chrome-pdf
239 %update_browser_plugins
240
241 %postun -n browser-plugin-chrome-pdf
242 if [ "$1" = 0 ]; then
243         %update_browser_plugins
244 fi
245
246 # FIXME: chrome *needs* it to be in application dir. add symlink until it can load from other places
247 # FIXME: link PepperFlash, browser-plugins ignores subdirs, and currently nothing else than chrome browsers can do pepper
248 %triggerin -n browser-plugin-adobe-flash -- google-chrome
249 test -L %{_libdir}/%{name}/PepperFlash || ln -sf %{_browserpluginsdir}/PepperFlash %{_libdir}/%{name}/PepperFlash
250
251 %triggerun -n browser-plugin-adobe-flash -- google-chrome
252 if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L %{_libdir}/%{name}/PepperFlash ]; then
253         rm -f %{_libdir}/%{name}/PepperFlash
254 fi
255
256 %triggerin -n browser-plugin-chrome-pdf -- google-chrome
257 test -L %{_libdir}/%{name}/libpdf.so || ln -sf plugins/libpdf.so %{_libdir}/%{name}/libpdf.so
258
259 %triggerun -n browser-plugin-chrome-pdf -- google-chrome
260 if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L %{_libdir}/%{name}/libpdf.so ]; then
261         rm -f %{_libdir}/%{name}/libpdf.so
262 fi
263
264 %triggerin -n browser-plugin-adobe-flash -- chromium-browser-bin
265 test -L %{_libdir}/chromium-browser-bin/PepperFlash || ln -sf %{_browserpluginsdir}/PepperFlash %{_libdir}/chromium-browser-bin/PepperFlash
266
267 %triggerun -n browser-plugin-adobe-flash -- chromium-browser-bin
268 if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L %{_libdir}/chromium-browser-bin/PepperFlash ]; then
269         rm -f %{_libdir}/chromium-browser-bin/PepperFlash
270 fi
271
272 %triggerin -n browser-plugin-chrome-pdf -- chromium-browser-bin
273 test -L %{_libdir}/chromium-browser-bin/libpdf.so || ln -sf plugins/libpdf.so %{_libdir}/chromium-browser-bin/libpdf.so
274
275 %triggerun -n browser-plugin-chrome-pdf -- chromium-browser-bin
276 if [ "$1" = "0" ] || [ "$2" = "0" ] && [-L %{_libdir}/chromium-browser-bin/libpdf.so ]; then
277         rm -f %{_libdir}/chromium-browser-bin/libpdf.so
278 fi
279
280 %files
281 %defattr(644,root,root,755)
282
283 %{_browserpluginsconfdir}/browsers.d/%{name}.*
284 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
285
286 %attr(755,root,root) %{_bindir}/%{name}
287 %{_mandir}/man1/*.1*
288 %{_desktopdir}/*.desktop
289 %{_iconsdir}/hicolor/*/apps/%{name}.png
290
291 %dir %{_libdir}/%{name}
292 %{_libdir}/%{name}/chrome.pak
293 %{_libdir}/%{name}/resources.pak
294 %{_libdir}/%{name}/chrome_100_percent.pak
295 %dir %{_libdir}/%{name}/locales
296 %{_libdir}/%{name}/locales/en-US.pak
297 %dir %{_libdir}/%{name}/plugins
298 %{_libdir}/%{name}/default_apps
299 %{_libdir}/%{name}/themes
300 %attr(755,root,root) %{_libdir}/%{name}/chrome
301 # These unique permissions are intentional and necessary for the sandboxing
302 %attr(4555,root,root) %{_libdir}/%{name}/chrome-sandbox
303
304 # Native Client plugin, to use launch with --enable-nacl
305 %attr(755,root,root) %{_libdir}/%{name}/libppGoogleNaClPluginChrome.so
306
307 # nacl
308 %attr(755,root,root) %{_libdir}/%{name}/nacl_helper
309 %attr(755,root,root) %{_libdir}/%{name}/nacl_helper_bootstrap
310 %attr(755,root,root) %{_libdir}/%{name}/nacl_irt_x86_*.nexe
311
312 # DRM
313 %attr(755,root,root) %{_libdir}/%{name}/libwidevinecdm.so
314 %attr(755,root,root) %{_libdir}/%{name}/libwidevinecdmadapter.so
315
316 # ffmpeg libs
317 %attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so
318
319 # hack
320 %dir /opt/google
321 /opt/google/chrome
322
323 %files l10n -f %{name}.lang
324 %defattr(644,root,root,755)
325
326 %files -n browser-plugin-chrome-pdf
327 %defattr(644,root,root,755)
328 %attr(755,root,root) %{_browserpluginsdir}/libpdf.so
329
330 %files -n browser-plugin-adobe-flash
331 %defattr(644,root,root,755)
332 %dir %{_browserpluginsdir}/PepperFlash
333 %{_browserpluginsdir}/PepperFlash/manifest.json
334 %{_browserpluginsdir}/PepperFlash/manifest.ver
335 %attr(755,root,root) %{_browserpluginsdir}/PepperFlash/libpepflashplayer.so
This page took 0.415383 seconds and 2 git commands to generate.