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