]> git.pld-linux.org Git - packages/google-chrome.git/blob - google-chrome.spec
- extra packages for pdf and flash plugins to be reused with chromium-browser package
[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  138391
5 %define         state   stable
6 Summary:        Google Chrome
7 Name:           google-chrome
8 Version:        19.0.1084.52
9 Release:        %{svnrev}
10 License:        Multiple, see http://chrome.google.com/
11 Group:          Applications/Networking
12 Source0:        http://dl.google.com/linux/chrome/rpm/stable/i386/%{name}-%{state}-%{version}-%{svnrev}.i386.rpm
13 # Source0-md5:  113c4fe26c9ffda69b695d3e4c7a638f
14 Source1:        http://dl.google.com/linux/chrome/rpm/stable/x86_64/%{name}-%{state}-%{version}-%{svnrev}.x86_64.rpm
15 # Source1-md5:  c6e08d3019a42499f999e8f18a2e8ea4
16 Source2:        %{name}.sh
17 Source4:        find-lang.sh
18 Patch0:         chrome-desktop.patch
19 URL:            http://chrome.google.com/
20 BuildRequires:  rpm-utils
21 BuildRequires:  rpmbuild(macros) >= 1.453
22 BuildRequires:  sed >= 4.0
23 Requires:       browser-plugins >= 2.0
24 Requires:       hicolor-icon-theme
25 Requires:       xdg-utils >= 1.0.2-4
26 Provides:       wwwbrowser
27 %ifarch %{ix86}
28 Suggests:       browser-plugin-adobe-flash
29 %endif
30 Suggests:       browser-plugin-chrome-pdf
31 ExclusiveArch:  %{ix86} %{x8664}
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %define         find_lang       sh find-lang.sh %{buildroot}
35
36 %define         _enable_debug_packages  0
37 %define         no_install_post_strip   1
38
39 %define         ffmpeg_caps     libffmpegsumo.so
40 %define         jpeg_caps       libpng12.so.0(PNG12_0)
41 %define         flash_caps      libflashplayer.so
42 %define         chrome_caps     libpdf.so libppGoogleNaClPluginChrome.so
43
44 # list of script capabilities (regexps) not to be used in Provides
45 %define         _noautoprov             %{ffmpeg_caps} %{jpeg_caps} %{flash_caps} %{chrome_caps}
46 # do not require them either
47 %define         _noautoreq              %{_noautoprov}
48
49 %description
50 The web browser from Google
51
52 Google Chrome is a browser that combines a minimal design with
53 sophisticated technology to make the web faster, safer, and easier.
54
55 %description -l hu.UTF-8
56 Webböngésző a Google-től.
57
58 Google Chrome egy böngésző, amely a minimalista külsőt házasítja össze
59 a kifinomult technológiával, hogy a webböngészés gyorsabb,
60 biztonságosabb és könnyebb legyen.
61
62 %package -n browser-plugin-adobe-flash
63 Summary:        Adobe Flash plugin from Google Chrome
64 Summary(pl.UTF-8):      Wtyczka Adobe Flash z Google Chrome
65 Group:          X11/Applications/Multimedia
66 Requires:       browser-plugins >= 2.0
67
68 %description -n browser-plugin-adobe-flash
69 Adobe Flash plugin from Google Chrome, which is not available in
70 Chromium.
71
72 %description -n browser-plugin-adobe-flash -l pl.UTF-8
73 Wtyczka Adobe Flash z Google Chrome, która nie jest dostępna w
74 Chromium.
75
76 %package -n browser-plugin-chrome-pdf
77 Summary:        Chrome PDF Viewer
78 Summary(pl.UTF-8):      Wtyczka PDF z Google Chrome
79 Group:          X11/Applications/Graphics
80 Requires:       browser-plugins >= 2.0
81
82 %description -n browser-plugin-chrome-pdf
83 Google Chrome PDF Viewer.
84
85 %description -n browser-plugin-chrome-pdf -l pl.UTF-8
86 Wtyczka PDF z Google Chrome.
87
88 %prep
89 %setup -qcT
90 %ifarch %{ix86}
91 SOURCE=%{S:0}
92 %endif
93 %ifarch %{x8664}
94 SOURCE=%{S:1}
95 %endif
96
97 V=$(rpm -qp --nodigest --nosignature --qf '%{V}' $SOURCE)
98 R=$(rpm -qp --nodigest --nosignature --qf '%{R}' $SOURCE)
99 if [ version:$V != version:%{version} -o svnrev:$R != svnrev:%{svnrev} ]; then
100         exit 1
101 fi
102 rpm2cpio $SOURCE | cpio -i -d
103
104 mv opt/google/chrome .
105 mv usr/share/man/man1/* .
106 mv usr/share/gnome-control-center/default-apps .
107 mv chrome/default-app-block .
108 mv chrome/product_logo_*.{png,xpm} .
109 mv chrome/google-chrome.desktop .
110 mv chrome/google-chrome .
111 chmod a+x chrome/lib*.so*
112
113 # separate to subpackage
114 install -d browser-plugins
115 mv chrome/libpdf.so browser-plugins
116 %ifarch %{ix86}
117 mv chrome/libgcflashplayer.so browser-plugins
118 %endif
119
120 # included in gnome-control-center-2.28.1-3
121 rm default-app-block default-apps/google-chrome.xml
122
123 # xdg-utils snapshot required
124 rm chrome/xdg-settings
125 rm chrome/xdg-mime
126
127 [ -f *.1.gz ] && gzip -d *.1.gz
128
129 %patch0 -p1
130
131 %{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE4} > find-lang.sh
132 %{__sed} -i 's;/opt/google/chrome/product_logo_48.png;%{name}.png;' google-chrome.desktop
133 %{__sed} -i 's;/opt/google/chrome;%{_bindir};' google-chrome.desktop
134
135 %install
136 rm -rf $RPM_BUILD_ROOT
137 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/plugins,%{_mandir}/man1,%{_desktopdir},%{_libdir}/%{name}/themes}
138
139 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
140 %{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
141 cp -a chrome/* $RPM_BUILD_ROOT%{_libdir}/%{name}
142 cp -p google-chrome.1 $RPM_BUILD_ROOT%{_mandir}/man1
143 # for google-chrome --help
144 echo ".so google-chrome.1" > $RPM_BUILD_ROOT%{_mandir}/man1/chrome.1
145 cp -p google-chrome.desktop $RPM_BUILD_ROOT%{_desktopdir}
146
147 for icon in product_logo_*.png; do
148         size=${icon##product_logo_}
149         size=${size%.png}
150
151         install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${size}x${size}/apps
152         cp -p $icon $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${size}x${size}/apps/%{name}.png
153 done
154
155 install -d $RPM_BUILD_ROOT%{_browserpluginsdir}
156 install -p browser-plugins/*.so $RPM_BUILD_ROOT%{_browserpluginsdir}
157
158 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins
159
160 # binary needs to be at that specific location, or it will abort:
161 # [1070:1070:3265429789299:FATAL:zygote_host_linux.cc(130)] The SUID sandbox helper binary is missing: /opt/google/chrome/chrome-sandbox Aborting now.
162 # Aborted
163 install -d $RPM_BUILD_ROOT/opt/google
164 ln -s %{_libdir}/%{name} $RPM_BUILD_ROOT/opt/google/chrome
165
166 # find locales
167 %find_lang %{name}.lang
168
169 %clean
170 rm -rf $RPM_BUILD_ROOT
171
172 %post
173 %update_icon_cache hicolor
174 %update_browser_plugins
175
176 %postun
177 if [ "$1" = 0 ]; then
178         %update_icon_cache hicolor
179         %update_browser_plugins
180 fi
181
182 %post -n browser-plugin-adobe-flash
183 %update_browser_plugins
184
185 %postun -n browser-plugin-adobe-flash
186 if [ "$1" = 0 ]; then
187         %update_browser_plugins
188 fi
189
190 %post -n browser-plugin-chrome-pdf
191 %update_browser_plugins
192
193 %postun -n browser-plugin-chrome-pdf
194 if [ "$1" = 0 ]; then
195         %update_browser_plugins
196 fi
197
198 # FIXME: chrome *needs* it to be in application dir. add symlink until it can load from other places
199 # for chromium, we could likely patch source
200 %triggerin -n browser-plugin-chrome-pdf -- google-chrome
201 test -L %{_libdir}/google-chrome/libpdf.so || ln -s plugins/libpdf.so %{_libdir}/google-chrome/libpdf.so
202
203 %triggerun -n browser-plugin-chrome-pdf -- google-chrome
204 rm -f %{_libdir}/google-chrome/libpdf.so
205
206 %triggerin -n browser-plugin-chrome-pdf -- chromium-browser
207 test -L %{_libdir}/chromium-browser/libpdf.so || ln -s plugins/libpdf.so %{_libdir}/chromium-browser/libpdf.so
208
209 %triggerun -n browser-plugin-chrome-pdf -- chromium-browser
210 rm -f %{_libdir}/chromium-browser/libpdf.so
211
212 %triggerin -n browser-plugin-chrome-pdf -- chromium-browser-bin
213 test -L %{_libdir}/chromium-browser-bin/libpdf.so || ln -s plugins/libpdf.so %{_libdir}/chromium-browser-bin/libpdf.so
214
215 %triggerun -n browser-plugin-chrome-pdf -- chromium-browser-bin
216 rm -f %{_libdir}/chromium-browser-bin/libpdf.so
217
218 %files -f %{name}.lang
219 %defattr(644,root,root,755)
220
221 %{_browserpluginsconfdir}/browsers.d/%{name}.*
222 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
223
224 %attr(755,root,root) %{_bindir}/%{name}
225 %{_mandir}/man1/*.1*
226 %{_desktopdir}/*.desktop
227 %{_iconsdir}/hicolor/*/apps/%{name}.png
228
229 %dir %{_libdir}/%{name}
230 %{_libdir}/%{name}/chrome.pak
231 %{_libdir}/%{name}/resources.pak
232 %dir %{_libdir}/%{name}/locales
233 %dir %{_libdir}/%{name}/plugins
234 %{_libdir}/%{name}/default_apps
235 %{_libdir}/%{name}/themes
236 %attr(755,root,root) %{_libdir}/%{name}/chrome
237 # These unique permissions are intentional and necessary for the sandboxing
238 %attr(4555,root,root) %{_libdir}/%{name}/chrome-sandbox
239
240 # Native Client plugin, to use launch with --enable-nacl
241 %attr(755,root,root) %{_libdir}/%{name}/libppGoogleNaClPluginChrome.so
242
243 # nacl
244 %attr(755,root,root) %{_libdir}/%{name}/nacl_helper
245 %attr(755,root,root) %{_libdir}/%{name}/nacl_helper_bootstrap
246 %attr(755,root,root) %{_libdir}/%{name}/nacl_irt_x86_*.nexe
247
248 # ffmpeg libs
249 %attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so
250
251 # hack
252 %dir /opt/google
253 /opt/google/chrome
254
255 %files -n browser-plugin-chrome-pdf
256 %defattr(644,root,root,755)
257 %attr(755,root,root) %{_browserpluginsdir}/libpdf.so
258
259 %ifarch %{ix86}
260 %files -n browser-plugin-adobe-flash
261 %defattr(644,root,root,755)
262 %{_libdir}/%{name}/plugin.vch
263 %attr(755,root,root) %{_browserpluginsdir}/libgcflashplayer.so
264 %endif
This page took 0.225431 seconds and 4 git commands to generate.