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 # system zlib disabled because of mixed-source.patch
24 # https://code.google.com/p/chromium/issues/detail?id=143623
25 %bcond_with system_zlib # with system zlib
26 %bcond_without libjpegturbo # use libjpeg-turbo features
27 %bcond_without verbose # verbose build (V=1)
30 # temporary hack as seems this does not work: http://codereview.chromium.org/8890043
31 # nacl_bootstrap.c:(.text.load_elf_file+0x707): undefined reference to `__stack_chk_fail'
32 #14:08:04 @baggins> glen: yes, I added SSP in rpm5, add -lssp to link flags to fix it
33 #14:19:42 @baggins> it doesn't hurt to add -lssp here and there, and we'll be a bit more secure
34 #14:51:06 @baggins> as-needed will take care of unneeded lib
35 #14:52:03 @baggins> -lssp comes with gcc
36 %define _ssp_cflags %{nil}
40 # - check system sqlite linking problems
41 # - find system deps: find -name '*.gyp*' | xargs grep 'use_system.*=='
42 # - use_system_ssl (use_openssl: http://crbug.com/62803)
43 # - use_system_ffmpeg && build_ffmpegsumo
44 # - use_system_hunspell
45 # - use_system_stlport
46 # - other defaults: src/build/common.gypi
49 # - mute BEEP mixer if you do not want to hear horrible system bell when
50 # pressing home/end in url bar or more ^F search results on page.
52 # - build i686: -bc: 2.7G; -bb: ~1.0GB
53 # - build x86_64: ~1.9G
54 # - http://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites
55 # - to look for new tarball, use update-source.sh script
58 # To use chromium nightly beta builds for pld-th save to /etc/poldek/repos.d (as chromium-nightly.conf):
59 # http://carme.pld-linux.org/~glen/chromium-browser/th/x86_64/chromium-nightly.conf
60 # http://carme.pld-linux.org/~glen/chromium-browser/th/i686/chromium-nightly.conf
63 Summary: A WebKit powered web browser
64 Name: chromium-browser
67 License: BSD, LGPL v2+ (ffmpeg)
68 Group: X11/Applications/Networking
69 Source0: http://carme.pld-linux.org/~glen/chromium-browser/src/beta/%{name}-%{version}.tar.xz
70 # Source0-md5: d7d10e30992db870820f7baa5e2f8e29
71 #Source0: http://carme.pld-linux.org/~glen/chromium-browser/src/stable/%{name}-%{version}.tar.xz
72 Source1: %{name}.default
74 Source3: %{name}.desktop
76 Source6: update-source.sh
77 Source7: clean-source.sh
78 Source8: get-source.sh
79 Patch0: system-libs.patch
80 Patch1: plugin-searchdirs.patch
81 Patch2: gyp-system-minizip.patch
82 Patch3: disable_dlog_and_dcheck_in_release_builds.patch
83 Patch4: path-libpdf.patch
84 Patch5: options-support.patch
85 Patch6: get-webkit_revision.patch
86 Patch7: dlopen_sonamed_gl.patch
87 Patch8: chromium_useragent.patch.in
88 Patch9: chromium-ppapi.patch
89 # https://bugs.gentoo.org/show_bug.cgi?id=393471
90 # libjpeg-turbo >= 1.1.90 supports that feature
91 Patch11: chromium-revert-jpeg-swizzle-r2.patch
92 Patch15: nacl-build-irt.patch
93 Patch16: nacl-linkingfix.patch
94 Patch17: system-icu.patch
95 URL: http://www.chromium.org/Home
96 %{?with_gconf:BuildRequires: GConf2-devel}
97 BuildRequires: OpenGL-GLU-devel
98 BuildRequires: alsa-lib-devel
99 BuildRequires: atk-devel
101 BuildRequires: bzip2-devel
102 %{?with_nacl:BuildRequires: crossnacl-binutils >= 2.20.1}
103 %{?with_nacl:BuildRequires: crossnacl-gcc >= 4.4.3}
104 %{?with_nacl:BuildRequires: crossnacl-gcc-c++ >= 4.4.3}
105 %{?with_nacl:BuildRequires: crossnacl-newlib >= 1.18.0}
106 %{?with_cups:BuildRequires: cups-devel}
107 BuildRequires: dbus-glib-devel
108 BuildRequires: expat-devel
109 %{?with_system_flac:BuildRequires: flac-devel}
111 BuildRequires: fontconfig-devel
112 BuildRequires: glib2-devel
114 BuildRequires: gtk+2-devel
115 %{?with_kerberos:BuildRequires: heimdal-devel}
116 BuildRequires: hicolor-icon-theme
117 BuildRequires: libevent-devel
118 %{?with_keyring:BuildRequires: libgnome-keyring-devel}
119 BuildRequires: libicu-devel >= 4.6
120 %{!?with_libjpegturbo:BuildRequires: libjpeg-devel}
121 %{?with_libjpegturbo:BuildRequires: libjpeg-turbo-devel >= 1.2.0}
122 BuildRequires: libpng-devel
123 %{?with_selinux:BuildRequires: libselinux-devel}
124 BuildRequires: libstdc++-devel
125 %{?with_system_vpx:BuildRequires: libvpx-devel >= 0.9.5-2}
126 %{?with_system_libwebp:BuildRequires: libwebp-devel >= 0.1.99}
127 BuildRequires: libxml2-devel
128 BuildRequires: libxslt-devel
130 BuildRequires: minizip-devel
131 BuildRequires: nspr-devel
132 BuildRequires: nss-devel >= 1:3.12.3
133 BuildRequires: pam-devel
134 BuildRequires: pango-devel
135 BuildRequires: perl-modules
136 BuildRequires: pkgconfig
137 %{?with_pulseaudio:BuildRequires: pulseaudio-devel}
138 BuildRequires: python
139 #BuildRequires: python-gyp >= 1-%{gyp_rev}
140 BuildRequires: python-modules
141 BuildRequires: rpm >= 4.4.9-56
142 BuildRequires: rpmbuild(macros) >= 1.453
143 %{?with_system_speex:BuildRequires: speex-devel >= 1:1.2-rc1}
144 BuildRequires: sqlite3-devel >= 3.6.1
145 BuildRequires: subversion
146 BuildRequires: tar >= 1:1.22
147 BuildRequires: udev-devel
148 BuildRequires: util-linux
149 %{?with_system_v8:BuildRequires: v8-devel >= 3.7}
151 BuildRequires: xorg-lib-libXScrnSaver-devel
152 BuildRequires: xorg-lib-libXt-devel
153 BuildRequires: xorg-lib-libXtst-devel
155 %{?with_system_yasm:BuildRequires: yasm}
156 %{?with_system_zlib:BuildRequires: zlib-devel}
157 Requires: browser-plugins >= 2.0
158 Requires: desktop-file-utils
159 Requires: hicolor-icon-theme
160 %{?with_libjpegturbo:Requires: libjpeg-turbo >= 1.2.0}
161 %{?with_system_vpx:Requires: libvpx >= 0.9.5-2}
162 Requires: xdg-utils >= 1.0.2-4
164 Obsoletes: chromium-browser-bookmark_manager < 5.0.388.0
165 Obsoletes: chromium-browser-inspector < 15.0.863.0
166 ExclusiveArch: %{ix86} %{x8664} arm
167 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
169 %define find_lang sh find-lang.sh %{buildroot}
171 # Usage: gyp_with BCOND_NAME [OPTION_NAME]
172 %define gyp_with() %{expand:%%{?with_%{1}:-D%{?2:use_%{2}}%{!?2:use_%{1}}=1}%%{!?with_%{1}:-D%{?2:use_%{2}}%{!?2:use_%{1}}=0}}
174 %if %{without debuginfo}
175 %define _enable_debug_packages 0
179 Chromium is an open-source browser project that aims to build a safer,
180 faster, and more stable way for all Internet users to experience the
183 Chromium serves as a base for Google Chrome, which is Chromium
184 rebranded (name and logo) with very few additions such as usage
185 tracking and an auto-updater system.
188 Summary: chromium-browser language packages
190 Requires: %{name} = %{version}-%{release}
193 Chromium is an open-source browser project that aims to build a safer,
194 faster, and more stable way for all Internet users to experience the
197 This package contains language packages for 50 languages:
199 ar, bg, bn, ca, cs, da, de, el, en-GB, es-LA, es, et, fi, fil, fr, gu,
200 he, hi, hr, hu, id, it, ja, kn, ko, lt, lv, ml, mr, nb, nl, or, pl,
201 pt-BR, pt-PT, ro, ru, sk, sl, sr, sv, ta, te, th, tr, uk, vi, zh-CN,
207 # Google's versioning is interesting. They never reset "BUILD", which is how we jumped
208 # from 3.0.201.0 to 4.0.202.0 as they moved to a new major branch
209 . ./src/chrome/VERSION
210 ver=$MAJOR.$MINOR.$BUILD.$PATCH
211 test "$ver" = %{version}
213 gyp_rev=$(grep googlecode_url.*gyp src/DEPS | cut -d'"' -f6 | cut -d@ -f2)
214 test "$gyp_rev" = %{gyp_rev} || :
216 v8_ver=$(awk 'NR=1 {print $NF; exit}' src/v8/ChangeLog || :)
218 # add chromium and pld to useragent
219 %define pld_version %(echo %{pld_release} | sed -e 'y/[at]/[AT]/')
220 sed -e 's/@BUILD_DIST@/PLD %{pld_version}/g' \
221 -e 's/@BUILD_DIST_NAME@/PLD/g' \
222 -e 's/@BUILD_DIST_VERSION@/%{pld_version}/g' \
223 < %{PATCH8} | %{__patch} -p1
225 %{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE5} > find-lang.sh
239 %{!?with_libjpegturbo:%patch11 -p0}
246 # Missing gyp files in tarball.
247 # https://code.google.com/p/chromium/issues/detail?id=144823
248 if [ -e chrome/test/data/nacl/nacl_test_data.gyp ]; then
249 echo "tarball fixed, please remove workaround"
253 install -d chrome/test/data/nacl
254 cat > chrome/test/data/nacl/nacl_test_data.gyp <<-EOF
258 'target_name': 'nacl_tests',
265 sh -x clean-source.sh %{!?with_system_v8:v8=0} %{!?with_nacl:nacl=0} libxml=0 %{!?with_system_zlib:zlib=0}
271 rm -rf native_client/toolchain/linux_x86_newlib
272 # Make symlinks for nacl
273 cd native_client/toolchain
274 install -d linux_x86_newlib/x86_64-nacl/bin
275 install -d linux_x86_newlib/x86_64-nacl/lib
276 install -d linux_x86_newlib/x86_64-nacl/lib32
277 install -d linux_x86_newlib/x86_64-nacl/nacl/include/bits
278 install -d linux_x86_newlib/x86_64-nacl/nacl/include/machine
279 install -d linux_x86_newlib/x86_64-nacl/nacl/include/sys
280 # link newlib toolchain to glibc as well, see gentoo bug #417019
281 #ln -s linux_x86_newlib linux_x86
282 cd linux_x86_newlib/x86_64-nacl/bin
283 ln -s %{_bindir}/x86_64-nacl-gcc gcc
284 ln -s %{_bindir}/x86_64-nacl-g++ g++
285 ln -s %{_bindir}/x86_64-nacl-ar ar
286 ln -s %{_bindir}/x86_64-nacl-as as
287 ln -s %{_bindir}/x86_64-nacl-ranlib ranlib
288 ln -s %{_bindir}/x86_64-nacl-strip x86-64-nacl-strip
289 ln -s %{_bindir}/x86_64-nacl-strip strip
290 ln -s %{_prefix}/x86_64-nacl/lib/*.a ../lib/
291 ln -s %{_prefix}/x86_64-nacl/lib/32/*.a ../lib32/
293 for i in $(find %{_prefix}/x86_64-nacl/include -type f | grep -v "c++"); do
294 ln -s $i ${i#%{_prefix}/x86_64-nacl/include/}
298 : Preparing NaCl newlib toolchain
300 cp -a native_client/toolchain/linux_x86_newlib sdk/nacl-sdk
301 install -d native_client/toolchain/.tars
302 tar czf native_client/toolchain/.tars/naclsdk_linux_x86.tgz sdk
305 test -e Makefile || %{__python} build/gyp_chromium --format=make build/all.gyp \
312 %if "%{cc_version}" >= "4.4.0" && "%{cc_version}" < "4.5.0"
313 -Dno_strict_aliasing=1 -Dgcc_version=44 \
315 %if %{with sandboxing}
316 -Dlinux_sandbox_path=%{_libdir}/%{name}/chromium-sandbox \
317 -Dlinux_sandbox_chrome_path=%{_libdir}/%{name}/%{name} \
319 %{!?debug:-Dwerror=} \
320 %{!?debuginfo:-Dfastbuild=1 -Dremove_webcore_debug_symbols=1} \
321 %{?with_shared_libs:-Dlibrary=shared_library} \
322 -Dbuild_ffmpegsumo=%{?with_ffmpegsumo:1}%{!?with_ffmpegsumo:0} \
323 -Dffmpeg_branding=Chrome \
324 -Dproprietary_codecs=1 \
326 %{?_:# Disable glibc Native Client toolchain, we don't need it (gentoo bug #417019).} \
328 -Dnaclsdk_mode=custom:/usr/x86_64-nacl \
333 %{!?with_sse2:-Ddisable_sse2=1} \
334 %{?with_selinux:-Dselinux=1} \
338 %{gyp_with kerberos} -Dlinux_link_kerberos=0 \
339 %{gyp_with keyring gnome_keyring} -Dlinux_link_gnome_keyring=0 \
340 %{gyp_with pulseaudio} \
341 %{gyp_with system_libwebp} \
342 %{gyp_with system_speex} \
343 %{gyp_with system_sqlite} \
344 %{gyp_with system_v8} \
345 %{gyp_with system_vpx} \
346 %{gyp_with system_yasm} \
347 %{gyp_with system_zlib} \
348 -Duse_system_bzip2=1 \
350 -Duse_system_libevent=1 \
351 -Duse_system_libjpeg=1 \
352 -Duse_system_libpng=1 \
353 -Duse_system_libxml=1 \
354 -Duse_system_libxslt=1 \
355 -Duse_system_xdg_utils=1 \
356 %{!?with_tcmalloc:-Dlinux_use_tcmalloc=0} \
357 -Dlinux_use_gold_binary=0 \
358 -Dlinux_use_gold_flags=0
360 %{__make} chrome %{?with_sandboxing:chrome_sandbox} \
361 BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
362 %{?with_verbose:V=1} \
365 LDFLAGS="%{rpmldflags} -fuse-ld=gold" \
367 CXX.host="%{__cxx}" \
368 LDFLAGS.host="%{rpmldflags}" \
369 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
370 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}"
373 rm -rf $RPM_BUILD_ROOT
374 install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/{themes,plugins,extensions} \
375 $RPM_BUILD_ROOT{%{_bindir},%{_sysconfdir}/%{name},%{_mandir}/man1,%{_desktopdir}}
377 cd src/out/%{!?debug:Release}%{?debug:Debug}
378 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/default
379 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
380 %{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
381 cp -a *.pak locales resources $RPM_BUILD_ROOT%{_libdir}/%{name}
382 cp -p chrome.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
383 install -p chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name}
384 install -p chrome_sandbox $RPM_BUILD_ROOT%{_libdir}/%{name}/chromium-sandbox
385 %if %{with ffmpegsumo}
386 install -p libffmpegsumo.so $RPM_BUILD_ROOT%{_libdir}/%{name}
388 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}
390 %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/resources/extension/demo
393 # Install Native Client files on platforms that support it.
394 install -p nacl_helper{,_bootstrap} $RPM_BUILD_ROOT%{_libdir}/%{name}
395 install -p libppGoogleNaClPluginChrome.so $RPM_BUILD_ROOT%{_libdir}/%{name}
397 install -p nacl_irt_x86_64.nexe $RPM_BUILD_ROOT%{_libdir}/%{name}
400 install -p nacl_irt_x86_32.nexe $RPM_BUILD_ROOT%{_libdir}/%{name}
406 for icon in src/chrome/app/theme/chromium/product_logo_[0-9]*.png; do
407 size=${icon##*/product_logo_}
410 # this will skip non-numeric (22_mono_invert, 22_mono)
411 dir=%{_iconsdir}/hicolor/${size}x${size}/apps
412 test -d "$dir" || continue
414 install -d $RPM_BUILD_ROOT$dir
415 cp -p $icon $RPM_BUILD_ROOT$dir/%{name}.png
418 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins -b <<'EOF'
419 # http://code.google.com/p/chromium/issues/detail?id=24507
420 gecko-mediaplayer*.so
424 %find_lang %{name}.lang
425 # always package en-US
426 %{__sed} -i -e '/en-US.pak/d' %{name}.lang
429 rm -rf $RPM_BUILD_ROOT
432 %update_icon_cache hicolor
433 %update_desktop_database
434 %update_browser_plugins
437 if [ "$1" = 0 ]; then
438 %update_icon_cache hicolor
439 %update_browser_plugins
443 %defattr(644,root,root,755)
444 %{_browserpluginsconfdir}/browsers.d/%{name}.*
445 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
446 %dir %{_sysconfdir}/%{name}
447 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/default
448 %attr(755,root,root) %{_bindir}/%{name}
449 %{_mandir}/man1/%{name}.1*
450 %{_desktopdir}/*.desktop
451 %{_iconsdir}/hicolor/*/apps/%{name}.png
452 %dir %{_libdir}/%{name}
453 %{_libdir}/%{name}/chrome*.pak
454 %{_libdir}/%{name}/content_resources.pak
455 %{_libdir}/%{name}/resources.pak
456 %dir %{_libdir}/%{name}/locales
457 %{_libdir}/%{name}/locales/en-US.pak
458 %dir %{_libdir}/%{name}/resources
459 %{_libdir}/%{name}/resources/inspector
460 %dir %{_libdir}/%{name}/themes
461 %dir %{_libdir}/%{name}/extensions
462 %dir %{_libdir}/%{name}/plugins
463 %attr(755,root,root) %{_libdir}/%{name}/%{name}
464 # These unique permissions are intentional and necessary for the sandboxing
465 %attr(4555,root,root) %{_libdir}/%{name}/chromium-sandbox
468 %if %{with ffmpegsumo}
469 %attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so
473 %attr(755,root,root) %{_libdir}/%{name}/libppGoogleNaClPluginChrome.so
474 %attr(755,root,root) %{_libdir}/%{name}/nacl_helper
475 %attr(755,root,root) %{_libdir}/%{name}/nacl_helper_bootstrap
476 %attr(755,root,root) %{_libdir}/%{name}/nacl_irt_x86_*.nexe
479 %files l10n -f %{name}.lang
480 %defattr(644,root,root,755)