3 %bcond_without debuginfo # disable debuginfo creation (it is huge)
4 %bcond_without ffmpegsumo # build with ffmpegsumo
5 %bcond_without kerberos # build with kerberos support (dlopened if support compiled, library names in src/net/http/http_auth_gssapi_posix.cc)
6 %bcond_without keyring # with keyring support (gnome-keyring dlopened, kwalletd via dbus)
7 %bcond_without cups # with cups
8 %bcond_without gconf # with GConf
9 %bcond_without pulseaudio # with pulseaudio
10 %bcond_without nacl # build Native Client support
11 %bcond_without sandboxing # with sandboxing
12 %bcond_with selinux # with SELinux (need policy first)
13 %bcond_with shared_libs # with shared libs
14 %bcond_with sse2 # use SSE2 instructions
15 %bcond_with tcmalloc # use tcmalloc
16 %bcond_with system_sqlite # with system sqlite
17 %bcond_without system_flac # with system flac
18 %bcond_without system_libwebp # with system libwebp
19 %bcond_without system_speex # with system speex
20 %bcond_with system_v8 # with system v8
21 %bcond_without system_vpx # with system vpx
22 %bcond_without system_yasm # with system yasm
23 %bcond_without system_zlib # with system zlib
24 %bcond_without libjpegturbo # use libjpeg-turbo features
25 %bcond_with verbose # verbose build (V=1)
28 # - check system sqlite linking problems
29 # - find system deps: find -name '*.gyp*' | xargs grep 'use_system.*=='
30 # - use_system_ssl (use_openssl: http://crbug.com/62803)
31 # - use_system_ffmpeg && build_ffmpegsumo
32 # - use_system_hunspell
33 # - use_system_stlport
34 # - other defaults: src/build/common.gypi
37 # - mute BEEP mixer if you do not want to hear horrible system bell when
38 # pressing home/end in url bar or more ^F search results on page.
40 # - build i686: -bc: 2.7G; -bb: ~1.0GB
41 # - build x86_64: ~1.9G
42 # - http://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites
43 # - to look for new tarball, use update-source.sh script
46 # To use chromium nightly builds for pld-th save to /etc/poldek/repos.d (as chromium-nightly.conf):
47 # http://carme.pld-linux.org/~glen/chromium-browser/th/i686/chromium-nightly.conf
49 # http://carme.pld-linux.org/~glen/chromium-browser/th/x86_64/chromium-nightly.conf
52 Summary: A WebKit powered web browser
53 Name: chromium-browser
56 License: BSD, LGPL v2+ (ffmpeg)
57 Group: X11/Applications/Networking
58 Source0: http://carme.pld-linux.org/~glen/chromium-browser/src/stable/%{name}-%{version}.tar.xz
59 # Source0-md5: 7df0323b8e38020647181825c4381f36
60 Source1: %{name}.default
62 Source3: %{name}.desktop
64 Source6: update-source.sh
65 Source7: clean-source.sh
66 Source8: get-source.sh
67 Patch0: system-libs.patch
68 Patch1: plugin-searchdirs.patch
69 Patch2: gyp-system-minizip.patch
70 Patch3: disable_dlog_and_dcheck_in_release_builds.patch
71 Patch4: path-libpdf.patch
72 Patch5: options-support.patch
73 Patch6: get-webkit_revision.patch
74 Patch7: dlopen_sonamed_gl.patch
75 Patch8: chromium_useragent.patch.in
76 Patch9: chromium-ppapi.patch
77 # https://bugs.gentoo.org/show_bug.cgi?id=393471
78 # libjpeg-turbo >= 1.1.90 supports that feature
79 Patch11: chromium-revert-jpeg-swizzle-r2.patch
80 Patch15: nacl-build-irt.patch
81 Patch16: nacl-linkingfix.patch
82 Patch17: bug-138243.patch
83 URL: http://www.chromium.org/Home
84 %{?with_gconf:BuildRequires: GConf2-devel}
85 BuildRequires: OpenGL-GLU-devel
86 BuildRequires: alsa-lib-devel
87 BuildRequires: atk-devel
89 BuildRequires: bzip2-devel
90 %{?with_nacl:BuildRequires: crossnacl-binutils >= 2.20.1}
91 %{?with_nacl:BuildRequires: crossnacl-gcc >= 4.4.3}
92 %{?with_nacl:BuildRequires: crossnacl-gcc-c++ >= 4.4.3}
93 %{?with_nacl:BuildRequires: crossnacl-newlib >= 1.18.0}
94 %{?with_cups:BuildRequires: cups-devel}
95 BuildRequires: dbus-glib-devel
96 BuildRequires: expat-devel
97 %{?with_system_flac:BuildRequires: flac-devel}
99 BuildRequires: fontconfig-devel
100 BuildRequires: glib2-devel
102 BuildRequires: gtk+2-devel
103 %{?with_kerberos:BuildRequires: heimdal-devel}
104 BuildRequires: hicolor-icon-theme
105 BuildRequires: libevent-devel
106 %{?with_keyring:BuildRequires: libgnome-keyring-devel}
107 BuildRequires: libicu-devel >= 4.6
108 %{!?with_libjpegturbo:BuildRequires: libjpeg-devel}
109 %{?with_libjpegturbo:BuildRequires: libjpeg-turbo-devel >= 1.2.0}
110 BuildRequires: libpng-devel
111 %{?with_selinux:BuildRequires: libselinux-devel}
112 BuildRequires: libstdc++-devel
113 %{?with_system_vpx:BuildRequires: libvpx-devel >= 0.9.5-2}
114 %{?with_system_libwebp:BuildRequires: libwebp-devel >= 0.1.99}
115 BuildRequires: libxml2-devel
116 BuildRequires: libxslt-devel
118 BuildRequires: minizip-devel
119 BuildRequires: nspr-devel
120 BuildRequires: nss-devel >= 1:3.12.3
121 BuildRequires: pam-devel
122 BuildRequires: pango-devel
123 BuildRequires: perl-modules
124 BuildRequires: pkgconfig
125 %{?with_pulseaudio:BuildRequires: pulseaudio-devel}
126 BuildRequires: python
127 #BuildRequires: python-gyp >= 1-%{gyp_rev}
128 BuildRequires: python-modules
129 BuildRequires: rpm >= 4.4.9-56
130 BuildRequires: rpmbuild(macros) >= 1.453
131 %{?with_system_speex:BuildRequires: speex-devel >= 1:1.2-rc1}
132 BuildRequires: sqlite3-devel >= 3.6.1
133 BuildRequires: subversion
134 BuildRequires: tar >= 1:1.22
135 BuildRequires: udev-devel
136 BuildRequires: util-linux
137 %{?with_system_v8:BuildRequires: v8-devel >= 3.7}
139 BuildRequires: xorg-lib-libXScrnSaver-devel
140 BuildRequires: xorg-lib-libXt-devel
141 BuildRequires: xorg-lib-libXtst-devel
143 %{?with_system_yasm:BuildRequires: yasm}
144 %{?with_system_zlib:BuildRequires: zlib-devel}
145 Requires: browser-plugins >= 2.0
146 Requires: desktop-file-utils
147 Requires: hicolor-icon-theme
148 %{?with_libjpegturbo:Requires: libjpeg-turbo >= 1.2.0}
149 %{?with_system_vpx:Requires: libvpx >= 0.9.5-2}
150 Requires: xdg-utils >= 1.0.2-4
152 Obsoletes: chromium-browser-bookmark_manager < 5.0.388.0
153 Obsoletes: chromium-browser-inspector < 15.0.863.0
154 ExclusiveArch: %{ix86} %{x8664} arm
155 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
157 %define find_lang sh find-lang.sh %{buildroot}
159 # Usage: gyp_with BCOND_NAME [OPTION_NAME]
160 %define gyp_with() %{expand:%%{?with_%{1}:-D%{?2:use_%{2}}%{!?2:use_%{1}}=1}%%{!?with_%{1}:-D%{?2:use_%{2}}%{!?2:use_%{1}}=0}}
162 %if %{without debuginfo}
163 %define _enable_debug_packages 0
167 Chromium is an open-source browser project that aims to build a safer,
168 faster, and more stable way for all Internet users to experience the
171 Chromium serves as a base for Google Chrome, which is Chromium
172 rebranded (name and logo) with very few additions such as usage
173 tracking and an auto-updater system.
176 Summary: chromium-browser language packages
178 Requires: %{name} = %{version}-%{release}
181 Chromium is an open-source browser project that aims to build a safer,
182 faster, and more stable way for all Internet users to experience the
185 This package contains language packages for 50 languages:
187 ar, bg, bn, ca, cs, da, de, el, en-GB, es-LA, es, et, fi, fil, fr, gu,
188 he, hi, hr, hu, id, it, ja, kn, ko, lt, lv, ml, mr, nb, nl, or, pl,
189 pt-BR, pt-PT, ro, ru, sk, sl, sr, sv, ta, te, th, tr, uk, vi, zh-CN,
195 # Google's versioning is interesting. They never reset "BUILD", which is how we jumped
196 # from 3.0.201.0 to 4.0.202.0 as they moved to a new major branch
197 . ./src/chrome/VERSION
198 ver=$MAJOR.$MINOR.$BUILD.$PATCH
199 test "$ver" = %{version}
201 gyp_rev=$(grep googlecode_url.*gyp src/DEPS | cut -d'"' -f6 | cut -d@ -f2)
202 test "$gyp_rev" = %{gyp_rev} || :
204 v8_ver=$(awk 'NR=1 {print $NF; exit}' src/v8/ChangeLog || :)
206 # Populate the LASTCHANGE file template as we no longer have the VCS files at this point
207 #echo "%{svnver}" > src/build/LASTCHANGE.in
209 # add chromium and pld to useragent
210 %define pld_version %(echo %{pld_release} | sed -e 'y/[at]/[AT]/')
211 sed -e 's/@BUILD_DIST@/PLD %{pld_version}/g' \
212 -e 's/@BUILD_DIST_NAME@/PLD/g' \
213 -e 's/@BUILD_DIST_VERSION@/%{pld_version}/g' \
214 < %{PATCH8} | %{__patch} -p1
216 %{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE5} > find-lang.sh
229 %{!?with_libjpegturbo:%patch11 -p0}
232 cd third_party/WebKit
238 sh -x clean-source.sh %{!?with_system_v8:v8=0} %{!?with_nacl:nacl=0} libxml=0
244 rm -rf native_client/toolchain/linux_x86_newlib
245 # Make symlinks for nacl
246 cd native_client/toolchain
247 install -d linux_x86_newlib/x86_64-nacl/bin
248 install -d linux_x86_newlib/x86_64-nacl/lib
249 install -d linux_x86_newlib/x86_64-nacl/lib32
250 install -d linux_x86_newlib/x86_64-nacl/nacl/include/bits
251 install -d linux_x86_newlib/x86_64-nacl/nacl/include/machine
252 install -d linux_x86_newlib/x86_64-nacl/nacl/include/sys
253 # link newlib toolchain to glibc as well, see gentoo bug #417019
254 #ln -s linux_x86_newlib linux_x86
255 cd linux_x86_newlib/x86_64-nacl/bin
256 ln -s %{_bindir}/x86_64-nacl-gcc gcc
257 ln -s %{_bindir}/x86_64-nacl-g++ g++
258 ln -s %{_bindir}/x86_64-nacl-ar ar
259 ln -s %{_bindir}/x86_64-nacl-as as
260 ln -s %{_bindir}/x86_64-nacl-ranlib ranlib
261 ln -s %{_bindir}/x86_64-nacl-strip x86-64-nacl-strip
262 ln -s %{_bindir}/x86_64-nacl-strip strip
263 ln -s %{_prefix}/x86_64-nacl/lib/*.a ../lib/
264 ln -s %{_prefix}/x86_64-nacl/lib/32/*.a ../lib32/
266 for i in $(find %{_prefix}/x86_64-nacl/include -type f | grep -v "c++"); do
267 ln -s $i ${i#%{_prefix}/x86_64-nacl/include/}
272 test -e Makefile || %{__python} build/gyp_chromium --format=make build/all.gyp \
279 %if "%{cc_version}" >= "4.4.0" && "%{cc_version}" < "4.5.0"
280 -Dno_strict_aliasing=1 -Dgcc_version=44 \
282 %if %{with sandboxing}
283 -Dlinux_sandbox_path=%{_libdir}/%{name}/chromium-sandbox \
284 -Dlinux_sandbox_chrome_path=%{_libdir}/%{name}/%{name} \
286 %{!?debug:-Dwerror=} \
287 %{!?debuginfo:-Dfastbuild=1 -Dremove_webcore_debug_symbols=1} \
288 %{?with_shared_libs:-Dlibrary=shared_library} \
289 -Dbuild_ffmpegsumo=%{?with_ffmpegsumo:1}%{!?with_ffmpegsumo:0} \
290 -Dffmpeg_branding=Chrome \
291 -Dproprietary_codecs=1 \
293 %{?_:# Disable glibc Native Client toolchain, we don't need it (gentoo bug #417019).} \
298 %{!?with_sse2:-Ddisable_sse2=1} \
299 %{?with_selinux:-Dselinux=1} \
303 %{gyp_with kerberos} -Dlinux_link_kerberos=0 \
304 %{gyp_with keyring gnome_keyring} -Dlinux_link_gnome_keyring=0 \
305 %{gyp_with pulseaudio} \
306 %{gyp_with system_libwebp} \
307 %{gyp_with system_speex} \
308 %{gyp_with system_sqlite} \
309 %{gyp_with system_v8} \
310 %{gyp_with system_vpx} \
311 %{gyp_with system_yasm} \
312 %{gyp_with system_zlib} \
313 -Duse_system_bzip2=1 \
315 -Duse_system_libevent=1 \
316 -Duse_system_libjpeg=1 \
317 -Duse_system_libpng=1 \
318 -Duse_system_libxml=1 \
319 -Duse_system_libxslt=1 \
320 -Duse_system_xdg_utils=1 \
321 %{!?with_tcmalloc:-Dlinux_use_tcmalloc=0} \
322 -Dlinux_use_gold_binary=0 \
323 -Dlinux_use_gold_flags=0
325 %{__make} chrome %{?with_sandboxing:chrome_sandbox} \
326 BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
327 %{?with_verbose:V=1} \
330 LDFLAGS="%{rpmldflags} -fuse-ld=gold" \
332 CXX.host="%{__cxx}" \
333 LDFLAGS.host="%{rpmldflags}" \
334 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
335 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}"
338 rm -rf $RPM_BUILD_ROOT
339 install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/{themes,plugins,extensions} \
340 $RPM_BUILD_ROOT{%{_bindir},%{_sysconfdir}/%{name},%{_mandir}/man1,%{_desktopdir}}
342 cd src/out/%{!?debug:Release}%{?debug:Debug}
343 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/default
344 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
345 %{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
346 cp -a *.pak locales resources $RPM_BUILD_ROOT%{_libdir}/%{name}
347 cp -p chrome.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
348 install -p chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name}
349 install -p chrome_sandbox $RPM_BUILD_ROOT%{_libdir}/%{name}/chromium-sandbox
350 %if %{with ffmpegsumo}
351 install -p libffmpegsumo.so $RPM_BUILD_ROOT%{_libdir}/%{name}
353 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}
355 %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/resources/extension/demo
358 # Install Native Client files on platforms that support it.
359 install -p nacl_helper{,_bootstrap} $RPM_BUILD_ROOT%{_libdir}/%{name}
360 install -p libppGoogleNaClPluginChrome.so $RPM_BUILD_ROOT%{_libdir}/%{name}
362 install -p nacl_irt_x86_64.nexe $RPM_BUILD_ROOT%{_libdir}/%{name}
365 install -p nacl_irt_x86_32.nexe $RPM_BUILD_ROOT%{_libdir}/%{name}
371 for icon in src/chrome/app/theme/chromium/product_logo_[0-9]*.png; do
372 size=${icon##*/product_logo_}
375 # this will skip non-numeric (22_mono_invert, 22_mono)
376 dir=%{_iconsdir}/hicolor/${size}x${size}/apps
377 test -d "$dir" || continue
379 install -d $RPM_BUILD_ROOT$dir
380 cp -p $icon $RPM_BUILD_ROOT$dir/%{name}.png
383 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins -b <<'EOF'
384 # http://code.google.com/p/chromium/issues/detail?id=24507
385 gecko-mediaplayer*.so
389 %find_lang %{name}.lang
390 # always package en-US
391 %{__sed} -i -e '/en-US.pak/d' %{name}.lang
394 rm -rf $RPM_BUILD_ROOT
397 %update_icon_cache hicolor
398 %update_desktop_database
399 %update_browser_plugins
402 if [ "$1" = 0 ]; then
403 %update_icon_cache hicolor
404 %update_browser_plugins
408 %defattr(644,root,root,755)
409 %{_browserpluginsconfdir}/browsers.d/%{name}.*
410 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
411 %dir %{_sysconfdir}/%{name}
412 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/default
413 %attr(755,root,root) %{_bindir}/%{name}
414 %{_mandir}/man1/%{name}.1*
415 %{_desktopdir}/*.desktop
416 %{_iconsdir}/hicolor/*/apps/%{name}.png
417 %dir %{_libdir}/%{name}
418 %{_libdir}/%{name}/chrome.pak
419 %{_libdir}/%{name}/content_resources.pak
420 %{_libdir}/%{name}/resources.pak
421 %{_libdir}/%{name}/theme_resources_standard.pak
422 %{_libdir}/%{name}/ui_resources_standard.pak
423 %dir %{_libdir}/%{name}/locales
424 %{_libdir}/%{name}/locales/en-US.pak
425 %dir %{_libdir}/%{name}/resources
426 %{_libdir}/%{name}/resources/inspector
427 %dir %{_libdir}/%{name}/themes
428 %dir %{_libdir}/%{name}/extensions
429 %dir %{_libdir}/%{name}/plugins
430 %attr(755,root,root) %{_libdir}/%{name}/%{name}
431 # These unique permissions are intentional and necessary for the sandboxing
432 %attr(4555,root,root) %{_libdir}/%{name}/chromium-sandbox
435 %if %{with ffmpegsumo}
436 %attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so
440 %attr(755,root,root) %{_libdir}/%{name}/libppGoogleNaClPluginChrome.so
441 %attr(755,root,root) %{_libdir}/%{name}/nacl_helper
442 %attr(755,root,root) %{_libdir}/%{name}/nacl_helper_bootstrap
443 %attr(755,root,root) %{_libdir}/%{name}/nacl_irt_x86_*.nexe
446 %files l10n -f %{name}.lang
447 %defattr(644,root,root,755)