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