]> git.pld-linux.org Git - packages/chromium-browser.git/blame - chromium-browser.spec
- use system expat
[packages/chromium-browser.git] / chromium-browser.spec
CommitLineData
0c480b89
ER
1#
2# Conditional build:
2108baf2
ER
3%bcond_without debuginfo # disable debuginfo creation (it is huge)
4%bcond_without ffmpegsumo # build with ffmpegsumo
8171fe68 5%bcond_without kerberos # build with kerberos support (dlopened if support compiled, library names in src/net/http/http_auth_gssapi_posix.cc)
2108baf2 6%bcond_without keyring # with keyring support (gnome-keyring dlopened, kwalletd via dbus)
ae3fe89f
ER
7%bcond_without cups # with cups
8%bcond_without gconf # with GConf
9%bcond_without pulseaudio # with pulseaudio
a3140cd1 10%bcond_with nacl # build Native Client support
2108baf2
ER
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
32a2443e 16%bcond_without system_flac # with system flac
e8e15592 17%bcond_without system_libwebp # with system libwebp
32a2443e 18%bcond_without system_speex # with system speex
bf00cc26 19%bcond_without system_v8 # with system v8
32a2443e 20%bcond_without system_vpx # with system vpx
d617ab39 21%bcond_without system_yasm # with system yasm
2108baf2
ER
22%bcond_without system_zlib # with system zlib
23%bcond_with verbose # verbose build (V=1)
0c480b89 24
6d92f81c 25# TODO
f1b276d4 26# - check system sqlite linking problems
2108baf2 27# - find system deps: find -name '*.gyp*' | xargs grep 'use_system.*=='
a3140cd1 28# - use_system_ssl (use_openssl: http://crbug.com/62803)
32a2443e 29# - use_system_ffmpeg && build_ffmpegsumo
d617ab39 30# - use_system_hunspell
32a2443e 31# - use_system_stlport
a3140cd1
ER
32# - other defaults: src/build/common.gypi
33
e53ecfb5 34# NOTES:
4fe038cb
ER
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.
2108baf2
ER
37# - build -bp: 1.2G
38# - build i686: -bc: 2.7G; -bb: ~1.0GB
e8e15592 39# - build x86_64: ~1.9G
f1b276d4 40# - http://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites
84fa20a9 41# - to look for new tarball, use update-source.sh script
f1b276d4 42
e68aa7e7 43# NOTE TO USERS:
a3cc7091
ER
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
e68aa7e7 46# or:
a3cc7091 47# http://carme.pld-linux.org/~glen/chromium-browser/th/x86_64/chromium-nightly.conf
e68aa7e7 48
0cad051b 49%define svndate %{nil}
7cffe7ae 50%define svnver 112386
a09d5528 51%define rel 1
11ad81c4 52
a3140cd1 53%define gyp_rev 1014
11ad81c4 54Summary: A WebKit powered web browser
05f72ae2 55Name: chromium-browser
7cffe7ae 56Version: 16.0.912.59
cf823a7a 57Release: 0.%{svnver}.%{rel}
05f72ae2 58License: BSD, LGPL v2+ (ffmpeg)
e53ecfb5 59Group: X11/Applications/Networking
0cad051b 60Source0: http://carme.pld-linux.org/~glen/chromium-browser/src/beta/%{name}_%{version}~r%{svnver}.orig.tar.gz
7cffe7ae 61# Source0-md5: 79d7767698b1522ddf5f7cf725e0594f
5e25f560 62#SourceX: http://ppa.launchpad.net/chromium-daily/ppa/ubuntu/pool/main/c/chromium-browser/%{name}_%{version}~svn%{svndate}r%{svnver}.orig.tar.gz
8b53130d
ER
63Source2: %{name}.sh
64Source3: %{name}.desktop
589d90ea 65Source4: find-lang.sh
fe043a0f 66Source5: update-source.sh
48b341f5 67Patch0: system-libs.patch
68Patch1: plugin-searchdirs.patch
69Patch2: gyp-system-minizip.patch
7abc645c 70Patch3: disable_dlog_and_dcheck_in_release_builds.patch
48b341f5 71Patch5: options-support.patch
0e5636cb 72Patch6: get-webkit_revision.patch
5aa5df39 73Patch7: dlopen_sonamed_gl.patch
4765ddf1 74Patch8: chromium_useragent.patch.in
77f32fa3 75Patch9: system-expat.patch
750b48f7 76URL: http://www.chromium.org/Home
ae3fe89f 77%{?with_gconf:BuildRequires: GConf2-devel}
f1b276d4 78BuildRequires: OpenGL-GLU-devel
05f72ae2
ER
79BuildRequires: alsa-lib-devel
80BuildRequires: atk-devel
81BuildRequires: bison
11ad81c4 82BuildRequires: bzip2-devel
ae3fe89f 83%{?with_cups:BuildRequires: cups-devel}
2bc5cf47 84BuildRequires: dbus-glib-devel
77f32fa3 85BuildRequires: expat-devel
d617ab39 86%{?with_system_flac:BuildRequires: flac-devel}
11ad81c4 87BuildRequires: flex
11ad81c4 88BuildRequires: fontconfig-devel
f1b276d4 89BuildRequires: glib2-devel
05f72ae2 90BuildRequires: gperf
8b53130d 91BuildRequires: gtk+2-devel
a3140cd1 92%{?with_kerberos:BuildRequires: heimdal-devel}
05f72ae2 93BuildRequires: libevent-devel
7f40f3f4 94%{?with_keyring:BuildRequires: libgnome-keyring-devel}
0b214002 95BuildRequires: libicu-devel >= 4.6
05f72ae2
ER
96BuildRequires: libjpeg-devel
97BuildRequires: libpng-devel
e266589e 98%{?with_selinux:BuildRequires: libselinux-devel}
05f72ae2 99BuildRequires: libstdc++-devel
32a2443e 100%{?with_system_vpx:BuildRequires: libvpx-devel >= 0.9.5-2}
e8e15592 101%{?with_system_libwebp:BuildRequires: libwebp-devel}
f1b276d4 102BuildRequires: libxml2-devel
11ad81c4 103BuildRequires: libxslt-devel
f1b276d4 104BuildRequires: lzma
11ad81c4 105BuildRequires: minizip-devel
164020eb 106%{?with_nacl:BuildRequires: nacl-toolchain-newlib >= 0.6941}
05f72ae2 107BuildRequires: nspr-devel
f1b276d4 108BuildRequires: nss-devel >= 1:3.12.3
35902862 109BuildRequires: pam-devel
f1b276d4 110BuildRequires: pango-devel
48b341f5 111BuildRequires: perl-modules
112BuildRequires: pkgconfig
ae3fe89f 113%{?with_pulseaudio:BuildRequires: pulseaudio-devel}
f1b276d4 114BuildRequires: python
46cdefee 115#BuildRequires: python-gyp >= 1-%{gyp_rev}
48b341f5 116BuildRequires: python-modules
0cad051b 117BuildRequires: rpm >= 4.4.9-56
f1b276d4 118BuildRequires: rpmbuild(macros) >= 1.453
0cad051b 119%{?with_system_speex:BuildRequires: speex-devel >= 1:1.2-rc1}
f1b276d4 120BuildRequires: sqlite3-devel >= 3.6.1
0cad051b 121BuildRequires: tar >= 1:1.22
2303ed45 122BuildRequires: util-linux
9c06a87f 123%{?with_system_v8:BuildRequires: v8-devel >= 3.6}
0826c245 124BuildRequires: which
f1b276d4 125BuildRequires: xorg-lib-libXScrnSaver-devel
2bc5cf47
KK
126BuildRequires: xorg-lib-libXt-devel
127BuildRequires: xorg-lib-libXtst-devel
a3140cd1 128%{?with_system_yasm:BuildRequires: yasm}
f1b276d4 129%{?with_system_zlib:BuildRequires: zlib-devel}
e53ecfb5 130Requires: browser-plugins >= 2.0
0cad051b 131Requires: desktop-file-utils
32a2443e 132%{?with_system_vpx:Requires: libvpx >= 0.9.5-2}
4dc49133 133Requires: xdg-utils >= 1.0.2-4
e53ecfb5 134Provides: wwwbrowser
c3582150 135Obsoletes: chromium-browser-bookmark_manager < 5.0.388.0
a3140cd1 136Obsoletes: chromium-browser-inspector < 15.0.863.0
2351db3b 137ExclusiveArch: %{ix86} %{x8664} arm
11ad81c4 138BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
11ad81c4 139
589d90ea 140%define find_lang sh find-lang.sh %{buildroot}
e7fa0817
ER
141# Usage: gyp_with BCOND_NAME [OPTION_NAME]
142%define gyp_with() %{expand:%%{?with_%{1}:-D%{?2:use_%{2}}%{!?2:use_%{1}}=1}%%{!?with_%{1}:-D%{?2:use_%{2}}%{!?2:use_%{1}}=0}}
589d90ea 143
6b113615
ER
144%if %{without debuginfo}
145%define _enable_debug_packages 0
146%endif
147
0cad051b
ER
148# undefine if empty, makes prep simplier
149%if "%{svndate}" == "%{nil}"
150%undefine svndate
151%endif
152
11ad81c4 153%description
80838854
ER
154Chromium is an open-source browser project that aims to build a safer,
155faster, and more stable way for all Internet users to experience the
156web.
157
158Chromium serves as a base for Google Chrome, which is Chromium
159rebranded (name and logo) with very few additions such as usage
160tracking and an auto-updater system.
161
f1b276d4
ER
162%package l10n
163Summary: chromium-browser language packages
164Group: I18n
165Requires: %{name} = %{version}-%{release}
166
167%description l10n
168Chromium is an open-source browser project that aims to build a safer,
169faster, and more stable way for all Internet users to experience the
170web.
171
172This package contains language packages for 50 languages:
173
e7fa0817
ER
174ar, bg, bn, ca, cs, da, de, el, en-GB, es-LA, es, et, fi, fil, fr, gu,
175he, hi, hr, hu, id, it, ja, kn, ko, lt, lv, ml, mr, nb, nl, or, pl,
176pt-BR, pt-PT, ro, ru, sk, sl, sr, sv, ta, te, th, tr, uk, vi, zh-CN,
177zh-TW
f1b276d4
ER
178
179%prep
0cad051b
ER
180%setup -q -n %{name}-%{version}~%{?svndate:svn%{svndate}}r%{svnver}
181SRC=%{name}-%{version}~%{?svndate:svn%{svndate}}r%{svnver}-source.tar.*
182tar xf $SRC
183%{__rm} $SRC
589d90ea 184
05f72ae2
ER
185# Google's versioning is interesting. They never reset "BUILD", which is how we jumped
186# from 3.0.201.0 to 4.0.202.0 as they moved to a new major branch
0c480b89
ER
187. ./src/chrome/VERSION
188ver=$MAJOR.$MINOR.$BUILD.$PATCH
a3140cd1
ER
189test "$ver" = %{version}
190
191gyp_rev=$(grep googlecode_url.*gyp src/DEPS | cut -d'"' -f6 | cut -d@ -f2)
2d2c8139 192test "$gyp_rev" = %{gyp_rev} || :
05f72ae2 193
f1b276d4
ER
194# Populate the LASTCHANGE file template as we no longer have the VCS files at this point
195echo "%{svnver}" > src/build/LASTCHANGE.in
196
4765ddf1
ER
197# add chromium and pld to useragent
198%define pld_version %(echo %{pld_release} | sed -e 'y/[at]/[AT]/')
199sed -e 's/@BUILD_DIST@/PLD %{pld_version}/g' \
200 -e 's/@BUILD_DIST_NAME@/PLD/g' \
201 -e 's/@BUILD_DIST_VERSION@/%{pld_version}/g' \
74a58b60 202 < %{PATCH8} | %{__patch} -p1
4765ddf1 203
2bc5cf47 204%{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE4} > find-lang.sh
f1b276d4 205
05f72ae2
ER
206%patch0 -p1
207%patch1 -p1
208%patch2 -p1
7abc645c 209%patch3 -p1
05f72ae2 210%patch5 -p1
0e5636cb 211%patch6 -p1
5aa5df39 212%patch7 -p1
77f32fa3
ER
213cd src
214%patch9 -p1
215cd ..
0c480b89 216
828bdd1a
AM
217# drop bundled libs, from gentoo
218remove_bundled_lib() {
97fac491
ER
219 echo "Removing bundled library $1 ..."
220 local out
221 out=$(find $1 -mindepth 1 ! -iname '*.gyp' -print -delete)
222 if [ -z "$out" ]; then
223 echo >&2 "No files matched when removing bundled library $1"
224 exit 1
225 fi
828bdd1a
AM
226}
227
228cd src
77f32fa3 229rm -v third_party/expat/files/lib/expat.h
828bdd1a 230remove_bundled_lib "third_party/bzip2"
0b214002 231remove_bundled_lib "third_party/icu"
828bdd1a
AM
232remove_bundled_lib "third_party/libevent"
233remove_bundled_lib "third_party/libjpeg"
234remove_bundled_lib "third_party/libpng"
181b99e0
ER
235# third_party/libvpx/libvpx.h should be kept
236#remove_bundled_lib "third_party/libvpx"
828bdd1a
AM
237remove_bundled_lib "third_party/libxml"
238remove_bundled_lib "third_party/libxslt"
6ff7cc9f 239remove_bundled_lib "third_party/zlib"
a3140cd1
ER
240# 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.
241#remove_bundled_lib "third_party/yasm"
828bdd1a 242
9c06a87f
ER
243%if %{with system_v8}
244# Remove bundled v8.
245find v8 -type f \! -iname '*.gyp*' -delete
246
247# The implementation files include v8 headers with full path,
248# like #include "v8/include/v8.h". Make sure the system headers
249# will be used.
250rmdir v8/include
251ln -s %{_includedir} v8/include
252%endif
253
164020eb
ER
254%if %{with nacl}
255# NOTE: here is always x86_64
256rm -rf native_client/toolchain/linux_x86_newlib
257ln -s %{_prefix}/x86_64-nacl-newlib native_client/toolchain/linux_x86_newlib
258%endif
259
e266589e 260%build
f1b276d4 261cd src
164020eb 262test -e Makefile || %{__python} build/gyp_chromium --format=make build/all.gyp \
f1b276d4
ER
263%ifarch %{ix86}
264 -Dtarget_arch=ia32 \
265%endif
266%ifarch %{x8664}
0c480b89
ER
267 -Dtarget_arch=x64 \
268%endif
7b454a31
AM
269%if "%{cc_version}" >= "4.4.0" && "%{cc_version}" < "4.5.0"
270 -Dno_strict_aliasing=1 -Dgcc_version=44 \
f1b276d4
ER
271%endif
272%if %{with sandboxing}
273 -Dlinux_sandbox_path=%{_libdir}/%{name}/chromium-sandbox \
274 -Dlinux_sandbox_chrome_path=%{_libdir}/%{name}/%{name} \
275%endif
276 %{!?debug:-Dwerror=} \
2303ed45 277 %{!?debuginfo:-Dfastbuild=1} \
f1b276d4 278 %{?with_shared_libs:-Dlibrary=shared_library} \
37b05e5e 279 -Dbuild_ffmpegsumo=%{?with_ffmpegsumo:1}%{!?with_ffmpegsumo:0} \
a3140cd1
ER
280 -Dffmpeg_branding=Chrome \
281 -Dproprietary_codecs=1 \
5a6de706 282 %{!?with_nacl:-Ddisable_nacl=1} \
a3140cd1
ER
283 %{!?with_sse2:-Ddisable_sse2=1} \
284 %{?with_selinux:-Dselinux=1} \
e7fa0817
ER
285 %{gyp_with cups} \
286 %{gyp_with flac} \
287 %{gyp_with gconf} \
288 %{gyp_with kerberos} -Dlinux_link_kerberos=0 \
289 %{gyp_with keyring gnome_keyring} -Dlinux_link_gnome_keyring=0 \
290 %{gyp_with pulseaudio} \
e8e15592 291 %{gyp_with system_libwebp} \
e7fa0817
ER
292 %{gyp_with system_speex} \
293 %{gyp_with system_sqlite} \
294 %{gyp_with system_v8} \
32a2443e 295 %{gyp_with system_vpx} \
e7fa0817
ER
296 %{gyp_with system_yasm} \
297 %{gyp_with system_zlib} \
0c480b89 298 -Duse_system_bzip2=1 \
0b214002 299 -Duse_system_icu=1 \
f1b276d4 300 -Duse_system_libevent=1 \
0c480b89 301 -Duse_system_libjpeg=1 \
f1b276d4
ER
302 -Duse_system_libpng=1 \
303 -Duse_system_libxml=1 \
304 -Duse_system_libxslt=1 \
7f40f3f4 305 -Duse_system_xdg_utils=1 \
11ad81c4 306
f1b276d4
ER
307%{__make} chrome %{?with_sandboxing:chrome_sandbox} \
308 BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
309 %{?with_verbose:V=1} \
310 CC="%{__cc}" \
311 CXX="%{__cxx}" \
312 CC.host="%{__cc}" \
313 CXX.host="%{__cxx}" \
7b454a31
AM
314 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
315 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}"
11ad81c4
AM
316
317%install
318rm -rf $RPM_BUILD_ROOT
f1b276d4 319install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/{themes,locales,plugins,extensions,resources},%{_mandir}/man1,%{_pixmapsdir},%{_desktopdir}}
e266589e 320
f1b276d4 321cd src/out/%{!?debug:Release}%{?debug:Debug}
f1b276d4
ER
322install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
323%{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
97fac491 324cp -a *.pak locales resources $RPM_BUILD_ROOT%{_libdir}/%{name}
7f40f3f4 325cp -p chrome.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
f1b276d4 326install -p chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name}
e53ecfb5 327install -p chrome_sandbox $RPM_BUILD_ROOT%{_libdir}/%{name}/chromium-sandbox
d561483d 328%if %{with ffmpegsumo}
f1b276d4 329install -p libffmpegsumo.so $RPM_BUILD_ROOT%{_libdir}/%{name}
dd46de65 330%endif
e7fa0817 331cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}
164020eb
ER
332
333%if %{with nacl}
334# Install Native Client files on platforms that support it.
335install -p nacl_helper{,_bootstrap} $RPM_BUILD_ROOT%{_libdir}/%{name}
336install -p libppGoogleNaClPluginChrome.so $RPM_BUILD_ROOT%{_libdir}/%{name}
337%ifarch %{x8664}
338install -p nacl_irt_x86_64.nexe $RPM_BUILD_ROOT%{_libdir}/%{name}
339%endif
340%ifarch %{ix86}
341install -p nacl_irt_x86_32.nexe $RPM_BUILD_ROOT%{_libdir}/%{name}
342%endif
343%endif
344
0c480b89
ER
345cd -
346
7f40f3f4
ER
347cp -p src/chrome/app/theme/chromium/product_logo_48.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
348
13840bc2
AM
349%browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins -b <<'EOF'
350# http://code.google.com/p/chromium/issues/detail?id=24507
351gecko-mediaplayer*.so
352EOF
11ad81c4 353
589d90ea
ER
354# find locales
355%find_lang %{name}.lang
e7fa0817 356# always package en-US
f1b276d4 357%{__sed} -i -e '/en-US.pak/d' %{name}.lang
589d90ea 358
11ad81c4
AM
359%clean
360rm -rf $RPM_BUILD_ROOT
361
f1b276d4 362%post
b7a6e4ee 363%update_desktop_database
f1b276d4
ER
364%update_browser_plugins
365
366%postun
367if [ "$1" = 0 ]; then
368 %update_browser_plugins
369fi
370
589d90ea 371%files -f %{name}.lang
11ad81c4 372%defattr(644,root,root,755)
f1b276d4
ER
373%{_browserpluginsconfdir}/browsers.d/%{name}.*
374%config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
375%attr(755,root,root) %{_bindir}/%{name}
376%{_mandir}/man1/%{name}.1*
377%{_pixmapsdir}/%{name}.png
11ad81c4 378%{_desktopdir}/*.desktop
0c480b89
ER
379%dir %{_libdir}/%{name}
380%{_libdir}/%{name}/chrome.pak
97fac491 381%{_libdir}/%{name}/resources.pak
589d90ea 382%dir %{_libdir}/%{name}/locales
f1b276d4
ER
383%{_libdir}/%{name}/locales/en-US.pak
384%dir %{_libdir}/%{name}/resources
a3140cd1 385%{_libdir}/%{name}/resources/inspector
f1b276d4
ER
386%dir %{_libdir}/%{name}/themes
387%dir %{_libdir}/%{name}/extensions
388%dir %{_libdir}/%{name}/plugins
389%attr(755,root,root) %{_libdir}/%{name}/%{name}
0c480b89 390# These unique permissions are intentional and necessary for the sandboxing
e53ecfb5 391%attr(4555,root,root) %{_libdir}/%{name}/chromium-sandbox
f1b276d4
ER
392
393# ffmpeg libs
d561483d 394%if %{with ffmpegsumo}
f1b276d4 395%attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so
dd46de65 396%endif
f1b276d4 397
164020eb
ER
398%if %{with nacl}
399%attr(755,root,root) %{_libdir}/%{name}/libppGoogleNaClPluginChrome.so
400%attr(755,root,root) %{_libdir}/%{name}/nacl_helper
401%attr(755,root,root) %{_libdir}/%{name}/nacl_helper_bootstrap
402%attr(755,root,root) %{_libdir}/%{name}/nacl_irt_x86_*.nexe
403%endif
404
f1b276d4
ER
405%files l10n -f %{name}.lang
406%defattr(644,root,root,755)
This page took 0.114092 seconds and 4 git commands to generate.