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