]> git.pld-linux.org Git - packages/google-chrome.git/blob - google-chrome.spec
25a0a3d7a2e3efad4bb3df8f98ec3c0debcb93e1
[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.5.31.2
5 %define         svnrev  167501
6 #define         rel             %{nil}
7 %define         state   stable
8 Summary:        Google Chrome
9 Name:           google-chrome
10 Version:        23.0.1271.91
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:        b31a58e24d186b57ec20dea8695bb1aa
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:        7163e709722bde92cfde3d638a1727e7
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 Requires:       hicolor-icon-theme
29 Requires:       xdg-utils >= 1.0.2-4
30 Suggests:       browser-plugin-adobe-flash
31 Suggests:       browser-plugin-chrome-pdf
32 Provides:       wwwbrowser
33 # add conflicts to trigger their update when main package is updated
34 Conflicts:      browser-plugin-adobe-flash < %{flashv}-%{!?rel:1}%{?rel:%{rel}}
35 Conflicts:      browser-plugin-chrome-pdf < %{version}-%{release}
36 ExclusiveArch:  %{ix86} %{x8664}
37 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
39 %{expand:%%define       crver %{version}}
40
41 %define         find_lang       sh find-lang.sh %{buildroot}
42
43 %define         _enable_debug_packages  0
44 %define         no_install_post_strip   1
45
46 %define         ffmpeg_caps     libffmpegsumo.so
47 %define         flash_caps      libpepflashplayer.so
48 %define         chrome_caps     libpdf.so libppGoogleNaClPluginChrome.so
49
50 # list of script capabilities (regexps) not to be used in Provides
51 %define         _noautoprov             %{ffmpeg_caps} %{flash_caps} %{chrome_caps}
52 # do not require them either
53 %define         _noautoreq              %{_noautoprov}
54
55 %description
56 The web browser from Google
57
58 Google Chrome is a browser that combines a minimal design with
59 sophisticated technology to make the web faster, safer, and easier.
60
61 %description -l hu.UTF-8
62 Webböngésző a Google-től.
63
64 Google Chrome egy böngésző, amely a minimalista külsőt házasítja össze
65 a kifinomult technológiával, hogy a webböngészés gyorsabb,
66 biztonságosabb és könnyebb legyen.
67
68 %package l10n
69 Summary:        google chrome language packages
70 Group:          I18n
71 Requires:       %{name} = %{version}-%{release}
72
73 %description l10n
74 This package contains language packages for 50 languages:
75
76 ar, bg, bn, ca, cs, da, de, el, en-GB, es-LA, es, et, fi, fil, fr, gu,
77 he, hi, hr, hu, id, it, ja, kn, ko, lt, lv, ml, mr, nb, nl, or, pl,
78 pt-BR, pt-PT, ro, ru, sk, sl, sr, sv, ta, te, th, tr, uk, vi, zh-CN,
79 zh-TW
80
81 %package -n browser-plugin-chrome-pdf
82 Summary:        Chrome PDF Viewer
83 Summary(pl.UTF-8):      Wtyczka PDF z Google Chrome
84 Group:          X11/Applications/Graphics
85 Requires:       browser-plugins >= 2.0
86 Conflicts:      google-chrome < 19.0.1084.52
87
88 %description -n browser-plugin-chrome-pdf
89 Google Chrome PDF Viewer.
90
91 %description -n browser-plugin-chrome-pdf -l pl.UTF-8
92 Wtyczka PDF z Google Chrome.
93
94 # IMPORTANT: keep flash plugin defined as last package
95 %package -n browser-plugin-adobe-flash
96 Summary:        Adobe Flash plugin from Google Chrome
97 Summary(pl.UTF-8):      Wtyczka Adobe Flash z Google Chrome
98 Version:        %{flashv}
99 Release:        %{!?rel:1}%{?rel:%{rel}}
100 License:        Free to use, non-distributable
101 Group:          X11/Applications/Multimedia
102 Requires:       browser-plugins >= 2.0
103 Conflicts:      google-chrome < 19.0.1084.52
104
105 %description -n browser-plugin-adobe-flash
106 Adobe Flash plugin from Google Chrome, which is not available in
107 Chromium.
108
109 %description -n browser-plugin-adobe-flash -l pl.UTF-8
110 Wtyczka Adobe Flash z Google Chrome, która nie jest dostępna w
111 Chromium.
112
113 %prep
114 %setup -qcT
115 %ifarch %{ix86}
116 SOURCE=%{S:0}
117 %endif
118 %ifarch %{x8664}
119 SOURCE=%{S:1}
120 %endif
121
122 V=$(rpm -qp --nodigest --nosignature --qf '%{V}' $SOURCE)
123 R=$(rpm -qp --nodigest --nosignature --qf '%{R}' $SOURCE)
124 if [ version:$V != version:%{crver} -o svnrev:$R != svnrev:%{svnrev} ]; then
125         exit 1
126 fi
127 rpm2cpio $SOURCE | cpio -i -d
128
129 mv opt/google/chrome .
130 mv usr/share/man/man1/* .
131 mv usr/share/gnome-control-center/default-apps .
132 mv chrome/default-app-block .
133 mv chrome/product_logo_*.{png,xpm} .
134 mv chrome/google-chrome.desktop .
135 mv chrome/google-chrome .
136 chmod a+x chrome/lib*.so*
137
138 # separate to subpackage
139 install -d browser-plugins
140 mv chrome/libpdf.so browser-plugins
141 mv chrome/PepperFlash browser-plugins
142 chmod a+rx browser-plugins/PepperFlash/*.so
143
144 # included in gnome-control-center-2.28.1-3
145 rm default-app-block default-apps/google-chrome.xml
146
147 # xdg-utils snapshot required
148 rm chrome/xdg-settings
149 rm chrome/xdg-mime
150
151 [ -f *.1.gz ] && gzip -d *.1.gz
152
153 %patch0 -p1
154
155 %{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE4} > find-lang.sh
156 %{__sed} -i 's;/opt/google/chrome/product_logo_48.png;%{name}.png;' google-chrome.desktop
157 %{__sed} -i 's;/opt/google/chrome;%{_bindir};' google-chrome.desktop
158
159 %build
160 v=$(awk -F'"' '/version/{print $4}' browser-plugins/PepperFlash/manifest.json)
161 if [ "$v" != "%{flashv}" ]; then
162         : wrong version
163         exit 1
164 fi
165
166 # create extra file, for simplier scripting in chromium-browser.sh
167 echo "version=%{flashv}" > browser-plugins/PepperFlash/manifest.ver
168
169 %install
170 rm -rf $RPM_BUILD_ROOT
171 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/plugins,%{_mandir}/man1,%{_desktopdir},%{_libdir}/%{name}/themes}
172
173 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
174 %{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
175 cp -a chrome/* $RPM_BUILD_ROOT%{_libdir}/%{name}
176 cp -p google-chrome.1 $RPM_BUILD_ROOT%{_mandir}/man1
177 # for google-chrome --help
178 echo ".so google-chrome.1" > $RPM_BUILD_ROOT%{_mandir}/man1/chrome.1
179 cp -p google-chrome.desktop $RPM_BUILD_ROOT%{_desktopdir}
180
181 for icon in product_logo_*.png; do
182         size=${icon##product_logo_}
183         size=${size%.png}
184
185         install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${size}x${size}/apps
186         cp -p $icon $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${size}x${size}/apps/%{name}.png
187 done
188
189 install -d $RPM_BUILD_ROOT%{_browserpluginsdir}
190 cp -a browser-plugins/* $RPM_BUILD_ROOT%{_browserpluginsdir}
191
192 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins
193
194 # binary needs to be at that specific location, or it will abort:
195 # [1070:1070:3265429789299:FATAL:zygote_host_linux.cc(130)] The SUID sandbox helper binary is missing: /opt/google/chrome/chrome-sandbox Aborting now.
196 # Aborted
197 install -d $RPM_BUILD_ROOT/opt/google
198 ln -s %{_libdir}/%{name} $RPM_BUILD_ROOT/opt/google/chrome
199
200 # find locales
201 %find_lang %{name}.lang
202 # always package en-US (in main package)
203 %{__sed} -i -e '/en-US.pak/d' %{name}.lang
204
205 %clean
206 rm -rf $RPM_BUILD_ROOT
207
208 %post
209 %update_icon_cache hicolor
210 %update_browser_plugins
211
212 %postun
213 if [ "$1" = 0 ]; then
214         %update_icon_cache hicolor
215         %update_browser_plugins
216 fi
217
218 %post -n browser-plugin-adobe-flash
219 %update_browser_plugins
220
221 %postun -n browser-plugin-adobe-flash
222 if [ "$1" = 0 ]; then
223         %update_browser_plugins
224 fi
225
226 %post -n browser-plugin-chrome-pdf
227 %update_browser_plugins
228
229 %postun -n browser-plugin-chrome-pdf
230 if [ "$1" = 0 ]; then
231         %update_browser_plugins
232 fi
233
234 # FIXME: chrome *needs* it to be in application dir. add symlink until it can load from other places
235 # FIXME: link PepperFlash, browser-plugins ignores subdirs, and currently nothing else than chrome browsers can do pepper
236 %triggerin -n browser-plugin-adobe-flash -- google-chrome
237 test -L %{_libdir}/google-chrome/PepperFlash || ln -sf %{_browserpluginsdir}/PepperFlash %{_libdir}/google-chrome/PepperFlash
238
239 %triggerun -n browser-plugin-adobe-flash -- google-chrome
240 if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L %{_libdir}/google-chrome/PepperFlash ]; then
241         rm -f %{_libdir}/google-chrome/PepperFlash
242 fi
243
244 %triggerin -n browser-plugin-chrome-pdf -- google-chrome
245 test -L %{_libdir}/google-chrome/libpdf.so || ln -sf plugins/libpdf.so %{_libdir}/google-chrome/libpdf.so
246
247 %triggerun -n browser-plugin-chrome-pdf -- google-chrome
248 if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L %{_libdir}/google-chrome/libpdf.so ]; then
249         rm -f %{_libdir}/google-chrome/libpdf.so
250 fi
251
252 %triggerin -n browser-plugin-adobe-flash -- chromium-browser-bin
253 test -L %{_libdir}/chromium-browser-bin/PepperFlash || ln -sf %{_browserpluginsdir}/PepperFlash %{_libdir}/chromium-browser-bin/PepperFlash
254
255 %triggerun -n browser-plugin-adobe-flash -- chromium-browser-bin
256 if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L %{_libdir}/chromium-browser-bin/PepperFlash ]; then
257         rm -f %{_libdir}/chromium-browser-bin/PepperFlash
258 fi
259
260 %triggerin -n browser-plugin-chrome-pdf -- chromium-browser-bin
261 test -L %{_libdir}/chromium-browser-bin/libpdf.so || ln -sf plugins/libpdf.so %{_libdir}/chromium-browser-bin/libpdf.so
262
263 %triggerun -n browser-plugin-chrome-pdf -- chromium-browser-bin
264 if [ "$1" = "0" ] || [ "$2" = "0" ] && [-L %{_libdir}/chromium-browser-bin/libpdf.so ]; then
265         rm -f %{_libdir}/chromium-browser-bin/libpdf.so
266 fi
267
268 %files
269 %defattr(644,root,root,755)
270
271 %{_browserpluginsconfdir}/browsers.d/%{name}.*
272 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
273
274 %attr(755,root,root) %{_bindir}/%{name}
275 %{_mandir}/man1/*.1*
276 %{_desktopdir}/*.desktop
277 %{_iconsdir}/hicolor/*/apps/%{name}.png
278
279 %dir %{_libdir}/%{name}
280 %{_libdir}/%{name}/chrome.pak
281 %{_libdir}/%{name}/resources.pak
282 %{_libdir}/%{name}/chrome_100_percent.pak
283 %dir %{_libdir}/%{name}/locales
284 %{_libdir}/%{name}/locales/en-US.pak
285 %dir %{_libdir}/%{name}/plugins
286 %{_libdir}/%{name}/default_apps
287 %{_libdir}/%{name}/themes
288 %attr(755,root,root) %{_libdir}/%{name}/chrome
289 # These unique permissions are intentional and necessary for the sandboxing
290 %attr(4555,root,root) %{_libdir}/%{name}/chrome-sandbox
291
292 # Native Client plugin, to use launch with --enable-nacl
293 %attr(755,root,root) %{_libdir}/%{name}/libppGoogleNaClPluginChrome.so
294
295 # nacl
296 %attr(755,root,root) %{_libdir}/%{name}/nacl_helper
297 %attr(755,root,root) %{_libdir}/%{name}/nacl_helper_bootstrap
298 %attr(755,root,root) %{_libdir}/%{name}/nacl_irt_x86_*.nexe
299
300 # ffmpeg libs
301 %attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so
302
303 # hack
304 %dir /opt/google
305 /opt/google/chrome
306
307 %files l10n -f %{name}.lang
308 %defattr(644,root,root,755)
309
310 %files -n browser-plugin-chrome-pdf
311 %defattr(644,root,root,755)
312 %attr(755,root,root) %{_browserpluginsdir}/libpdf.so
313
314 %files -n browser-plugin-adobe-flash
315 %defattr(644,root,root,755)
316 %dir %{_browserpluginsdir}/PepperFlash
317 %{_browserpluginsdir}/PepperFlash/manifest.json
318 %{_browserpluginsdir}/PepperFlash/manifest.ver
319 %attr(755,root,root) %{_browserpluginsdir}/PepperFlash/libpepflashplayer.so
This page took 0.037498 seconds and 2 git commands to generate.