3 %bcond_without debuginfo # disable debuginfo creation (it is huge)
4 %bcond_without ffmpegsumo # build with ffmpegsumo
5 %bcond_with 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_with nacl # build Native Client support
8 %bcond_without sandboxing # with sandboxing
9 %bcond_with selinux # with SELinux (need policy first)
10 %bcond_with shared_libs # with shared libs
11 %bcond_with sse2 # use SSE2 instructions
12 %bcond_without system_speex # with system speex
13 %bcond_with system_sqlite # with system sqlite
14 %bcond_with system_v8 # with system v8
15 %bcond_with system_yasm # with system yasm
16 %bcond_without system_zlib # with system zlib
17 %bcond_with verbose # verbose build (V=1)
20 # - check system sqlite linking problems
21 # - find system deps: find -name '*.gyp*' | xargs grep 'use_system.*=='
23 # - use_system_libwebp
25 # - use_system_ssl (use_openssl: http://crbug.com/62803)
28 # - other defaults: src/build/common.gypi
30 # build broken on x86-64 due 32bit exe:
31 # /home/users/glen/rpm/BUILD.x86_64-linux/chromium-browser-15.0.863.0~svn20110826r98379/src/native_client/toolchain/linux_x86_newlib/bin/x86_64-nacl-ar: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped
32 # build broken on x86-32:
33 # /home/users/glen/rpm/BUILD.i686-linux/chromium-browser-15.0.863.0~svn20110826r98379/src/native_client/toolchain/linux_x86_newlib/bin/../lib/gcc/x86_64-nacl/acl/bin/ld: crtbegin.o: No such file: No such file or directory
36 # - mute BEEP mixer if you do not want to hear horrible system bell when
37 # pressing home/end in url bar or more ^F search results on page.
39 # - build i686: -bc: 2.7G; -bb: ~1.0GB
40 # - build x86_64: -bc: ~990MB; -bb: ~1.0GB
41 # - http://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites
42 # - to look for new tarball, use update-source.sh script
45 # To use chromium nightly builds for pld-th save to /etc/poldek/repos.d (as chromium-nightly.conf):
46 # http://carme.pld-linux.org/~glen/chromium-browser/th/i686/chromium-nightly.conf
48 # http://carme.pld-linux.org/~glen/chromium-browser/th/x86_64/chromium-nightly.conf
50 %define svndate 20110831
55 Summary: A WebKit powered web browser
56 Name: chromium-browser
58 Release: 0.%{svnver}.%{rel}
59 License: BSD, LGPL v2+ (ffmpeg)
60 Group: X11/Applications/Networking
61 Source0: http://ppa.launchpad.net/chromium-daily/ppa/ubuntu/pool/main/c/chromium-browser/%{name}_%{version}~svn%{svndate}r%{svnver}.orig.tar.gz
62 # Source0-md5: ff99ac06796cf69e19a89f89e9e1f898
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 BuildRequires: GConf2-devel
77 BuildRequires: OpenGL-GLU-devel
78 BuildRequires: alsa-lib-devel
79 BuildRequires: atk-devel
81 BuildRequires: bzip2-devel
82 BuildRequires: cups-devel
83 BuildRequires: dbus-glib-devel
85 BuildRequires: fontconfig-devel
86 BuildRequires: glib2-devel
88 BuildRequires: gtk+2-devel
89 %{?with_kerberos:BuildRequires: heimdal-devel}
90 BuildRequires: libevent-devel
91 %{?with_keyring:BuildRequires: libgnome-keyring-devel}
92 BuildRequires: libicu-devel >= 4.6
93 BuildRequires: libjpeg-devel
94 BuildRequires: libpng-devel
95 %{?with_selinux:BuildRequires: libselinux-devel}
96 BuildRequires: libstdc++-devel
97 BuildRequires: libvpx-devel >= 0.9.5-2
98 BuildRequires: libxml2-devel
99 BuildRequires: libxslt-devel
101 BuildRequires: minizip-devel
102 BuildRequires: nspr-devel
103 BuildRequires: nss-devel >= 1:3.12.3
104 BuildRequires: pam-devel
105 BuildRequires: pango-devel
106 BuildRequires: perl-modules
107 BuildRequires: pkgconfig
108 BuildRequires: pulseaudio-devel
109 BuildRequires: python
110 BuildRequires: rpm >= 4.4.9-56
111 %{?with_system_speex:BuildRequires: speex-devel >= 1:1.2-rc1}
112 BuildRequires: python-gyp >= 1-%{gyp_rev}
113 BuildRequires: python-modules
114 BuildRequires: rpmbuild(macros) >= 1.453
115 BuildRequires: sqlite3-devel >= 3.6.1
116 BuildRequires: util-linux
117 %{?with_system_v8:BuildRequires: v8-devel}
119 BuildRequires: xorg-lib-libXScrnSaver-devel
120 BuildRequires: xorg-lib-libXt-devel
121 BuildRequires: xorg-lib-libXtst-devel
122 %{?with_system_yasm:BuildRequires: yasm}
123 %{?with_system_zlib:BuildRequires: zlib-devel}
124 Requires: browser-plugins >= 2.0
125 Requires: libvpx >= 0.9.5-2
126 Requires: xdg-utils >= 1.0.2-4
128 Obsoletes: chromium-browser-bookmark_manager < 5.0.388.0
129 Obsoletes: chromium-browser-inspector < 15.0.863.0
130 ExclusiveArch: %{ix86} %{x8664} arm
131 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
133 %define find_lang sh find-lang.sh %{buildroot}
135 %if %{without debuginfo}
136 %define _enable_debug_packages 0
140 Chromium is an open-source browser project that aims to build a safer,
141 faster, and more stable way for all Internet users to experience the
144 Chromium serves as a base for Google Chrome, which is Chromium
145 rebranded (name and logo) with very few additions such as usage
146 tracking and an auto-updater system.
149 Summary: chromium-browser language packages
151 Requires: %{name} = %{version}-%{release}
154 Chromium is an open-source browser project that aims to build a safer,
155 faster, and more stable way for all Internet users to experience the
158 This package contains language packages for 50 languages:
160 ar, bg, bn, ca, cs, da, de, el, en-GB, es-419, es, et, fi, fil, fr,
161 gu, he, hi, hr, hu, id, it, ja, kn, ko, lt, lv, ml, mr, nb, nl, or,
162 pl, pt-BR, pt-PT, ro, ru, sk, sl, sr, sv, ta, te, th, tr, uk, vi,
166 %setup -q -n %{name}-%{version}~svn%{svndate}r%{svnver}
167 lzma -dc %{name}-%{version}~svn%{svndate}r%{svnver}-source.tar.lzma | tar x
168 rm -f %{name}-%{version}~svn%{svndate}r%{svnver}-source.tar.lzma
170 # Google's versioning is interesting. They never reset "BUILD", which is how we jumped
171 # from 3.0.201.0 to 4.0.202.0 as they moved to a new major branch
172 . ./src/chrome/VERSION
173 ver=$MAJOR.$MINOR.$BUILD.$PATCH
174 test "$ver" = %{version}
176 gyp_rev=$(grep googlecode_url.*gyp src/DEPS | cut -d'"' -f6 | cut -d@ -f2)
177 test "$gyp_rev" = %{gyp_rev}
179 # Populate the LASTCHANGE file template as we no longer have the VCS files at this point
180 echo "%{svnver}" > src/build/LASTCHANGE.in
182 # add chromium and pld to useragent
183 %define pld_version %(echo %{pld_release} | sed -e 'y/[at]/[AT]/')
184 sed -e 's/@BUILD_DIST@/PLD %{pld_version}/g' \
185 -e 's/@BUILD_DIST_NAME@/PLD/g' \
186 -e 's/@BUILD_DIST_VERSION@/%{pld_version}/g' \
187 < %{PATCH8} | %{__patch} -p1
189 %{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE4} > find-lang.sh
199 # drop bundled libs, from gentoo
200 remove_bundled_lib() {
201 echo "Removing bundled library $1 ..."
203 out=$(find $1 -mindepth 1 ! -iname '*.gyp' -print -delete)
204 if [ -z "$out" ]; then
205 echo >&2 "No files matched when removing bundled library $1"
211 remove_bundled_lib "third_party/bzip2"
212 remove_bundled_lib "third_party/icu"
213 remove_bundled_lib "third_party/libevent"
214 remove_bundled_lib "third_party/libjpeg"
215 remove_bundled_lib "third_party/libpng"
216 # third_party/libvpx/libvpx.h should be kept
217 #remove_bundled_lib "third_party/libvpx"
218 remove_bundled_lib "third_party/libxml"
219 remove_bundled_lib "third_party/libxslt"
220 remove_bundled_lib "third_party/zlib"
221 # 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.
222 #remove_bundled_lib "third_party/yasm"
226 %{__python} build/gyp_chromium --format=make build/all.gyp \
233 %if "%{cc_version}" >= "4.4.0" && "%{cc_version}" < "4.5.0"
234 -Dno_strict_aliasing=1 -Dgcc_version=44 \
236 %if %{with sandboxing}
237 -Dlinux_sandbox_path=%{_libdir}/%{name}/chromium-sandbox \
238 -Dlinux_sandbox_chrome_path=%{_libdir}/%{name}/%{name} \
240 %{!?debug:-Dwerror=} \
241 %{!?debuginfo:-Dfastbuild=1} \
242 %{?with_shared_libs:-Dlibrary=shared_library} \
243 -Djavascript_engine=%{?with_system_v8:system-v8}%{!?with_system_v8:v8} \
244 -Dbuild_ffmpegsumo=%{?with_ffmpegsumo:1}%{!?with_ffmpegsumo:0} \
245 -Dffmpeg_branding=Chrome \
246 -Dproprietary_codecs=1 \
247 %{!?with_nacl:-Ddisable_nacl=1} \
248 %{!?with_sse2:-Ddisable_sse2=1} \
249 %{?with_selinux:-Dselinux=1} \
250 -Duse_system_bzip2=1 \
252 -Duse_system_libevent=1 \
253 -Duse_system_libjpeg=1 \
254 -Duse_system_libpng=1 \
255 -Duse_system_libxml=1 \
256 -Duse_system_libxslt=1 \
257 -Duse_system_speex=%{?with_system_speex:1}%{!?with_system_speex:0} \
258 -Duse_system_sqlite=%{?with_system_sqlite:1}%{!?with_system_sqlite:0} \
260 -Duse_system_xdg_utils=1 \
261 -Duse_system_yasm=%{?with_system_yasm:1}%{!?with_system_yasm:0} \
262 -Duse_system_zlib=%{?with_system_zlib:1}%{!?with_system_zlib:0} \
264 -Duse_kerberos=1 -Dlinux_link_kerberos=0 \
269 -Duse_gnome_keyring=1 -Dlinux_link_gnome_keyring=0 \
271 -Duse_gnome_keyring=0 \
274 %{__make} chrome %{?with_sandboxing:chrome_sandbox} \
275 BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
276 %{?with_verbose:V=1} \
280 CXX.host="%{__cxx}" \
281 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
282 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}"
285 rm -rf $RPM_BUILD_ROOT
286 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/{themes,locales,plugins,extensions,resources},%{_mandir}/man1,%{_pixmapsdir},%{_desktopdir}}
288 cd src/out/%{!?debug:Release}%{?debug:Debug}
289 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
290 %{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
291 cp -a *.pak locales resources $RPM_BUILD_ROOT%{_libdir}/%{name}
292 cp -p chrome.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
293 install -p chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name}
294 install -p chrome_sandbox $RPM_BUILD_ROOT%{_libdir}/%{name}/chromium-sandbox
295 %if %{with ffmpegsumo}
296 install -p libffmpegsumo.so $RPM_BUILD_ROOT%{_libdir}/%{name}
298 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}
301 cp -p src/chrome/app/theme/chromium/product_logo_48.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
303 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins -b <<'EOF'
304 # http://code.google.com/p/chromium/issues/detail?id=24507
305 gecko-mediaplayer*.so
309 %find_lang %{name}.lang
310 %{__sed} -i -e '/en-US.pak/d' %{name}.lang
313 rm -rf $RPM_BUILD_ROOT
316 %update_browser_plugins
319 if [ "$1" = 0 ]; then
320 %update_browser_plugins
323 %files -f %{name}.lang
324 %defattr(644,root,root,755)
325 %{_browserpluginsconfdir}/browsers.d/%{name}.*
326 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
327 %attr(755,root,root) %{_bindir}/%{name}
328 %{_mandir}/man1/%{name}.1*
329 %{_pixmapsdir}/%{name}.png
330 %{_desktopdir}/*.desktop
331 %dir %{_libdir}/%{name}
332 %{_libdir}/%{name}/chrome.pak
333 %{_libdir}/%{name}/resources.pak
334 %dir %{_libdir}/%{name}/locales
335 %{_libdir}/%{name}/locales/en-US.pak
336 %dir %{_libdir}/%{name}/resources
337 %{_libdir}/%{name}/resources/inspector
338 %dir %{_libdir}/%{name}/themes
339 %dir %{_libdir}/%{name}/extensions
340 %dir %{_libdir}/%{name}/plugins
341 %attr(755,root,root) %{_libdir}/%{name}/%{name}
342 # These unique permissions are intentional and necessary for the sandboxing
343 %attr(4555,root,root) %{_libdir}/%{name}/chromium-sandbox
346 %if %{with ffmpegsumo}
347 %attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so
350 %files l10n -f %{name}.lang
351 %defattr(644,root,root,755)