]> git.pld-linux.org Git - packages/chromium-browser.git/blame_incremental - chromium-browser.spec
- move source cleanup to external script, so it can be reused when creating
[packages/chromium-browser.git] / chromium-browser.spec
... / ...
CommitLineData
1#
2# Conditional build:
3%bcond_without debuginfo # disable debuginfo creation (it is huge)
4%bcond_without ffmpegsumo # build with ffmpegsumo
5%bcond_without kerberos # build with kerberos support (dlopened if support compiled, library names in src/net/http/http_auth_gssapi_posix.cc)
6%bcond_without keyring # with keyring support (gnome-keyring dlopened, kwalletd via dbus)
7%bcond_without cups # with cups
8%bcond_without gconf # with GConf
9%bcond_without pulseaudio # with pulseaudio
10%bcond_with nacl # build Native Client support
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
16%bcond_without system_flac # with system flac
17%bcond_without system_libwebp # with system libwebp
18%bcond_without system_speex # with system speex
19%bcond_without system_v8 # with system v8
20%bcond_without system_vpx # with system vpx
21%bcond_without system_yasm # with system yasm
22%bcond_without system_zlib # with system zlib
23%bcond_with verbose # verbose build (V=1)
24
25# TODO
26# - check system sqlite linking problems
27# - find system deps: find -name '*.gyp*' | xargs grep 'use_system.*=='
28# - use_system_ssl (use_openssl: http://crbug.com/62803)
29# - use_system_ffmpeg && build_ffmpegsumo
30# - use_system_hunspell
31# - use_system_stlport
32# - other defaults: src/build/common.gypi
33
34# NOTES:
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.
37# - build -bp: 1.2G
38# - build i686: -bc: 2.7G; -bb: ~1.0GB
39# - build x86_64: ~1.9G
40# - http://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites
41# - to look for new tarball, use update-source.sh script
42
43# NOTE TO USERS:
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
46# or:
47# http://carme.pld-linux.org/~glen/chromium-browser/th/x86_64/chromium-nightly.conf
48
49%define svndate %{nil}
50%define svnver 112386
51%define rel 1
52
53%define gyp_rev 1014
54Summary: A WebKit powered web browser
55Name: chromium-browser
56Version: 16.0.912.59
57Release: 0.%{svnver}.%{rel}
58License: BSD, LGPL v2+ (ffmpeg)
59Group: X11/Applications/Networking
60Source0: http://carme.pld-linux.org/~glen/chromium-browser/src/beta/%{name}_%{version}~r%{svnver}.orig.tar.gz
61# Source0-md5: 79d7767698b1522ddf5f7cf725e0594f
62#SourceX: http://ppa.launchpad.net/chromium-daily/ppa/ubuntu/pool/main/c/chromium-browser/%{name}_%{version}~svn%{svndate}r%{svnver}.orig.tar.gz
63Source2: %{name}.sh
64Source3: %{name}.desktop
65Source4: find-lang.sh
66Source5: update-source.sh
67Source6: clean-source.sh
68Patch0: system-libs.patch
69Patch1: plugin-searchdirs.patch
70Patch2: gyp-system-minizip.patch
71Patch3: disable_dlog_and_dcheck_in_release_builds.patch
72Patch5: options-support.patch
73Patch6: get-webkit_revision.patch
74Patch7: dlopen_sonamed_gl.patch
75Patch8: chromium_useragent.patch.in
76Patch9: system-expat.patch
77URL: http://www.chromium.org/Home
78%{?with_gconf:BuildRequires: GConf2-devel}
79BuildRequires: OpenGL-GLU-devel
80BuildRequires: alsa-lib-devel
81BuildRequires: atk-devel
82BuildRequires: bison
83BuildRequires: bzip2-devel
84%{?with_cups:BuildRequires: cups-devel}
85BuildRequires: dbus-glib-devel
86BuildRequires: expat-devel
87%{?with_system_flac:BuildRequires: flac-devel}
88BuildRequires: flex
89BuildRequires: fontconfig-devel
90BuildRequires: glib2-devel
91BuildRequires: gperf
92BuildRequires: gtk+2-devel
93%{?with_kerberos:BuildRequires: heimdal-devel}
94BuildRequires: libevent-devel
95%{?with_keyring:BuildRequires: libgnome-keyring-devel}
96BuildRequires: libicu-devel >= 4.6
97BuildRequires: libjpeg-devel
98BuildRequires: libpng-devel
99%{?with_selinux:BuildRequires: libselinux-devel}
100BuildRequires: libstdc++-devel
101%{?with_system_vpx:BuildRequires: libvpx-devel >= 0.9.5-2}
102%{?with_system_libwebp:BuildRequires: libwebp-devel}
103BuildRequires: libxml2-devel
104BuildRequires: libxslt-devel
105BuildRequires: lzma
106BuildRequires: minizip-devel
107%{?with_nacl:BuildRequires: nacl-toolchain-newlib >= 0.6941}
108BuildRequires: nspr-devel
109BuildRequires: nss-devel >= 1:3.12.3
110BuildRequires: pam-devel
111BuildRequires: pango-devel
112BuildRequires: perl-modules
113BuildRequires: pkgconfig
114%{?with_pulseaudio:BuildRequires: pulseaudio-devel}
115BuildRequires: python
116#BuildRequires: python-gyp >= 1-%{gyp_rev}
117BuildRequires: python-modules
118BuildRequires: rpm >= 4.4.9-56
119BuildRequires: rpmbuild(macros) >= 1.453
120%{?with_system_speex:BuildRequires: speex-devel >= 1:1.2-rc1}
121BuildRequires: sqlite3-devel >= 3.6.1
122BuildRequires: tar >= 1:1.22
123BuildRequires: util-linux
124%{?with_system_v8:BuildRequires: v8-devel >= 3.6}
125BuildRequires: which
126BuildRequires: xorg-lib-libXScrnSaver-devel
127BuildRequires: xorg-lib-libXt-devel
128BuildRequires: xorg-lib-libXtst-devel
129%{?with_system_yasm:BuildRequires: yasm}
130%{?with_system_zlib:BuildRequires: zlib-devel}
131Requires: browser-plugins >= 2.0
132Requires: desktop-file-utils
133%{?with_system_vpx:Requires: libvpx >= 0.9.5-2}
134Requires: xdg-utils >= 1.0.2-4
135Provides: wwwbrowser
136Obsoletes: chromium-browser-bookmark_manager < 5.0.388.0
137Obsoletes: chromium-browser-inspector < 15.0.863.0
138ExclusiveArch: %{ix86} %{x8664} arm
139BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
140
141%define find_lang sh find-lang.sh %{buildroot}
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}}
144
145%if %{without debuginfo}
146%define _enable_debug_packages 0
147%endif
148
149# undefine if empty, makes prep simplier
150%if "%{svndate}" == "%{nil}"
151%undefine svndate
152%endif
153
154%description
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
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
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
179
180%prep
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
185
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
188. ./src/chrome/VERSION
189ver=$MAJOR.$MINOR.$BUILD.$PATCH
190test "$ver" = %{version}
191
192gyp_rev=$(grep googlecode_url.*gyp src/DEPS | cut -d'"' -f6 | cut -d@ -f2)
193test "$gyp_rev" = %{gyp_rev} || :
194
195# Populate the LASTCHANGE file template as we no longer have the VCS files at this point
196echo "%{svnver}" > src/build/LASTCHANGE.in
197
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' \
203 < %{PATCH8} | %{__patch} -p1
204
205%{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE4} > find-lang.sh
206ln -s %{SOURCE6} src
207
208%patch0 -p1
209%patch1 -p1
210%patch2 -p1
211%patch3 -p1
212%patch5 -p1
213%patch6 -p1
214%patch7 -p1
215cd src
216%patch9 -p1
217cd ..
218
219cd src
220sh -x clean-source.sh %{?with_system_v8:v8=1} %{?with_nacl:nacl=1}
221
222%build
223cd src
224test -e Makefile || %{__python} build/gyp_chromium --format=make build/all.gyp \
225%ifarch %{ix86}
226 -Dtarget_arch=ia32 \
227%endif
228%ifarch %{x8664}
229 -Dtarget_arch=x64 \
230%endif
231%if "%{cc_version}" >= "4.4.0" && "%{cc_version}" < "4.5.0"
232 -Dno_strict_aliasing=1 -Dgcc_version=44 \
233%endif
234%if %{with sandboxing}
235 -Dlinux_sandbox_path=%{_libdir}/%{name}/chromium-sandbox \
236 -Dlinux_sandbox_chrome_path=%{_libdir}/%{name}/%{name} \
237%endif
238 %{!?debug:-Dwerror=} \
239 %{!?debuginfo:-Dfastbuild=1} \
240 %{?with_shared_libs:-Dlibrary=shared_library} \
241 -Dbuild_ffmpegsumo=%{?with_ffmpegsumo:1}%{!?with_ffmpegsumo:0} \
242 -Dffmpeg_branding=Chrome \
243 -Dproprietary_codecs=1 \
244 %{!?with_nacl:-Ddisable_nacl=1} \
245 %{!?with_sse2:-Ddisable_sse2=1} \
246 %{?with_selinux:-Dselinux=1} \
247 %{gyp_with cups} \
248 %{gyp_with flac} \
249 %{gyp_with gconf} \
250 %{gyp_with kerberos} -Dlinux_link_kerberos=0 \
251 %{gyp_with keyring gnome_keyring} -Dlinux_link_gnome_keyring=0 \
252 %{gyp_with pulseaudio} \
253 %{gyp_with system_libwebp} \
254 %{gyp_with system_speex} \
255 %{gyp_with system_sqlite} \
256 %{gyp_with system_v8} \
257 %{gyp_with system_vpx} \
258 %{gyp_with system_yasm} \
259 %{gyp_with system_zlib} \
260 -Duse_system_bzip2=1 \
261 -Duse_system_icu=1 \
262 -Duse_system_libevent=1 \
263 -Duse_system_libjpeg=1 \
264 -Duse_system_libpng=1 \
265 -Duse_system_libxml=1 \
266 -Duse_system_libxslt=1 \
267 -Duse_system_xdg_utils=1 \
268
269%{__make} chrome %{?with_sandboxing:chrome_sandbox} \
270 BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
271 %{?with_verbose:V=1} \
272 CC="%{__cc}" \
273 CXX="%{__cxx}" \
274 CC.host="%{__cc}" \
275 CXX.host="%{__cxx}" \
276 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
277 CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}"
278
279%install
280rm -rf $RPM_BUILD_ROOT
281install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/{themes,locales,plugins,extensions,resources},%{_mandir}/man1,%{_pixmapsdir},%{_desktopdir}}
282
283cd src/out/%{!?debug:Release}%{?debug:Debug}
284install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
285%{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
286cp -a *.pak locales resources $RPM_BUILD_ROOT%{_libdir}/%{name}
287cp -p chrome.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
288install -p chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name}
289install -p chrome_sandbox $RPM_BUILD_ROOT%{_libdir}/%{name}/chromium-sandbox
290%if %{with ffmpegsumo}
291install -p libffmpegsumo.so $RPM_BUILD_ROOT%{_libdir}/%{name}
292%endif
293cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}
294
295%if %{with nacl}
296# Install Native Client files on platforms that support it.
297install -p nacl_helper{,_bootstrap} $RPM_BUILD_ROOT%{_libdir}/%{name}
298install -p libppGoogleNaClPluginChrome.so $RPM_BUILD_ROOT%{_libdir}/%{name}
299%ifarch %{x8664}
300install -p nacl_irt_x86_64.nexe $RPM_BUILD_ROOT%{_libdir}/%{name}
301%endif
302%ifarch %{ix86}
303install -p nacl_irt_x86_32.nexe $RPM_BUILD_ROOT%{_libdir}/%{name}
304%endif
305%endif
306
307cd -
308
309cp -p src/chrome/app/theme/chromium/product_logo_48.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
310
311%browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins -b <<'EOF'
312# http://code.google.com/p/chromium/issues/detail?id=24507
313gecko-mediaplayer*.so
314EOF
315
316# find locales
317%find_lang %{name}.lang
318# always package en-US
319%{__sed} -i -e '/en-US.pak/d' %{name}.lang
320
321%clean
322rm -rf $RPM_BUILD_ROOT
323
324%post
325%update_desktop_database
326%update_browser_plugins
327
328%postun
329if [ "$1" = 0 ]; then
330 %update_browser_plugins
331fi
332
333%files -f %{name}.lang
334%defattr(644,root,root,755)
335%{_browserpluginsconfdir}/browsers.d/%{name}.*
336%config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
337%attr(755,root,root) %{_bindir}/%{name}
338%{_mandir}/man1/%{name}.1*
339%{_pixmapsdir}/%{name}.png
340%{_desktopdir}/*.desktop
341%dir %{_libdir}/%{name}
342%{_libdir}/%{name}/chrome.pak
343%{_libdir}/%{name}/resources.pak
344%dir %{_libdir}/%{name}/locales
345%{_libdir}/%{name}/locales/en-US.pak
346%dir %{_libdir}/%{name}/resources
347%{_libdir}/%{name}/resources/inspector
348%dir %{_libdir}/%{name}/themes
349%dir %{_libdir}/%{name}/extensions
350%dir %{_libdir}/%{name}/plugins
351%attr(755,root,root) %{_libdir}/%{name}/%{name}
352# These unique permissions are intentional and necessary for the sandboxing
353%attr(4555,root,root) %{_libdir}/%{name}/chromium-sandbox
354
355# ffmpeg libs
356%if %{with ffmpegsumo}
357%attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so
358%endif
359
360%if %{with nacl}
361%attr(755,root,root) %{_libdir}/%{name}/libppGoogleNaClPluginChrome.so
362%attr(755,root,root) %{_libdir}/%{name}/nacl_helper
363%attr(755,root,root) %{_libdir}/%{name}/nacl_helper_bootstrap
364%attr(755,root,root) %{_libdir}/%{name}/nacl_irt_x86_*.nexe
365%endif
366
367%files l10n -f %{name}.lang
368%defattr(644,root,root,755)
This page took 0.521997 seconds and 4 git commands to generate.