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_with 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 system_sqlite # with system sqlite
16 %bcond_without system_flac # with system flac
17 %bcond_without system_libwebp # with system libwebp
18 %bcond_without system_speex # with system speex
19 %bcond_without system_v8 # with system v8
20 %bcond_without system_vpx # with system vpx
21 %bcond_without system_yasm # with system yasm
22 %bcond_without system_zlib # with system zlib
23 %bcond_with verbose # verbose build (V=1)
26 # - check system sqlite linking problems
27 # - find system deps: find -name '*.gyp*' | xargs grep 'use_system.*=='
28 # - use_system_ssl (use_openssl: http://crbug.com/62803)
29 # - use_system_ffmpeg && build_ffmpegsumo
30 # - use_system_hunspell
31 # - use_system_stlport
32 # - other defaults: src/build/common.gypi
35 # - mute BEEP mixer if you do not want to hear horrible system bell when
36 # pressing home/end in url bar or more ^F search results on page.
38 # - build i686: -bc: 2.7G; -bb: ~1.0GB
39 # - build x86_64: ~1.9G
40 # - http://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites
41 # - to look for new tarball, use update-source.sh script
44 # To use chromium nightly builds for pld-th save to /etc/poldek/repos.d (as chromium-nightly.conf):
45 # http://carme.pld-linux.org/~glen/chromium-browser/th/i686/chromium-nightly.conf
47 # http://carme.pld-linux.org/~glen/chromium-browser/th/x86_64/chromium-nightly.conf
49 %define svndate %{nil}
54 Summary: A WebKit powered web browser
55 Name: chromium-browser
57 Release: 0.%{svnver}.%{rel}
58 License: BSD, LGPL v2+ (ffmpeg)
59 Group: X11/Applications/Networking
60 Source0: http://carme.pld-linux.org/~glen/chromium-browser/src/beta/%{name}_%{version}~r%{svnver}.orig.tar.gz
61 # Source0-md5: 92eda1bd49fff2e70b703032f1aaab0d
62 #SourceX: http://ppa.launchpad.net/chromium-daily/ppa/ubuntu/pool/main/c/chromium-browser/%{name}_%{version}~svn%{svndate}r%{svnver}.orig.tar.gz
64 Source3: %{name}.desktop
66 Source5: update-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 Patch5: options-support.patch
72 Patch6: get-webkit_revision.patch
73 Patch7: dlopen_sonamed_gl.patch
74 Patch8: chromium_useragent.patch.in
75 URL: http://www.chromium.org/Home
76 %{?with_gconf:BuildRequires: GConf2-devel}
77 BuildRequires: OpenGL-GLU-devel
78 BuildRequires: alsa-lib-devel
79 BuildRequires: atk-devel
81 BuildRequires: bzip2-devel
82 %{?with_cups:BuildRequires: cups-devel}
83 BuildRequires: dbus-glib-devel
84 %{?with_system_flac:BuildRequires: flac-devel}
86 BuildRequires: fontconfig-devel
87 BuildRequires: glib2-devel
89 BuildRequires: gtk+2-devel
90 %{?with_kerberos:BuildRequires: heimdal-devel}
91 BuildRequires: libevent-devel
92 %{?with_keyring:BuildRequires: libgnome-keyring-devel}
93 BuildRequires: libicu-devel >= 4.6
94 BuildRequires: libjpeg-devel
95 BuildRequires: libpng-devel
96 %{?with_selinux:BuildRequires: libselinux-devel}
97 BuildRequires: libstdc++-devel
98 %{?with_system_vpx:BuildRequires: libvpx-devel >= 0.9.5-2}
99 %{?with_system_libwebp:BuildRequires: libwebp-devel}
100 BuildRequires: libxml2-devel
101 BuildRequires: libxslt-devel
103 BuildRequires: minizip-devel
104 %{?with_nacl:BuildRequires: nacl-toolchain-newlib >= 0.6941}
105 BuildRequires: nspr-devel
106 BuildRequires: nss-devel >= 1:3.12.3
107 BuildRequires: pam-devel
108 BuildRequires: pango-devel
109 BuildRequires: perl-modules
110 BuildRequires: pkgconfig
111 %{?with_pulseaudio:BuildRequires: pulseaudio-devel}
112 BuildRequires: python
113 #BuildRequires: python-gyp >= 1-%{gyp_rev}
114 BuildRequires: python-modules
115 BuildRequires: rpm >= 4.4.9-56
116 BuildRequires: rpmbuild(macros) >= 1.453
117 %{?with_system_speex:BuildRequires: speex-devel >= 1:1.2-rc1}
118 BuildRequires: sqlite3-devel >= 3.6.1
119 BuildRequires: tar >= 1:1.22
120 BuildRequires: util-linux
121 %{?with_system_v8:BuildRequires: v8-devel >= 3.6}
123 BuildRequires: xorg-lib-libXScrnSaver-devel
124 BuildRequires: xorg-lib-libXt-devel
125 BuildRequires: xorg-lib-libXtst-devel
126 %{?with_system_yasm:BuildRequires: yasm}
127 %{?with_system_zlib:BuildRequires: zlib-devel}
128 Requires: browser-plugins >= 2.0
129 Requires: desktop-file-utils
130 %{?with_system_vpx:Requires: libvpx >= 0.9.5-2}
131 Requires: xdg-utils >= 1.0.2-4
133 Obsoletes: chromium-browser-bookmark_manager < 5.0.388.0
134 Obsoletes: chromium-browser-inspector < 15.0.863.0
135 ExclusiveArch: %{ix86} %{x8664} arm
136 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
138 %define find_lang sh find-lang.sh %{buildroot}
139 # Usage: gyp_with BCOND_NAME [OPTION_NAME]
140 %define gyp_with() %{expand:%%{?with_%{1}:-D%{?2:use_%{2}}%{!?2:use_%{1}}=1}%%{!?with_%{1}:-D%{?2:use_%{2}}%{!?2:use_%{1}}=0}}
142 %if %{without debuginfo}
143 %define _enable_debug_packages 0
146 # undefine if empty, makes prep simplier
147 %if "%{svndate}" == "%{nil}"
152 Chromium is an open-source browser project that aims to build a safer,
153 faster, and more stable way for all Internet users to experience the
156 Chromium serves as a base for Google Chrome, which is Chromium
157 rebranded (name and logo) with very few additions such as usage
158 tracking and an auto-updater system.
161 Summary: chromium-browser language packages
163 Requires: %{name} = %{version}-%{release}
166 Chromium is an open-source browser project that aims to build a safer,
167 faster, and more stable way for all Internet users to experience the
170 This package contains language packages for 50 languages:
172 ar, bg, bn, ca, cs, da, de, el, en-GB, es-LA, es, et, fi, fil, fr, gu,
173 he, hi, hr, hu, id, it, ja, kn, ko, lt, lv, ml, mr, nb, nl, or, pl,
174 pt-BR, pt-PT, ro, ru, sk, sl, sr, sv, ta, te, th, tr, uk, vi, zh-CN,
178 %setup -q -n %{name}-%{version}~%{?svndate:svn%{svndate}}r%{svnver}
179 SRC=%{name}-%{version}~%{?svndate:svn%{svndate}}r%{svnver}-source.tar.*
183 # Google's versioning is interesting. They never reset "BUILD", which is how we jumped
184 # from 3.0.201.0 to 4.0.202.0 as they moved to a new major branch
185 . ./src/chrome/VERSION
186 ver=$MAJOR.$MINOR.$BUILD.$PATCH
187 test "$ver" = %{version}
189 gyp_rev=$(grep googlecode_url.*gyp src/DEPS | cut -d'"' -f6 | cut -d@ -f2)
190 test "$gyp_rev" = %{gyp_rev} || :
192 # Populate the LASTCHANGE file template as we no longer have the VCS files at this point
193 echo "%{svnver}" > src/build/LASTCHANGE.in
195 # add chromium and pld to useragent
196 %define pld_version %(echo %{pld_release} | sed -e 'y/[at]/[AT]/')
197 sed -e 's/@BUILD_DIST@/PLD %{pld_version}/g' \
198 -e 's/@BUILD_DIST_NAME@/PLD/g' \
199 -e 's/@BUILD_DIST_VERSION@/%{pld_version}/g' \
200 < %{PATCH8} | %{__patch} -p1
202 %{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE4} > find-lang.sh
212 # drop bundled libs, from gentoo
213 remove_bundled_lib() {
214 echo "Removing bundled library $1 ..."
216 out=$(find $1 -mindepth 1 ! -iname '*.gyp' -print -delete)
217 if [ -z "$out" ]; then
218 echo >&2 "No files matched when removing bundled library $1"
224 remove_bundled_lib "third_party/bzip2"
225 remove_bundled_lib "third_party/icu"
226 remove_bundled_lib "third_party/libevent"
227 remove_bundled_lib "third_party/libjpeg"
228 remove_bundled_lib "third_party/libpng"
229 # third_party/libvpx/libvpx.h should be kept
230 #remove_bundled_lib "third_party/libvpx"
231 remove_bundled_lib "third_party/libxml"
232 remove_bundled_lib "third_party/libxslt"
233 remove_bundled_lib "third_party/zlib"
234 # third_party/yasm/source/patched-yasm/modules/arch/x86/gen_x86_insn.py', needed by `out/Release/obj/gen/third_party/yasm/x86insns.c'. Stop.
235 #remove_bundled_lib "third_party/yasm"
237 %if %{with system_v8}
239 find v8 -type f \! -iname '*.gyp*' -delete
241 # The implementation files include v8 headers with full path,
242 # like #include "v8/include/v8.h". Make sure the system headers
245 ln -s %{_includedir} v8/include
249 # NOTE: here is always x86_64
250 rm -rf native_client/toolchain/linux_x86_newlib
251 ln -s %{_prefix}/x86_64-nacl-newlib native_client/toolchain/linux_x86_newlib
256 test -e Makefile || %{__python} build/gyp_chromium --format=make build/all.gyp \
263 %if "%{cc_version}" >= "4.4.0" && "%{cc_version}" < "4.5.0"
264 -Dno_strict_aliasing=1 -Dgcc_version=44 \
266 %if %{with sandboxing}
267 -Dlinux_sandbox_path=%{_libdir}/%{name}/chromium-sandbox \
268 -Dlinux_sandbox_chrome_path=%{_libdir}/%{name}/%{name} \
270 %{!?debug:-Dwerror=} \
271 %{!?debuginfo:-Dfastbuild=1} \
272 %{?with_shared_libs:-Dlibrary=shared_library} \
273 -Dbuild_ffmpegsumo=%{?with_ffmpegsumo:1}%{!?with_ffmpegsumo:0} \
274 -Dffmpeg_branding=Chrome \
275 -Dproprietary_codecs=1 \
276 %{!?with_nacl:-Ddisable_nacl=1} \
277 %{!?with_sse2:-Ddisable_sse2=1} \
278 %{?with_selinux:-Dselinux=1} \
282 %{gyp_with kerberos} -Dlinux_link_kerberos=0 \
283 %{gyp_with keyring gnome_keyring} -Dlinux_link_gnome_keyring=0 \
284 %{gyp_with pulseaudio} \
285 %{gyp_with system_libwebp} \
286 %{gyp_with system_speex} \
287 %{gyp_with system_sqlite} \
288 %{gyp_with system_v8} \
289 %{gyp_with system_vpx} \
290 %{gyp_with system_yasm} \
291 %{gyp_with system_zlib} \
292 -Duse_system_bzip2=1 \
294 -Duse_system_libevent=1 \
295 -Duse_system_libjpeg=1 \
296 -Duse_system_libpng=1 \
297 -Duse_system_libxml=1 \
298 -Duse_system_libxslt=1 \
299 -Duse_system_xdg_utils=1 \
301 %{__make} chrome %{?with_sandboxing:chrome_sandbox} \
302 BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
303 %{?with_verbose:V=1} \
307 CXX.host="%{__cxx}" \
308 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
309 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}"
312 rm -rf $RPM_BUILD_ROOT
313 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/{themes,locales,plugins,extensions,resources},%{_mandir}/man1,%{_pixmapsdir},%{_desktopdir}}
315 cd src/out/%{!?debug:Release}%{?debug:Debug}
316 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
317 %{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
318 cp -a *.pak locales resources $RPM_BUILD_ROOT%{_libdir}/%{name}
319 cp -p chrome.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
320 install -p chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name}
321 install -p chrome_sandbox $RPM_BUILD_ROOT%{_libdir}/%{name}/chromium-sandbox
322 %if %{with ffmpegsumo}
323 install -p libffmpegsumo.so $RPM_BUILD_ROOT%{_libdir}/%{name}
325 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}
328 # Install Native Client files on platforms that support it.
329 install -p nacl_helper{,_bootstrap} $RPM_BUILD_ROOT%{_libdir}/%{name}
330 install -p libppGoogleNaClPluginChrome.so $RPM_BUILD_ROOT%{_libdir}/%{name}
332 install -p nacl_irt_x86_64.nexe $RPM_BUILD_ROOT%{_libdir}/%{name}
335 install -p nacl_irt_x86_32.nexe $RPM_BUILD_ROOT%{_libdir}/%{name}
341 cp -p src/chrome/app/theme/chromium/product_logo_48.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
343 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins -b <<'EOF'
344 # http://code.google.com/p/chromium/issues/detail?id=24507
345 gecko-mediaplayer*.so
349 %find_lang %{name}.lang
350 # always package en-US
351 %{__sed} -i -e '/en-US.pak/d' %{name}.lang
354 rm -rf $RPM_BUILD_ROOT
357 %update_desktop_database
358 %update_browser_plugins
361 if [ "$1" = 0 ]; then
362 %update_browser_plugins
365 %files -f %{name}.lang
366 %defattr(644,root,root,755)
367 %{_browserpluginsconfdir}/browsers.d/%{name}.*
368 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
369 %attr(755,root,root) %{_bindir}/%{name}
370 %{_mandir}/man1/%{name}.1*
371 %{_pixmapsdir}/%{name}.png
372 %{_desktopdir}/*.desktop
373 %dir %{_libdir}/%{name}
374 %{_libdir}/%{name}/chrome.pak
375 %{_libdir}/%{name}/resources.pak
376 %dir %{_libdir}/%{name}/locales
377 %{_libdir}/%{name}/locales/en-US.pak
378 %dir %{_libdir}/%{name}/resources
379 %{_libdir}/%{name}/resources/inspector
380 %dir %{_libdir}/%{name}/themes
381 %dir %{_libdir}/%{name}/extensions
382 %dir %{_libdir}/%{name}/plugins
383 %attr(755,root,root) %{_libdir}/%{name}/%{name}
384 # These unique permissions are intentional and necessary for the sandboxing
385 %attr(4555,root,root) %{_libdir}/%{name}/chromium-sandbox
388 %if %{with ffmpegsumo}
389 %attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so
393 %attr(755,root,root) %{_libdir}/%{name}/libppGoogleNaClPluginChrome.so
394 %attr(755,root,root) %{_libdir}/%{name}/nacl_helper
395 %attr(755,root,root) %{_libdir}/%{name}/nacl_helper_bootstrap
396 %attr(755,root,root) %{_libdir}/%{name}/nacl_irt_x86_*.nexe
399 %files l10n -f %{name}.lang
400 %defattr(644,root,root,755)