]> git.pld-linux.org Git - packages/chromium-browser.git/blame - chromium-browser.spec
- up to 18.0.1025.162
[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
c14cd342 19%bcond_with system_v8 # with system v8
32a2443e 20%bcond_without system_vpx # with system vpx
d617ab39 21%bcond_without system_yasm # with system yasm
2108baf2 22%bcond_without system_zlib # with system zlib
f4a8da6a 23%bcond_without libjpegturbo # use libjpeg-turbo features
2108baf2 24%bcond_with verbose # verbose build (V=1)
0c480b89 25
6d92f81c 26# TODO
f1b276d4 27# - check system sqlite linking problems
2108baf2 28# - find system deps: find -name '*.gyp*' | xargs grep 'use_system.*=='
a3140cd1 29# - use_system_ssl (use_openssl: http://crbug.com/62803)
32a2443e 30# - use_system_ffmpeg && build_ffmpegsumo
d617ab39 31# - use_system_hunspell
32a2443e 32# - use_system_stlport
a3140cd1
ER
33# - other defaults: src/build/common.gypi
34
e53ecfb5 35# NOTES:
4fe038cb
ER
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.
2108baf2
ER
38# - build -bp: 1.2G
39# - build i686: -bc: 2.7G; -bb: ~1.0GB
e8e15592 40# - build x86_64: ~1.9G
f1b276d4 41# - http://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites
84fa20a9 42# - to look for new tarball, use update-source.sh script
f1b276d4 43
e68aa7e7 44# NOTE TO USERS:
a3cc7091
ER
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
e68aa7e7 47# or:
a3cc7091 48# http://carme.pld-linux.org/~glen/chromium-browser/th/x86_64/chromium-nightly.conf
e68aa7e7 49
a3140cd1 50%define gyp_rev 1014
11ad81c4 51Summary: A WebKit powered web browser
05f72ae2 52Name: chromium-browser
3c861178 53Version: 18.0.1025.162
b8da6af6 54Release: 1
05f72ae2 55License: BSD, LGPL v2+ (ffmpeg)
e53ecfb5 56Group: X11/Applications/Networking
b8da6af6 57Source0: http://carme.pld-linux.org/~glen/chromium-browser/src/stable/%{name}-%{version}.tar.xz
3c861178 58# Source0-md5: 189c506b33faeecf2c80617b170201b8
8b53130d
ER
59Source2: %{name}.sh
60Source3: %{name}.desktop
56c6e811
ER
61Source5: find-lang.sh
62Source6: update-source.sh
63Source7: clean-source.sh
836b1cac 64Source8: get-source.sh
48b341f5 65Patch0: system-libs.patch
66Patch1: plugin-searchdirs.patch
67Patch2: gyp-system-minizip.patch
7abc645c 68Patch3: disable_dlog_and_dcheck_in_release_builds.patch
48b341f5 69Patch5: options-support.patch
0e5636cb 70Patch6: get-webkit_revision.patch
5aa5df39 71Patch7: dlopen_sonamed_gl.patch
4765ddf1 72Patch8: chromium_useragent.patch.in
77f32fa3 73Patch9: system-expat.patch
f4a8da6a 74Patch10: %{name}-pulse.patch
1347c76c
AM
75# https://bugs.gentoo.org/show_bug.cgi?id=393471
76# libjpeg-turbo >= 1.1.90 supports that feature
f4a8da6a 77Patch11: chromium-revert-jpeg-swizzle-r2.patch
d8353da9 78Patch12: chromium-glib.patch
750b48f7 79URL: http://www.chromium.org/Home
ae3fe89f 80%{?with_gconf:BuildRequires: GConf2-devel}
f1b276d4 81BuildRequires: OpenGL-GLU-devel
05f72ae2
ER
82BuildRequires: alsa-lib-devel
83BuildRequires: atk-devel
84BuildRequires: bison
11ad81c4 85BuildRequires: bzip2-devel
ae3fe89f 86%{?with_cups:BuildRequires: cups-devel}
2bc5cf47 87BuildRequires: dbus-glib-devel
77f32fa3 88BuildRequires: expat-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}
0eb19b0b 96BuildRequires: hicolor-icon-theme
05f72ae2 97BuildRequires: libevent-devel
7f40f3f4 98%{?with_keyring:BuildRequires: libgnome-keyring-devel}
0b214002 99BuildRequires: libicu-devel >= 4.6
05f72ae2 100BuildRequires: libjpeg-devel
f4a8da6a 101%{?with_libjpegturbo:BuildRequires: libjpeg-turbo-devel >= 1.2.0}
05f72ae2 102BuildRequires: libpng-devel
e266589e 103%{?with_selinux:BuildRequires: libselinux-devel}
05f72ae2 104BuildRequires: libstdc++-devel
32a2443e 105%{?with_system_vpx:BuildRequires: libvpx-devel >= 0.9.5-2}
e8e15592 106%{?with_system_libwebp:BuildRequires: libwebp-devel}
f1b276d4 107BuildRequires: libxml2-devel
11ad81c4 108BuildRequires: libxslt-devel
f1b276d4 109BuildRequires: lzma
11ad81c4 110BuildRequires: minizip-devel
164020eb 111%{?with_nacl:BuildRequires: nacl-toolchain-newlib >= 0.6941}
05f72ae2 112BuildRequires: nspr-devel
f1b276d4 113BuildRequires: nss-devel >= 1:3.12.3
35902862 114BuildRequires: pam-devel
f1b276d4 115BuildRequires: pango-devel
48b341f5 116BuildRequires: perl-modules
117BuildRequires: pkgconfig
ae3fe89f 118%{?with_pulseaudio:BuildRequires: pulseaudio-devel}
f1b276d4 119BuildRequires: python
46cdefee 120#BuildRequires: python-gyp >= 1-%{gyp_rev}
48b341f5 121BuildRequires: python-modules
0cad051b 122BuildRequires: rpm >= 4.4.9-56
f1b276d4 123BuildRequires: rpmbuild(macros) >= 1.453
0cad051b 124%{?with_system_speex:BuildRequires: speex-devel >= 1:1.2-rc1}
f1b276d4 125BuildRequires: sqlite3-devel >= 3.6.1
0cad051b 126BuildRequires: tar >= 1:1.22
2303ed45 127BuildRequires: util-linux
c14cd342 128%{?with_system_v8:BuildRequires: v8-devel >= 3.7}
0826c245 129BuildRequires: which
f1b276d4 130BuildRequires: xorg-lib-libXScrnSaver-devel
2bc5cf47
KK
131BuildRequires: xorg-lib-libXt-devel
132BuildRequires: xorg-lib-libXtst-devel
836b1cac 133BuildRequires: xz
a3140cd1 134%{?with_system_yasm:BuildRequires: yasm}
f1b276d4 135%{?with_system_zlib:BuildRequires: zlib-devel}
e53ecfb5 136Requires: browser-plugins >= 2.0
0cad051b 137Requires: desktop-file-utils
0eb19b0b 138Requires: hicolor-icon-theme
32a2443e 139%{?with_system_vpx:Requires: libvpx >= 0.9.5-2}
4dc49133 140Requires: xdg-utils >= 1.0.2-4
f4a8da6a 141%{?with_libjpegturbo:Requires: libjpeg-turbo >= 1.2.0}
e53ecfb5 142Provides: wwwbrowser
c3582150 143Obsoletes: chromium-browser-bookmark_manager < 5.0.388.0
a3140cd1 144Obsoletes: chromium-browser-inspector < 15.0.863.0
2351db3b 145ExclusiveArch: %{ix86} %{x8664} arm
11ad81c4 146BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
11ad81c4 147
589d90ea 148%define find_lang sh find-lang.sh %{buildroot}
e7fa0817
ER
149# Usage: gyp_with BCOND_NAME [OPTION_NAME]
150%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 151
6b113615
ER
152%if %{without debuginfo}
153%define _enable_debug_packages 0
154%endif
155
11ad81c4 156%description
80838854
ER
157Chromium is an open-source browser project that aims to build a safer,
158faster, and more stable way for all Internet users to experience the
159web.
160
161Chromium serves as a base for Google Chrome, which is Chromium
162rebranded (name and logo) with very few additions such as usage
163tracking and an auto-updater system.
164
f1b276d4
ER
165%package l10n
166Summary: chromium-browser language packages
167Group: I18n
168Requires: %{name} = %{version}-%{release}
169
170%description l10n
171Chromium is an open-source browser project that aims to build a safer,
172faster, and more stable way for all Internet users to experience the
173web.
174
175This package contains language packages for 50 languages:
176
e7fa0817
ER
177ar, bg, bn, ca, cs, da, de, el, en-GB, es-LA, es, et, fi, fil, fr, gu,
178he, hi, hr, hu, id, it, ja, kn, ko, lt, lv, ml, mr, nb, nl, or, pl,
179pt-BR, pt-PT, ro, ru, sk, sl, sr, sv, ta, te, th, tr, uk, vi, zh-CN,
180zh-TW
f1b276d4
ER
181
182%prep
836b1cac 183%setup -q
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
836b1cac 194v8_ver=$(awk 'NR=1 {print $NF; exit}' src/v8/ChangeLog || :)
33b04c7d 195
f1b276d4 196# Populate the LASTCHANGE file template as we no longer have the VCS files at this point
836b1cac 197#echo "%{svnver}" > src/build/LASTCHANGE.in
f1b276d4 198
4765ddf1
ER
199# add chromium and pld to useragent
200%define pld_version %(echo %{pld_release} | sed -e 'y/[at]/[AT]/')
201sed -e 's/@BUILD_DIST@/PLD %{pld_version}/g' \
202 -e 's/@BUILD_DIST_NAME@/PLD/g' \
203 -e 's/@BUILD_DIST_VERSION@/%{pld_version}/g' \
74a58b60 204 < %{PATCH8} | %{__patch} -p1
4765ddf1 205
56c6e811
ER
206%{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE5} > find-lang.sh
207ln -s %{SOURCE7} src
f1b276d4 208
05f72ae2
ER
209%patch0 -p1
210%patch1 -p1
211%patch2 -p1
7abc645c 212%patch3 -p1
05f72ae2 213%patch5 -p1
0e5636cb 214%patch6 -p1
5aa5df39 215%patch7 -p1
77f32fa3
ER
216cd src
217%patch9 -p1
bdbf9a94 218%patch10 -p1
f4a8da6a 219%{!?with_libjpegturbo:%patch11 -p0}
d8353da9 220%patch12 -p3
1347c76c 221cd ..
0c480b89 222
828bdd1a 223cd src
cd09b941 224sh -x clean-source.sh %{!?with_system_v8:v8=0} %{!?with_nacl:nacl=0}
164020eb 225
e266589e 226%build
f1b276d4 227cd src
164020eb 228test -e Makefile || %{__python} build/gyp_chromium --format=make build/all.gyp \
f1b276d4
ER
229%ifarch %{ix86}
230 -Dtarget_arch=ia32 \
231%endif
232%ifarch %{x8664}
0c480b89
ER
233 -Dtarget_arch=x64 \
234%endif
7b454a31
AM
235%if "%{cc_version}" >= "4.4.0" && "%{cc_version}" < "4.5.0"
236 -Dno_strict_aliasing=1 -Dgcc_version=44 \
f1b276d4
ER
237%endif
238%if %{with sandboxing}
239 -Dlinux_sandbox_path=%{_libdir}/%{name}/chromium-sandbox \
240 -Dlinux_sandbox_chrome_path=%{_libdir}/%{name}/%{name} \
241%endif
242 %{!?debug:-Dwerror=} \
c980b122 243 %{!?debuginfo:-Dfastbuild=1 -Dremove_webcore_debug_symbols=1} \
f1b276d4 244 %{?with_shared_libs:-Dlibrary=shared_library} \
37b05e5e 245 -Dbuild_ffmpegsumo=%{?with_ffmpegsumo:1}%{!?with_ffmpegsumo:0} \
a3140cd1
ER
246 -Dffmpeg_branding=Chrome \
247 -Dproprietary_codecs=1 \
5a6de706 248 %{!?with_nacl:-Ddisable_nacl=1} \
a3140cd1
ER
249 %{!?with_sse2:-Ddisable_sse2=1} \
250 %{?with_selinux:-Dselinux=1} \
e7fa0817
ER
251 %{gyp_with cups} \
252 %{gyp_with flac} \
253 %{gyp_with gconf} \
254 %{gyp_with kerberos} -Dlinux_link_kerberos=0 \
255 %{gyp_with keyring gnome_keyring} -Dlinux_link_gnome_keyring=0 \
256 %{gyp_with pulseaudio} \
e8e15592 257 %{gyp_with system_libwebp} \
e7fa0817
ER
258 %{gyp_with system_speex} \
259 %{gyp_with system_sqlite} \
260 %{gyp_with system_v8} \
32a2443e 261 %{gyp_with system_vpx} \
e7fa0817
ER
262 %{gyp_with system_yasm} \
263 %{gyp_with system_zlib} \
0c480b89 264 -Duse_system_bzip2=1 \
0b214002 265 -Duse_system_icu=1 \
f1b276d4 266 -Duse_system_libevent=1 \
0c480b89 267 -Duse_system_libjpeg=1 \
f1b276d4
ER
268 -Duse_system_libpng=1 \
269 -Duse_system_libxml=1 \
270 -Duse_system_libxslt=1 \
7f40f3f4 271 -Duse_system_xdg_utils=1 \
11ad81c4 272
f1b276d4
ER
273%{__make} chrome %{?with_sandboxing:chrome_sandbox} \
274 BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
275 %{?with_verbose:V=1} \
276 CC="%{__cc}" \
277 CXX="%{__cxx}" \
b7adf6b1 278 LDFLAGS="%{rpmldflags} -fuse-ld=gold" \
f1b276d4
ER
279 CC.host="%{__cc}" \
280 CXX.host="%{__cxx}" \
b7adf6b1 281 LDFLAGS.host="%{rpmldflags}" \
7b454a31
AM
282 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
283 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}"
11ad81c4
AM
284
285%install
286rm -rf $RPM_BUILD_ROOT
56c6e811 287install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/{themes,plugins,extensions} \
0eb19b0b 288 $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,%{_desktopdir}}
e266589e 289
f1b276d4 290cd src/out/%{!?debug:Release}%{?debug:Debug}
f1b276d4
ER
291install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
292%{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
97fac491 293cp -a *.pak locales resources $RPM_BUILD_ROOT%{_libdir}/%{name}
7f40f3f4 294cp -p chrome.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
f1b276d4 295install -p chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name}
e53ecfb5 296install -p chrome_sandbox $RPM_BUILD_ROOT%{_libdir}/%{name}/chromium-sandbox
d561483d 297%if %{with ffmpegsumo}
f1b276d4 298install -p libffmpegsumo.so $RPM_BUILD_ROOT%{_libdir}/%{name}
dd46de65 299%endif
e7fa0817 300cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}
164020eb
ER
301
302%if %{with nacl}
303# Install Native Client files on platforms that support it.
304install -p nacl_helper{,_bootstrap} $RPM_BUILD_ROOT%{_libdir}/%{name}
305install -p libppGoogleNaClPluginChrome.so $RPM_BUILD_ROOT%{_libdir}/%{name}
306%ifarch %{x8664}
307install -p nacl_irt_x86_64.nexe $RPM_BUILD_ROOT%{_libdir}/%{name}
308%endif
309%ifarch %{ix86}
310install -p nacl_irt_x86_32.nexe $RPM_BUILD_ROOT%{_libdir}/%{name}
311%endif
312%endif
313
0c480b89
ER
314cd -
315
0eb19b0b
ER
316for icon in src/chrome/app/theme/chromium/product_logo_[0-9]*.png; do
317 size=${icon##*/product_logo_}
318 size=${size%.png}
319
320 # this will skip non-numeric (22_mono_invert, 22_mono)
321 dir=%{_iconsdir}/hicolor/${size}x${size}/apps
322 test -d "$dir" || continue
323
324 install -d $RPM_BUILD_ROOT$dir
325 cp -p $icon $RPM_BUILD_ROOT$dir/%{name}.png
326done
7f40f3f4 327
13840bc2
AM
328%browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins -b <<'EOF'
329# http://code.google.com/p/chromium/issues/detail?id=24507
330gecko-mediaplayer*.so
331EOF
11ad81c4 332
589d90ea
ER
333# find locales
334%find_lang %{name}.lang
e7fa0817 335# always package en-US
f1b276d4 336%{__sed} -i -e '/en-US.pak/d' %{name}.lang
589d90ea 337
11ad81c4
AM
338%clean
339rm -rf $RPM_BUILD_ROOT
340
f1b276d4 341%post
0eb19b0b 342%update_icon_cache hicolor
b7a6e4ee 343%update_desktop_database
f1b276d4
ER
344%update_browser_plugins
345
346%postun
347if [ "$1" = 0 ]; then
0eb19b0b 348 %update_icon_cache hicolor
f1b276d4
ER
349 %update_browser_plugins
350fi
351
589d90ea 352%files -f %{name}.lang
11ad81c4 353%defattr(644,root,root,755)
f1b276d4
ER
354%{_browserpluginsconfdir}/browsers.d/%{name}.*
355%config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
356%attr(755,root,root) %{_bindir}/%{name}
357%{_mandir}/man1/%{name}.1*
11ad81c4 358%{_desktopdir}/*.desktop
0eb19b0b 359%{_iconsdir}/hicolor/*/apps/%{name}.png
0c480b89
ER
360%dir %{_libdir}/%{name}
361%{_libdir}/%{name}/chrome.pak
c14cd342 362%{_libdir}/%{name}/content_resources.pak
97fac491 363%{_libdir}/%{name}/resources.pak
589d90ea 364%dir %{_libdir}/%{name}/locales
f1b276d4
ER
365%{_libdir}/%{name}/locales/en-US.pak
366%dir %{_libdir}/%{name}/resources
a3140cd1 367%{_libdir}/%{name}/resources/inspector
f1b276d4
ER
368%dir %{_libdir}/%{name}/themes
369%dir %{_libdir}/%{name}/extensions
370%dir %{_libdir}/%{name}/plugins
371%attr(755,root,root) %{_libdir}/%{name}/%{name}
0c480b89 372# These unique permissions are intentional and necessary for the sandboxing
e53ecfb5 373%attr(4555,root,root) %{_libdir}/%{name}/chromium-sandbox
f1b276d4
ER
374
375# ffmpeg libs
d561483d 376%if %{with ffmpegsumo}
f1b276d4 377%attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so
dd46de65 378%endif
f1b276d4 379
164020eb
ER
380%if %{with nacl}
381%attr(755,root,root) %{_libdir}/%{name}/libppGoogleNaClPluginChrome.so
382%attr(755,root,root) %{_libdir}/%{name}/nacl_helper
383%attr(755,root,root) %{_libdir}/%{name}/nacl_helper_bootstrap
384%attr(755,root,root) %{_libdir}/%{name}/nacl_irt_x86_*.nexe
385%endif
386
f1b276d4
ER
387%files l10n -f %{name}.lang
388%defattr(644,root,root,755)
This page took 0.093485 seconds and 4 git commands to generate.