]> git.pld-linux.org Git - packages/chromium-browser.git/blame - chromium-browser.spec
- 15.0.869.0 r99284; gyp not needed, bundled copy used
[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)
a3140cd1 7%bcond_with nacl # build Native Client support
2108baf2
ER
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
a3140cd1 12%bcond_without system_speex # with system speex
2108baf2
ER
13%bcond_with system_sqlite # with system sqlite
14%bcond_with system_v8 # with system v8
a3140cd1 15%bcond_with system_yasm # with system yasm
2108baf2
ER
16%bcond_without system_zlib # with system zlib
17%bcond_with verbose # verbose build (V=1)
0c480b89 18
6d92f81c 19# TODO
f1b276d4 20# - check system sqlite linking problems
2108baf2
ER
21# - find system deps: find -name '*.gyp*' | xargs grep 'use_system.*=='
22# - use_system_speex
23# - use_system_libwebp
24# - use_system_flac
a3140cd1 25# - use_system_ssl (use_openssl: http://crbug.com/62803)
2108baf2
ER
26# - use_system_v8
27# - use_system_ffmpeg
a3140cd1
ER
28# - other defaults: src/build/common.gypi
29
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
2351db3b 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
40# - build x86_64: -bc: ~990MB; -bb: ~1.0GB
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
46cdefee
ER
50%define svndate 20110902
51%define svnver 99284
7e588392 52%define rel 1
11ad81c4 53
a3140cd1 54%define gyp_rev 1014
11ad81c4 55Summary: A WebKit powered web browser
05f72ae2 56Name: chromium-browser
46cdefee 57Version: 15.0.869.0
cf823a7a 58Release: 0.%{svnver}.%{rel}
05f72ae2 59License: BSD, LGPL v2+ (ffmpeg)
e53ecfb5 60Group: X11/Applications/Networking
f1b276d4 61Source0: http://ppa.launchpad.net/chromium-daily/ppa/ubuntu/pool/main/c/chromium-browser/%{name}_%{version}~svn%{svndate}r%{svnver}.orig.tar.gz
46cdefee 62# Source0-md5: a1339e6daf163ddefcc4c757dd989470
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
750b48f7 75URL: http://www.chromium.org/Home
05f72ae2 76BuildRequires: GConf2-devel
f1b276d4 77BuildRequires: OpenGL-GLU-devel
05f72ae2
ER
78BuildRequires: alsa-lib-devel
79BuildRequires: atk-devel
80BuildRequires: bison
11ad81c4 81BuildRequires: bzip2-devel
0826c245 82BuildRequires: cups-devel
2bc5cf47 83BuildRequires: dbus-glib-devel
11ad81c4 84BuildRequires: flex
11ad81c4 85BuildRequires: fontconfig-devel
f1b276d4 86BuildRequires: glib2-devel
05f72ae2 87BuildRequires: gperf
8b53130d 88BuildRequires: gtk+2-devel
a3140cd1 89%{?with_kerberos:BuildRequires: heimdal-devel}
05f72ae2 90BuildRequires: libevent-devel
7f40f3f4 91%{?with_keyring:BuildRequires: libgnome-keyring-devel}
0b214002 92BuildRequires: libicu-devel >= 4.6
05f72ae2
ER
93BuildRequires: libjpeg-devel
94BuildRequires: libpng-devel
e266589e 95%{?with_selinux:BuildRequires: libselinux-devel}
05f72ae2 96BuildRequires: libstdc++-devel
c8e3a0be 97BuildRequires: libvpx-devel >= 0.9.5-2
f1b276d4 98BuildRequires: libxml2-devel
11ad81c4 99BuildRequires: libxslt-devel
f1b276d4 100BuildRequires: lzma
11ad81c4 101BuildRequires: minizip-devel
05f72ae2 102BuildRequires: nspr-devel
f1b276d4 103BuildRequires: nss-devel >= 1:3.12.3
35902862 104BuildRequires: pam-devel
f1b276d4 105BuildRequires: pango-devel
48b341f5 106BuildRequires: perl-modules
107BuildRequires: pkgconfig
b066feb8 108BuildRequires: pulseaudio-devel
f1b276d4 109BuildRequires: python
4765ddf1 110BuildRequires: rpm >= 4.4.9-56
a3140cd1 111%{?with_system_speex:BuildRequires: speex-devel >= 1:1.2-rc1}
46cdefee 112#BuildRequires: python-gyp >= 1-%{gyp_rev}
48b341f5 113BuildRequires: python-modules
f1b276d4
ER
114BuildRequires: rpmbuild(macros) >= 1.453
115BuildRequires: sqlite3-devel >= 3.6.1
2303ed45 116BuildRequires: util-linux
e79c688f 117%{?with_system_v8:BuildRequires: v8-devel}
0826c245 118BuildRequires: which
f1b276d4 119BuildRequires: xorg-lib-libXScrnSaver-devel
2bc5cf47
KK
120BuildRequires: xorg-lib-libXt-devel
121BuildRequires: xorg-lib-libXtst-devel
a3140cd1 122%{?with_system_yasm:BuildRequires: yasm}
f1b276d4 123%{?with_system_zlib:BuildRequires: zlib-devel}
e53ecfb5 124Requires: browser-plugins >= 2.0
ffdddc49 125Requires: libvpx >= 0.9.5-2
4dc49133 126Requires: xdg-utils >= 1.0.2-4
e53ecfb5 127Provides: wwwbrowser
c3582150 128Obsoletes: chromium-browser-bookmark_manager < 5.0.388.0
a3140cd1 129Obsoletes: chromium-browser-inspector < 15.0.863.0
2351db3b 130ExclusiveArch: %{ix86} %{x8664} arm
11ad81c4 131BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
11ad81c4 132
589d90ea
ER
133%define find_lang sh find-lang.sh %{buildroot}
134
6b113615
ER
135%if %{without debuginfo}
136%define _enable_debug_packages 0
137%endif
138
11ad81c4 139%description
80838854
ER
140Chromium is an open-source browser project that aims to build a safer,
141faster, and more stable way for all Internet users to experience the
142web.
143
144Chromium serves as a base for Google Chrome, which is Chromium
145rebranded (name and logo) with very few additions such as usage
146tracking and an auto-updater system.
147
f1b276d4
ER
148%package l10n
149Summary: chromium-browser language packages
150Group: I18n
151Requires: %{name} = %{version}-%{release}
152
153%description l10n
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
158This package contains language packages for 50 languages:
159
160ar, bg, bn, ca, cs, da, de, el, en-GB, es-419, es, et, fi, fil, fr,
161gu, he, hi, hr, hu, id, it, ja, kn, ko, lt, lv, ml, mr, nb, nl, or,
162pl, pt-BR, pt-PT, ro, ru, sk, sl, sr, sv, ta, te, th, tr, uk, vi,
163zh-CN, zh-TW
164
165%prep
166%setup -q -n %{name}-%{version}~svn%{svndate}r%{svnver}
167lzma -dc %{name}-%{version}~svn%{svndate}r%{svnver}-source.tar.lzma | tar x
168rm -f %{name}-%{version}~svn%{svndate}r%{svnver}-source.tar.lzma
589d90ea 169
05f72ae2
ER
170# Google's versioning is interesting. They never reset "BUILD", which is how we jumped
171# from 3.0.201.0 to 4.0.202.0 as they moved to a new major branch
0c480b89
ER
172. ./src/chrome/VERSION
173ver=$MAJOR.$MINOR.$BUILD.$PATCH
a3140cd1
ER
174test "$ver" = %{version}
175
176gyp_rev=$(grep googlecode_url.*gyp src/DEPS | cut -d'"' -f6 | cut -d@ -f2)
46cdefee 177#test "$gyp_rev" = %{gyp_rev}
05f72ae2 178
f1b276d4
ER
179# Populate the LASTCHANGE file template as we no longer have the VCS files at this point
180echo "%{svnver}" > src/build/LASTCHANGE.in
181
4765ddf1
ER
182# add chromium and pld to useragent
183%define pld_version %(echo %{pld_release} | sed -e 'y/[at]/[AT]/')
184sed -e 's/@BUILD_DIST@/PLD %{pld_version}/g' \
185 -e 's/@BUILD_DIST_NAME@/PLD/g' \
186 -e 's/@BUILD_DIST_VERSION@/%{pld_version}/g' \
74a58b60 187 < %{PATCH8} | %{__patch} -p1
4765ddf1 188
2bc5cf47 189%{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE4} > find-lang.sh
f1b276d4 190
05f72ae2
ER
191%patch0 -p1
192%patch1 -p1
193%patch2 -p1
7abc645c 194%patch3 -p1
05f72ae2 195%patch5 -p1
0e5636cb 196%patch6 -p1
5aa5df39 197%patch7 -p1
0c480b89 198
828bdd1a
AM
199# drop bundled libs, from gentoo
200remove_bundled_lib() {
97fac491
ER
201 echo "Removing bundled library $1 ..."
202 local out
203 out=$(find $1 -mindepth 1 ! -iname '*.gyp' -print -delete)
204 if [ -z "$out" ]; then
205 echo >&2 "No files matched when removing bundled library $1"
206 exit 1
207 fi
828bdd1a
AM
208}
209
210cd src
211remove_bundled_lib "third_party/bzip2"
0b214002 212remove_bundled_lib "third_party/icu"
828bdd1a
AM
213remove_bundled_lib "third_party/libevent"
214remove_bundled_lib "third_party/libjpeg"
215remove_bundled_lib "third_party/libpng"
181b99e0
ER
216# third_party/libvpx/libvpx.h should be kept
217#remove_bundled_lib "third_party/libvpx"
828bdd1a
AM
218remove_bundled_lib "third_party/libxml"
219remove_bundled_lib "third_party/libxslt"
6ff7cc9f 220remove_bundled_lib "third_party/zlib"
a3140cd1
ER
221# 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.
222#remove_bundled_lib "third_party/yasm"
828bdd1a 223
e266589e 224%build
f1b276d4
ER
225cd src
226%{__python} build/gyp_chromium --format=make build/all.gyp \
227%ifarch %{ix86}
228 -Dtarget_arch=ia32 \
229%endif
230%ifarch %{x8664}
0c480b89
ER
231 -Dtarget_arch=x64 \
232%endif
7b454a31
AM
233%if "%{cc_version}" >= "4.4.0" && "%{cc_version}" < "4.5.0"
234 -Dno_strict_aliasing=1 -Dgcc_version=44 \
f1b276d4
ER
235%endif
236%if %{with sandboxing}
237 -Dlinux_sandbox_path=%{_libdir}/%{name}/chromium-sandbox \
238 -Dlinux_sandbox_chrome_path=%{_libdir}/%{name}/%{name} \
239%endif
240 %{!?debug:-Dwerror=} \
2303ed45 241 %{!?debuginfo:-Dfastbuild=1} \
f1b276d4
ER
242 %{?with_shared_libs:-Dlibrary=shared_library} \
243 -Djavascript_engine=%{?with_system_v8:system-v8}%{!?with_system_v8:v8} \
37b05e5e 244 -Dbuild_ffmpegsumo=%{?with_ffmpegsumo:1}%{!?with_ffmpegsumo:0} \
a3140cd1
ER
245 -Dffmpeg_branding=Chrome \
246 -Dproprietary_codecs=1 \
5a6de706 247 %{!?with_nacl:-Ddisable_nacl=1} \
a3140cd1
ER
248 %{!?with_sse2:-Ddisable_sse2=1} \
249 %{?with_selinux:-Dselinux=1} \
0c480b89 250 -Duse_system_bzip2=1 \
0b214002 251 -Duse_system_icu=1 \
f1b276d4 252 -Duse_system_libevent=1 \
0c480b89 253 -Duse_system_libjpeg=1 \
f1b276d4
ER
254 -Duse_system_libpng=1 \
255 -Duse_system_libxml=1 \
256 -Duse_system_libxslt=1 \
a3140cd1 257 -Duse_system_speex=%{?with_system_speex:1}%{!?with_system_speex:0} \
f1b276d4 258 -Duse_system_sqlite=%{?with_system_sqlite:1}%{!?with_system_sqlite:0} \
888c00c4 259 -Duse_system_vpx=1 \
7f40f3f4 260 -Duse_system_xdg_utils=1 \
a3140cd1 261 -Duse_system_yasm=%{?with_system_yasm:1}%{!?with_system_yasm:0} \
7f40f3f4 262 -Duse_system_zlib=%{?with_system_zlib:1}%{!?with_system_zlib:0} \
a3140cd1
ER
263%if %{with kerberos}
264 -Duse_kerberos=1 -Dlinux_link_kerberos=0 \
265%else
266 -Duse_kerberos=0 \
267%endif
7f40f3f4
ER
268%if %{with keyring}
269 -Duse_gnome_keyring=1 -Dlinux_link_gnome_keyring=0 \
270%else
271 -Duse_gnome_keyring=0 \
272%endif
11ad81c4 273
f1b276d4
ER
274%{__make} chrome %{?with_sandboxing:chrome_sandbox} \
275 BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
276 %{?with_verbose:V=1} \
277 CC="%{__cc}" \
278 CXX="%{__cxx}" \
279 CC.host="%{__cc}" \
280 CXX.host="%{__cxx}" \
7b454a31
AM
281 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
282 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}"
11ad81c4
AM
283
284%install
285rm -rf $RPM_BUILD_ROOT
f1b276d4 286install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/{themes,locales,plugins,extensions,resources},%{_mandir}/man1,%{_pixmapsdir},%{_desktopdir}}
e266589e 287
f1b276d4 288cd src/out/%{!?debug:Release}%{?debug:Debug}
f1b276d4
ER
289install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
290%{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
97fac491 291cp -a *.pak locales resources $RPM_BUILD_ROOT%{_libdir}/%{name}
7f40f3f4 292cp -p chrome.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
f1b276d4 293install -p chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name}
e53ecfb5 294install -p chrome_sandbox $RPM_BUILD_ROOT%{_libdir}/%{name}/chromium-sandbox
d561483d 295%if %{with ffmpegsumo}
f1b276d4 296install -p libffmpegsumo.so $RPM_BUILD_ROOT%{_libdir}/%{name}
dd46de65 297%endif
f1b276d4 298cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}
0c480b89
ER
299cd -
300
7f40f3f4
ER
301cp -p src/chrome/app/theme/chromium/product_logo_48.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
302
13840bc2
AM
303%browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins -b <<'EOF'
304# http://code.google.com/p/chromium/issues/detail?id=24507
305gecko-mediaplayer*.so
306EOF
11ad81c4 307
589d90ea
ER
308# find locales
309%find_lang %{name}.lang
f1b276d4 310%{__sed} -i -e '/en-US.pak/d' %{name}.lang
589d90ea 311
11ad81c4
AM
312%clean
313rm -rf $RPM_BUILD_ROOT
314
f1b276d4
ER
315%post
316%update_browser_plugins
317
318%postun
319if [ "$1" = 0 ]; then
320 %update_browser_plugins
321fi
322
589d90ea 323%files -f %{name}.lang
11ad81c4 324%defattr(644,root,root,755)
f1b276d4
ER
325%{_browserpluginsconfdir}/browsers.d/%{name}.*
326%config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
327%attr(755,root,root) %{_bindir}/%{name}
328%{_mandir}/man1/%{name}.1*
329%{_pixmapsdir}/%{name}.png
11ad81c4 330%{_desktopdir}/*.desktop
0c480b89
ER
331%dir %{_libdir}/%{name}
332%{_libdir}/%{name}/chrome.pak
97fac491 333%{_libdir}/%{name}/resources.pak
589d90ea 334%dir %{_libdir}/%{name}/locales
f1b276d4
ER
335%{_libdir}/%{name}/locales/en-US.pak
336%dir %{_libdir}/%{name}/resources
a3140cd1 337%{_libdir}/%{name}/resources/inspector
f1b276d4
ER
338%dir %{_libdir}/%{name}/themes
339%dir %{_libdir}/%{name}/extensions
340%dir %{_libdir}/%{name}/plugins
341%attr(755,root,root) %{_libdir}/%{name}/%{name}
0c480b89 342# These unique permissions are intentional and necessary for the sandboxing
e53ecfb5 343%attr(4555,root,root) %{_libdir}/%{name}/chromium-sandbox
f1b276d4
ER
344
345# ffmpeg libs
d561483d 346%if %{with ffmpegsumo}
f1b276d4 347%attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so
dd46de65 348%endif
f1b276d4 349
f1b276d4
ER
350%files l10n -f %{name}.lang
351%defattr(644,root,root,755)
This page took 0.097774 seconds and 4 git commands to generate.