3 %bcond_with verbose # verbose build (V=1)
4 %bcond_with selinux # with SELinux (need policy first)
5 %bcond_with shared_libs # with shared libs
6 %bcond_with sse2 # use SSE2 instructions
7 %bcond_with system_sqlite # with system sqlite
8 %bcond_with system_v8 # with system v8
9 %bcond_without ffmpegsumo # build with ffmpegsumo
10 %bcond_without sandboxing # with sandboxing
11 %bcond_without system_zlib # with system zlib
12 %bcond_without debuginfo # disable debuginfo creation (it is huge)
15 # - check system sqlite linking problems
18 # - mute BEEP mixer if you do not want to hear horrible system bell when
19 # pressing home/end in url bar or more ^F search results on page.
20 # - build i686: -bp: ~570MB; bc: ~928MB; -bb: ~1.0GB
21 # - build x86_64: -bp: ~570MB; bc: ~990MB; -bb: ~1.0GB
22 # - http://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites
23 # - to look for new tarball, use update-source.sh script
26 # To use chromium nightly builds for pld-th save to /etc/poldek/repos.d (as chromium-nightly.conf):
27 # http://carme.pld-linux.org/~glen/chromium-browser/th/i686/chromium-nightly.conf
29 # http://carme.pld-linux.org/~glen/chromium-browser/th/x86_64/chromium-nightly.conf
31 %define svndate 20110304
35 Summary: A WebKit powered web browser
36 Name: chromium-browser
38 Release: 0.%{svnver}.%{rel}
39 License: BSD, LGPL v2+ (ffmpeg)
40 Group: X11/Applications/Networking
41 Source0: http://ppa.launchpad.net/chromium-daily/ppa/ubuntu/pool/main/c/chromium-browser/%{name}_%{version}~svn%{svndate}r%{svnver}.orig.tar.gz
42 # Source0-md5: 62de113711d3d9ac7b678d407bee4da8
44 Source3: %{name}.desktop
46 Source5: update-source.sh
47 Patch0: system-libs.patch
48 Patch1: plugin-searchdirs.patch
49 Patch2: gyp-system-minizip.patch
50 Patch3: disable_dlog_and_dcheck_in_release_builds.patch
51 # http://aur.archlinux.org/packages/chromium-browser-svn/chromium-browser-svn/search-workaround.patch
52 Patch4: search-workaround.patch
53 Patch5: options-support.patch
54 Patch6: get-webkit_revision.patch
55 Patch7: dlopen_sonamed_gl.patch
56 Patch8: chromium_useragent.patch.in
57 URL: http://code.google.com/chromium/
58 BuildRequires: GConf2-devel
59 BuildRequires: OpenGL-GLU-devel
60 BuildRequires: alsa-lib-devel
61 BuildRequires: atk-devel
63 BuildRequires: bzip2-devel
64 BuildRequires: cups-devel
65 BuildRequires: dbus-glib-devel
67 BuildRequires: fontconfig-devel
68 BuildRequires: glib2-devel
70 BuildRequires: gtk+2-devel
71 BuildRequires: libevent-devel
72 BuildRequires: libgnome-keyring-devel
73 BuildRequires: libjpeg-devel
74 BuildRequires: libpng-devel
75 %{?with_selinux:BuildRequires: libselinux-devel}
76 BuildRequires: libstdc++-devel
77 BuildRequires: libvpx-devel >= 0.9.5-2
78 BuildRequires: libxml2-devel
79 BuildRequires: libxslt-devel
81 BuildRequires: minizip-devel
82 BuildRequires: nspr-devel
83 BuildRequires: nss-devel >= 1:3.12.3
84 BuildRequires: pam-devel
85 BuildRequires: pango-devel
86 BuildRequires: perl-modules
87 BuildRequires: pkgconfig
89 BuildRequires: rpm >= 4.4.9-56
90 # grep googlecode_url.*gyp src/DEPS |cut -d'"' -f6 | cut -d@ -f2
91 BuildRequires: python-gyp >= 1-840
92 BuildRequires: python-modules
93 BuildRequires: rpmbuild(macros) >= 1.453
94 BuildRequires: sqlite3-devel >= 3.6.1
95 BuildRequires: util-linux
96 %{?with_system_v8:BuildRequires: v8-devel}
98 BuildRequires: xorg-lib-libXScrnSaver-devel
99 BuildRequires: xorg-lib-libXt-devel
100 BuildRequires: xorg-lib-libXtst-devel
102 %{?with_system_zlib:BuildRequires: zlib-devel}
103 Requires: browser-plugins >= 2.0
104 Requires: libvpx >= 0.9.5-2
105 Requires: xdg-utils >= 1.0.2-4
107 Obsoletes: chromium-browser-bookmark_manager
108 ExclusiveArch: %{ix86} %{x8664} arm
109 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
111 %define find_lang sh find-lang.sh %{buildroot}
113 %if %{without debuginfo}
114 %define _enable_debug_packages 0
118 Chromium is an open-source browser project that aims to build a safer,
119 faster, and more stable way for all Internet users to experience the
122 Chromium serves as a base for Google Chrome, which is Chromium
123 rebranded (name and logo) with very few additions such as usage
124 tracking and an auto-updater system.
127 Summary: Page inspector for the chromium-browser
128 Group: Development/Tools
129 Requires: %{name} = %{version}-%{release}
131 %description inspector
132 Chromium is an open-source browser project that aims to build a safer,
133 faster, and more stable way for all Internet users to experience the
136 This package contains 'inspector', allowing web developpers to inspect
137 any element of a web page at runtime (html, javascript, css, ..)
140 Summary: chromium-browser language packages
142 Requires: %{name} = %{version}-%{release}
145 Chromium is an open-source browser project that aims to build a safer,
146 faster, and more stable way for all Internet users to experience the
149 This package contains language packages for 50 languages:
151 ar, bg, bn, ca, cs, da, de, el, en-GB, es-419, es, et, fi, fil, fr,
152 gu, he, hi, hr, hu, id, it, ja, kn, ko, lt, lv, ml, mr, nb, nl, or,
153 pl, pt-BR, pt-PT, ro, ru, sk, sl, sr, sv, ta, te, th, tr, uk, vi,
157 %setup -q -n %{name}-%{version}~svn%{svndate}r%{svnver}
158 lzma -dc %{name}-%{version}~svn%{svndate}r%{svnver}-source.tar.lzma | tar x
159 rm -f %{name}-%{version}~svn%{svndate}r%{svnver}-source.tar.lzma
161 # Google's versioning is interesting. They never reset "BUILD", which is how we jumped
162 # from 3.0.201.0 to 4.0.202.0 as they moved to a new major branch
163 . ./src/chrome/VERSION
164 ver=$MAJOR.$MINOR.$BUILD.$PATCH
165 if [ "$ver" != %{version} ]; then
169 # Populate the LASTCHANGE file template as we no longer have the VCS files at this point
170 echo "%{svnver}" > src/build/LASTCHANGE.in
172 # add chromium and pld to useragent
173 %define pld_version %(echo %{pld_release} | sed -e 'y/[at]/[AT]/')
174 sed -e 's/@BUILD_DIST@/PLD %{pld_version}/g' \
175 -e 's/@BUILD_DIST_NAME@/PLD/g' \
176 -e 's/@BUILD_DIST_VERSION@/%{pld_version}/g' \
177 < %{PATCH8} | %{__patch} -p1
179 %{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE4} > find-lang.sh
190 # drop bundled libs, from gentoo
191 remove_bundled_lib() {
192 echo "Removing bundled library $1 ..."
194 out=$(find $1 -mindepth 1 ! -iname '*.gyp' -print -delete)
195 if [ -z "$out" ]; then
196 echo >&2 "No files matched when removing bundled library $1"
202 remove_bundled_lib "third_party/bzip2"
203 remove_bundled_lib "third_party/libevent"
204 remove_bundled_lib "third_party/libjpeg"
205 remove_bundled_lib "third_party/libpng"
206 # third_party/libvpx/libvpx.h should be kept
207 #remove_bundled_lib "third_party/libvpx"
208 remove_bundled_lib "third_party/libxml"
209 remove_bundled_lib "third_party/libxslt"
210 remove_bundled_lib "third_party/zlib"
214 %{__python} build/gyp_chromium --format=make build/all.gyp \
221 %if "%{cc_version}" >= "4.4.0" && "%{cc_version}" < "4.5.0"
222 -Dno_strict_aliasing=1 -Dgcc_version=44 \
224 %if %{with sandboxing}
225 -Dlinux_sandbox_path=%{_libdir}/%{name}/chromium-sandbox \
226 -Dlinux_sandbox_chrome_path=%{_libdir}/%{name}/%{name} \
228 %{!?debug:-Dwerror=} \
229 %{!?debuginfo:-Dfastbuild=1} \
230 %{?with_shared_libs:-Dlibrary=shared_library} \
231 -Djavascript_engine=%{?with_system_v8:system-v8}%{!?with_system_v8:v8} \
232 -Dbuild_ffmpegsumo=%{?with_ffmpegsumo:1}%{!?with_ffmpegsumo:0} \
233 -Duse_system_bzip2=1 \
234 -Duse_system_libevent=1 \
235 -Duse_system_libjpeg=1 \
236 -Duse_system_libpng=1 \
237 -Duse_system_libxml=1 \
238 -Duse_system_libxslt=1 \
239 -Duse_system_sqlite=%{?with_system_sqlite:1}%{!?with_system_sqlite:0} \
240 -Duse_system_zlib=%{?with_system_zlib:1}%{!?with_system_zlib:0} \
242 -Duse_system_yasm=1 \
243 -Dffmpeg_branding=Chrome \
244 -Dproprietary_codecs=1 \
245 %{!?with_sse2:-Ddisable_sse2=1} \
250 %{__make} chrome %{?with_sandboxing:chrome_sandbox} \
251 BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
252 %{?with_verbose:V=1} \
256 CXX.host="%{__cxx}" \
257 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
258 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}"
261 rm -rf $RPM_BUILD_ROOT
262 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/{themes,locales,plugins,extensions,resources},%{_mandir}/man1,%{_pixmapsdir},%{_desktopdir}}
264 cd src/out/%{!?debug:Release}%{?debug:Debug}
266 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
267 %{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
268 cp -a *.pak locales resources $RPM_BUILD_ROOT%{_libdir}/%{name}
269 cp -a chrome.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
270 cp -a product_logo_48.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
271 install -p chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name}
272 install -p chrome_sandbox $RPM_BUILD_ROOT%{_libdir}/%{name}/chromium-sandbox
273 %if %{with ffmpegsumo}
274 install -p libffmpegsumo.so $RPM_BUILD_ROOT%{_libdir}/%{name}
276 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}
279 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins -b <<'EOF'
280 # http://code.google.com/p/chromium/issues/detail?id=24507
281 gecko-mediaplayer*.so
285 %find_lang %{name}.lang
286 %{__sed} -i -e '/en-US.pak/d' %{name}.lang
289 rm -rf $RPM_BUILD_ROOT
292 %update_browser_plugins
295 if [ "$1" = 0 ]; then
296 %update_browser_plugins
299 %files -f %{name}.lang
300 %defattr(644,root,root,755)
301 %{_browserpluginsconfdir}/browsers.d/%{name}.*
302 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
303 %attr(755,root,root) %{_bindir}/%{name}
304 %{_mandir}/man1/%{name}.1*
305 %{_pixmapsdir}/%{name}.png
306 %{_desktopdir}/*.desktop
307 %dir %{_libdir}/%{name}
308 %{_libdir}/%{name}/chrome.pak
309 %{_libdir}/%{name}/resources.pak
310 %dir %{_libdir}/%{name}/locales
311 %{_libdir}/%{name}/locales/en-US.pak
312 %dir %{_libdir}/%{name}/resources
313 %dir %{_libdir}/%{name}/themes
314 %dir %{_libdir}/%{name}/extensions
315 %dir %{_libdir}/%{name}/plugins
316 %attr(755,root,root) %{_libdir}/%{name}/%{name}
317 # These unique permissions are intentional and necessary for the sandboxing
318 %attr(4555,root,root) %{_libdir}/%{name}/chromium-sandbox
321 %if %{with ffmpegsumo}
322 %attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so
326 %defattr(644,root,root,755)
327 %{_libdir}/%{name}/resources/inspector
329 %files l10n -f %{name}.lang
330 %defattr(644,root,root,755)