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