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 %{nil}
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: http://carme.pld-linux.org/~glen/chromium-browser/src/beta/%{name}_%{version}~r%{svnver}.orig.tar.gz
63 # Source0-md5: c9013564af4f1f9dbeb40737830adb9f
65 Source3: %{name}.desktop
67 Source5: update-source.sh
68 Patch0: system-libs.patch
69 Patch1: plugin-searchdirs.patch
70 Patch2: gyp-system-minizip.patch
71 Patch3: disable_dlog_and_dcheck_in_release_builds.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 URL: http://www.chromium.org/Home
77 BuildRequires: GConf2-devel
78 BuildRequires: OpenGL-GLU-devel
79 BuildRequires: alsa-lib-devel
80 BuildRequires: atk-devel
82 BuildRequires: bzip2-devel
83 BuildRequires: cups-devel
84 BuildRequires: dbus-glib-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 BuildRequires: libvpx-devel >= 0.9.5-2
99 BuildRequires: libxml2-devel
100 BuildRequires: libxslt-devel
102 BuildRequires: minizip-devel
103 BuildRequires: nspr-devel
104 BuildRequires: nss-devel >= 1:3.12.3
105 BuildRequires: pam-devel
106 BuildRequires: pango-devel
107 BuildRequires: perl-modules
108 BuildRequires: pkgconfig
109 BuildRequires: pulseaudio-devel
110 BuildRequires: python
111 #BuildRequires: python-gyp >= 1-%{gyp_rev}
112 BuildRequires: python-modules
113 BuildRequires: rpm >= 4.4.9-56
114 BuildRequires: rpmbuild(macros) >= 1.453
115 %{?with_system_speex:BuildRequires: speex-devel >= 1:1.2-rc1}
116 BuildRequires: sqlite3-devel >= 3.6.1
117 BuildRequires: tar >= 1:1.22
118 BuildRequires: util-linux
119 %{?with_system_v8:BuildRequires: v8-devel}
121 BuildRequires: xorg-lib-libXScrnSaver-devel
122 BuildRequires: xorg-lib-libXt-devel
123 BuildRequires: xorg-lib-libXtst-devel
124 %{?with_system_yasm:BuildRequires: yasm}
125 %{?with_system_zlib:BuildRequires: zlib-devel}
126 Requires: browser-plugins >= 2.0
127 Requires: desktop-file-utils
128 Requires: libvpx >= 0.9.5-2
129 Requires: xdg-utils >= 1.0.2-4
131 Obsoletes: chromium-browser-bookmark_manager < 5.0.388.0
132 Obsoletes: chromium-browser-inspector < 15.0.863.0
133 ExclusiveArch: %{ix86} %{x8664} arm
134 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
136 %define find_lang sh find-lang.sh %{buildroot}
138 %if %{without debuginfo}
139 %define _enable_debug_packages 0
142 # undefine if empty, makes prep simplier
143 %if "%{svndate}" == "%{nil}"
148 Chromium is an open-source browser project that aims to build a safer,
149 faster, and more stable way for all Internet users to experience the
152 Chromium serves as a base for Google Chrome, which is Chromium
153 rebranded (name and logo) with very few additions such as usage
154 tracking and an auto-updater system.
157 Summary: chromium-browser language packages
159 Requires: %{name} = %{version}-%{release}
162 Chromium is an open-source browser project that aims to build a safer,
163 faster, and more stable way for all Internet users to experience the
166 This package contains language packages for 50 languages:
168 ar, bg, bn, ca, cs, da, de, el, en-GB, es-419, es, et, fi, fil, fr,
169 gu, he, hi, hr, hu, id, it, ja, kn, ko, lt, lv, ml, mr, nb, nl, or,
170 pl, pt-BR, pt-PT, ro, ru, sk, sl, sr, sv, ta, te, th, tr, uk, vi,
174 # chromium-browser-15.0.874.83~svnr104223
175 %setup -q -n %{name}-%{version}~%{?svndate:svn%{svndate}}r%{svnver}
176 SRC=%{name}-%{version}~%{?svndate:svn%{svndate}}r%{svnver}-source.tar.*
180 # Google's versioning is interesting. They never reset "BUILD", which is how we jumped
181 # from 3.0.201.0 to 4.0.202.0 as they moved to a new major branch
182 . ./src/chrome/VERSION
183 ver=$MAJOR.$MINOR.$BUILD.$PATCH
184 test "$ver" = %{version}
186 gyp_rev=$(grep googlecode_url.*gyp src/DEPS | cut -d'"' -f6 | cut -d@ -f2)
187 #test "$gyp_rev" = %{gyp_rev}
189 # Populate the LASTCHANGE file template as we no longer have the VCS files at this point
190 echo "%{svnver}" > src/build/LASTCHANGE.in
192 # add chromium and pld to useragent
193 %define pld_version %(echo %{pld_release} | sed -e 'y/[at]/[AT]/')
194 sed -e 's/@BUILD_DIST@/PLD %{pld_version}/g' \
195 -e 's/@BUILD_DIST_NAME@/PLD/g' \
196 -e 's/@BUILD_DIST_VERSION@/%{pld_version}/g' \
197 < %{PATCH8} | %{__patch} -p1
199 %{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE4} > find-lang.sh
209 # drop bundled libs, from gentoo
210 remove_bundled_lib() {
211 echo "Removing bundled library $1 ..."
213 out=$(find $1 -mindepth 1 ! -iname '*.gyp' -print -delete)
214 if [ -z "$out" ]; then
215 echo >&2 "No files matched when removing bundled library $1"
221 remove_bundled_lib "third_party/bzip2"
222 remove_bundled_lib "third_party/icu"
223 remove_bundled_lib "third_party/libevent"
224 remove_bundled_lib "third_party/libjpeg"
225 remove_bundled_lib "third_party/libpng"
226 # third_party/libvpx/libvpx.h should be kept
227 #remove_bundled_lib "third_party/libvpx"
228 remove_bundled_lib "third_party/libxml"
229 remove_bundled_lib "third_party/libxslt"
230 remove_bundled_lib "third_party/zlib"
231 # 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.
232 #remove_bundled_lib "third_party/yasm"
236 %{__python} build/gyp_chromium --format=make build/all.gyp \
243 %if "%{cc_version}" >= "4.4.0" && "%{cc_version}" < "4.5.0"
244 -Dno_strict_aliasing=1 -Dgcc_version=44 \
246 %if %{with sandboxing}
247 -Dlinux_sandbox_path=%{_libdir}/%{name}/chromium-sandbox \
248 -Dlinux_sandbox_chrome_path=%{_libdir}/%{name}/%{name} \
250 %{!?debug:-Dwerror=} \
251 %{!?debuginfo:-Dfastbuild=1} \
252 %{?with_shared_libs:-Dlibrary=shared_library} \
253 -Djavascript_engine=%{?with_system_v8:system-v8}%{!?with_system_v8:v8} \
254 -Dbuild_ffmpegsumo=%{?with_ffmpegsumo:1}%{!?with_ffmpegsumo:0} \
255 -Dffmpeg_branding=Chrome \
256 -Dproprietary_codecs=1 \
257 %{!?with_nacl:-Ddisable_nacl=1} \
258 %{!?with_sse2:-Ddisable_sse2=1} \
259 %{?with_selinux:-Dselinux=1} \
260 -Duse_system_bzip2=1 \
262 -Duse_system_libevent=1 \
263 -Duse_system_libjpeg=1 \
264 -Duse_system_libpng=1 \
265 -Duse_system_libxml=1 \
266 -Duse_system_libxslt=1 \
267 -Duse_system_speex=%{?with_system_speex:1}%{!?with_system_speex:0} \
268 -Duse_system_sqlite=%{?with_system_sqlite:1}%{!?with_system_sqlite:0} \
270 -Duse_system_xdg_utils=1 \
271 -Duse_system_yasm=%{?with_system_yasm:1}%{!?with_system_yasm:0} \
272 -Duse_system_zlib=%{?with_system_zlib:1}%{!?with_system_zlib:0} \
274 -Duse_kerberos=1 -Dlinux_link_kerberos=0 \
279 -Duse_gnome_keyring=1 -Dlinux_link_gnome_keyring=0 \
281 -Duse_gnome_keyring=0 \
284 %{__make} chrome %{?with_sandboxing:chrome_sandbox} \
285 BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
286 %{?with_verbose:V=1} \
290 CXX.host="%{__cxx}" \
291 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
292 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}"
295 rm -rf $RPM_BUILD_ROOT
296 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/{themes,locales,plugins,extensions,resources},%{_mandir}/man1,%{_pixmapsdir},%{_desktopdir}}
298 cd src/out/%{!?debug:Release}%{?debug:Debug}
299 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
300 %{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
301 cp -a *.pak locales resources $RPM_BUILD_ROOT%{_libdir}/%{name}
302 cp -p chrome.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
303 install -p chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name}
304 install -p chrome_sandbox $RPM_BUILD_ROOT%{_libdir}/%{name}/chromium-sandbox
305 %if %{with ffmpegsumo}
306 install -p libffmpegsumo.so $RPM_BUILD_ROOT%{_libdir}/%{name}
308 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}
311 cp -p src/chrome/app/theme/chromium/product_logo_48.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
313 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins -b <<'EOF'
314 # http://code.google.com/p/chromium/issues/detail?id=24507
315 gecko-mediaplayer*.so
319 %find_lang %{name}.lang
320 %{__sed} -i -e '/en-US.pak/d' %{name}.lang
323 rm -rf $RPM_BUILD_ROOT
326 %update_desktop_database
327 %update_browser_plugins
330 if [ "$1" = 0 ]; then
331 %update_browser_plugins
334 %files -f %{name}.lang
335 %defattr(644,root,root,755)
336 %{_browserpluginsconfdir}/browsers.d/%{name}.*
337 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
338 %attr(755,root,root) %{_bindir}/%{name}
339 %{_mandir}/man1/%{name}.1*
340 %{_pixmapsdir}/%{name}.png
341 %{_desktopdir}/*.desktop
342 %dir %{_libdir}/%{name}
343 %{_libdir}/%{name}/chrome.pak
344 %{_libdir}/%{name}/resources.pak
345 %dir %{_libdir}/%{name}/locales
346 %{_libdir}/%{name}/locales/en-US.pak
347 %dir %{_libdir}/%{name}/resources
348 %{_libdir}/%{name}/resources/inspector
349 %dir %{_libdir}/%{name}/themes
350 %dir %{_libdir}/%{name}/extensions
351 %dir %{_libdir}/%{name}/plugins
352 %attr(755,root,root) %{_libdir}/%{name}/%{name}
353 # These unique permissions are intentional and necessary for the sandboxing
354 %attr(4555,root,root) %{_libdir}/%{name}/chromium-sandbox
357 %if %{with ffmpegsumo}
358 %attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so
361 %files l10n -f %{name}.lang
362 %defattr(644,root,root,755)