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