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_speex # with system speex
18 %bcond_without system_v8 # with system v8
19 %bcond_without system_vpx # with system vpx
20 %bcond_without system_yasm # with system yasm
21 %bcond_without system_zlib # with system zlib
22 %bcond_with verbose # verbose build (V=1)
25 # - check system sqlite linking problems
26 # - find system deps: find -name '*.gyp*' | xargs grep 'use_system.*=='
27 # - use_system_libwebp
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
34 # build broken on x86-64 due 32bit exe:
35 # /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
36 # build broken on x86-32:
37 # /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
40 # - mute BEEP mixer if you do not want to hear horrible system bell when
41 # pressing home/end in url bar or more ^F search results on page.
43 # - build i686: -bc: 2.7G; -bb: ~1.0GB
44 # - build x86_64: -bc: ~990MB; -bb: ~1.0GB
45 # - http://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites
46 # - to look for new tarball, use update-source.sh script
49 # To use chromium nightly builds for pld-th save to /etc/poldek/repos.d (as chromium-nightly.conf):
50 # http://carme.pld-linux.org/~glen/chromium-browser/th/i686/chromium-nightly.conf
52 # http://carme.pld-linux.org/~glen/chromium-browser/th/x86_64/chromium-nightly.conf
54 %define svndate %{nil}
59 Summary: A WebKit powered web browser
60 Name: chromium-browser
62 Release: 0.%{svnver}.%{rel}
63 License: BSD, LGPL v2+ (ffmpeg)
64 Group: X11/Applications/Networking
65 Source0: http://carme.pld-linux.org/~glen/chromium-browser/src/beta/%{name}_%{version}~r%{svnver}.orig.tar.gz
66 # Source0-md5: 92eda1bd49fff2e70b703032f1aaab0d
67 #SourceX: http://ppa.launchpad.net/chromium-daily/ppa/ubuntu/pool/main/c/chromium-browser/%{name}_%{version}~svn%{svndate}r%{svnver}.orig.tar.gz
69 Source3: %{name}.desktop
71 Source5: update-source.sh
72 Patch0: system-libs.patch
73 Patch1: plugin-searchdirs.patch
74 Patch2: gyp-system-minizip.patch
75 Patch3: disable_dlog_and_dcheck_in_release_builds.patch
76 Patch5: options-support.patch
77 Patch6: get-webkit_revision.patch
78 Patch7: dlopen_sonamed_gl.patch
79 Patch8: chromium_useragent.patch.in
80 URL: http://www.chromium.org/Home
81 %{?with_gconf:BuildRequires: GConf2-devel}
82 BuildRequires: OpenGL-GLU-devel
83 BuildRequires: alsa-lib-devel
84 BuildRequires: atk-devel
86 BuildRequires: bzip2-devel
87 %{?with_cups:BuildRequires: cups-devel}
88 BuildRequires: dbus-glib-devel
89 %{?with_system_flac:BuildRequires: flac-devel}
91 BuildRequires: fontconfig-devel
92 BuildRequires: glib2-devel
94 BuildRequires: gtk+2-devel
95 %{?with_kerberos:BuildRequires: heimdal-devel}
96 BuildRequires: libevent-devel
97 %{?with_keyring:BuildRequires: libgnome-keyring-devel}
98 BuildRequires: libicu-devel >= 4.6
99 BuildRequires: libjpeg-devel
100 BuildRequires: libpng-devel
101 %{?with_selinux:BuildRequires: libselinux-devel}
102 BuildRequires: libstdc++-devel
103 %{?with_system_vpx:BuildRequires: libvpx-devel >= 0.9.5-2}
104 BuildRequires: libxml2-devel
105 BuildRequires: libxslt-devel
107 BuildRequires: minizip-devel
108 BuildRequires: nspr-devel
109 BuildRequires: nss-devel >= 1:3.12.3
110 BuildRequires: pam-devel
111 BuildRequires: pango-devel
112 BuildRequires: perl-modules
113 BuildRequires: pkgconfig
114 %{?with_pulseaudio:BuildRequires: pulseaudio-devel}
115 BuildRequires: python
116 #BuildRequires: python-gyp >= 1-%{gyp_rev}
117 BuildRequires: python-modules
118 BuildRequires: rpm >= 4.4.9-56
119 BuildRequires: rpmbuild(macros) >= 1.453
120 %{?with_system_speex:BuildRequires: speex-devel >= 1:1.2-rc1}
121 BuildRequires: sqlite3-devel >= 3.6.1
122 BuildRequires: tar >= 1:1.22
123 BuildRequires: util-linux
124 %{?with_system_v8:BuildRequires: v8-devel >= 3.6}
126 BuildRequires: xorg-lib-libXScrnSaver-devel
127 BuildRequires: xorg-lib-libXt-devel
128 BuildRequires: xorg-lib-libXtst-devel
129 %{?with_system_yasm:BuildRequires: yasm}
130 %{?with_system_zlib:BuildRequires: zlib-devel}
131 Requires: browser-plugins >= 2.0
132 Requires: desktop-file-utils
133 %{?with_system_vpx:Requires: libvpx >= 0.9.5-2}
134 Requires: xdg-utils >= 1.0.2-4
136 Obsoletes: chromium-browser-bookmark_manager < 5.0.388.0
137 Obsoletes: chromium-browser-inspector < 15.0.863.0
138 ExclusiveArch: %{ix86} %{x8664} arm
139 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
141 %define find_lang sh find-lang.sh %{buildroot}
142 # Usage: gyp_with BCOND_NAME [OPTION_NAME]
143 %define gyp_with() %{expand:%%{?with_%{1}:-D%{?2:use_%{2}}%{!?2:use_%{1}}=1}%%{!?with_%{1}:-D%{?2:use_%{2}}%{!?2:use_%{1}}=0}}
145 %if %{without debuginfo}
146 %define _enable_debug_packages 0
149 # undefine if empty, makes prep simplier
150 %if "%{svndate}" == "%{nil}"
155 Chromium is an open-source browser project that aims to build a safer,
156 faster, and more stable way for all Internet users to experience the
159 Chromium serves as a base for Google Chrome, which is Chromium
160 rebranded (name and logo) with very few additions such as usage
161 tracking and an auto-updater system.
164 Summary: chromium-browser language packages
166 Requires: %{name} = %{version}-%{release}
169 Chromium is an open-source browser project that aims to build a safer,
170 faster, and more stable way for all Internet users to experience the
173 This package contains language packages for 50 languages:
175 ar, bg, bn, ca, cs, da, de, el, en-GB, es-LA, es, et, fi, fil, fr, gu,
176 he, hi, hr, hu, id, it, ja, kn, ko, lt, lv, ml, mr, nb, nl, or, pl,
177 pt-BR, pt-PT, ro, ru, sk, sl, sr, sv, ta, te, th, tr, uk, vi, zh-CN,
181 %setup -q -n %{name}-%{version}~%{?svndate:svn%{svndate}}r%{svnver}
182 SRC=%{name}-%{version}~%{?svndate:svn%{svndate}}r%{svnver}-source.tar.*
186 # Google's versioning is interesting. They never reset "BUILD", which is how we jumped
187 # from 3.0.201.0 to 4.0.202.0 as they moved to a new major branch
188 . ./src/chrome/VERSION
189 ver=$MAJOR.$MINOR.$BUILD.$PATCH
190 test "$ver" = %{version}
192 gyp_rev=$(grep googlecode_url.*gyp src/DEPS | cut -d'"' -f6 | cut -d@ -f2)
193 test "$gyp_rev" = %{gyp_rev} || :
195 # Populate the LASTCHANGE file template as we no longer have the VCS files at this point
196 echo "%{svnver}" > src/build/LASTCHANGE.in
198 # add chromium and pld to useragent
199 %define pld_version %(echo %{pld_release} | sed -e 'y/[at]/[AT]/')
200 sed -e 's/@BUILD_DIST@/PLD %{pld_version}/g' \
201 -e 's/@BUILD_DIST_NAME@/PLD/g' \
202 -e 's/@BUILD_DIST_VERSION@/%{pld_version}/g' \
203 < %{PATCH8} | %{__patch} -p1
205 %{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE4} > find-lang.sh
215 # drop bundled libs, from gentoo
216 remove_bundled_lib() {
217 echo "Removing bundled library $1 ..."
219 out=$(find $1 -mindepth 1 ! -iname '*.gyp' -print -delete)
220 if [ -z "$out" ]; then
221 echo >&2 "No files matched when removing bundled library $1"
227 remove_bundled_lib "third_party/bzip2"
228 remove_bundled_lib "third_party/icu"
229 remove_bundled_lib "third_party/libevent"
230 remove_bundled_lib "third_party/libjpeg"
231 remove_bundled_lib "third_party/libpng"
232 # third_party/libvpx/libvpx.h should be kept
233 #remove_bundled_lib "third_party/libvpx"
234 remove_bundled_lib "third_party/libxml"
235 remove_bundled_lib "third_party/libxslt"
236 remove_bundled_lib "third_party/zlib"
237 # 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.
238 #remove_bundled_lib "third_party/yasm"
240 %if %{with system_v8}
242 find v8 -type f \! -iname '*.gyp*' -delete
244 # The implementation files include v8 headers with full path,
245 # like #include "v8/include/v8.h". Make sure the system headers
248 ln -s %{_includedir} v8/include
253 %{__python} build/gyp_chromium --format=make build/all.gyp \
260 %if "%{cc_version}" >= "4.4.0" && "%{cc_version}" < "4.5.0"
261 -Dno_strict_aliasing=1 -Dgcc_version=44 \
263 %if %{with sandboxing}
264 -Dlinux_sandbox_path=%{_libdir}/%{name}/chromium-sandbox \
265 -Dlinux_sandbox_chrome_path=%{_libdir}/%{name}/%{name} \
267 %{!?debug:-Dwerror=} \
268 %{!?debuginfo:-Dfastbuild=1} \
269 %{?with_shared_libs:-Dlibrary=shared_library} \
270 -Dbuild_ffmpegsumo=%{?with_ffmpegsumo:1}%{!?with_ffmpegsumo:0} \
271 -Dffmpeg_branding=Chrome \
272 -Dproprietary_codecs=1 \
273 %{!?with_nacl:-Ddisable_nacl=1} \
274 %{!?with_sse2:-Ddisable_sse2=1} \
275 %{?with_selinux:-Dselinux=1} \
279 %{gyp_with kerberos} -Dlinux_link_kerberos=0 \
280 %{gyp_with keyring gnome_keyring} -Dlinux_link_gnome_keyring=0 \
281 %{gyp_with pulseaudio} \
282 %{gyp_with system_speex} \
283 %{gyp_with system_sqlite} \
284 %{gyp_with system_v8} \
285 %{gyp_with system_vpx} \
286 %{gyp_with system_yasm} \
287 %{gyp_with system_zlib} \
288 -Duse_system_bzip2=1 \
290 -Duse_system_libevent=1 \
291 -Duse_system_libjpeg=1 \
292 -Duse_system_libpng=1 \
293 -Duse_system_libxml=1 \
294 -Duse_system_libxslt=1 \
295 -Duse_system_xdg_utils=1 \
297 %{__make} chrome %{?with_sandboxing:chrome_sandbox} \
298 BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
299 %{?with_verbose:V=1} \
303 CXX.host="%{__cxx}" \
304 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
305 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}"
308 rm -rf $RPM_BUILD_ROOT
309 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/{themes,locales,plugins,extensions,resources},%{_mandir}/man1,%{_pixmapsdir},%{_desktopdir}}
311 cd src/out/%{!?debug:Release}%{?debug:Debug}
312 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
313 %{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
314 cp -a *.pak locales resources $RPM_BUILD_ROOT%{_libdir}/%{name}
315 cp -p chrome.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
316 install -p chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name}
317 install -p chrome_sandbox $RPM_BUILD_ROOT%{_libdir}/%{name}/chromium-sandbox
318 %if %{with ffmpegsumo}
319 install -p libffmpegsumo.so $RPM_BUILD_ROOT%{_libdir}/%{name}
321 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}
324 cp -p src/chrome/app/theme/chromium/product_logo_48.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
326 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins -b <<'EOF'
327 # http://code.google.com/p/chromium/issues/detail?id=24507
328 gecko-mediaplayer*.so
332 %find_lang %{name}.lang
333 # always package en-US
334 %{__sed} -i -e '/en-US.pak/d' %{name}.lang
337 rm -rf $RPM_BUILD_ROOT
340 %update_desktop_database
341 %update_browser_plugins
344 if [ "$1" = 0 ]; then
345 %update_browser_plugins
348 %files -f %{name}.lang
349 %defattr(644,root,root,755)
350 %{_browserpluginsconfdir}/browsers.d/%{name}.*
351 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
352 %attr(755,root,root) %{_bindir}/%{name}
353 %{_mandir}/man1/%{name}.1*
354 %{_pixmapsdir}/%{name}.png
355 %{_desktopdir}/*.desktop
356 %dir %{_libdir}/%{name}
357 %{_libdir}/%{name}/chrome.pak
358 %{_libdir}/%{name}/resources.pak
359 %dir %{_libdir}/%{name}/locales
360 %{_libdir}/%{name}/locales/en-US.pak
361 %dir %{_libdir}/%{name}/resources
362 %{_libdir}/%{name}/resources/inspector
363 %dir %{_libdir}/%{name}/themes
364 %dir %{_libdir}/%{name}/extensions
365 %dir %{_libdir}/%{name}/plugins
366 %attr(755,root,root) %{_libdir}/%{name}/%{name}
367 # These unique permissions are intentional and necessary for the sandboxing
368 %attr(4555,root,root) %{_libdir}/%{name}/chromium-sandbox
371 %if %{with ffmpegsumo}
372 %attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so
375 %files l10n -f %{name}.lang
376 %defattr(644,root,root,755)