]> git.pld-linux.org Git - packages/chromium-browser.git/blob - chromium-browser.spec
- add system_libwebp bcond
[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_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 # build broken on x86-64 due 32bit exe:
35 # /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
36 # build broken on x86-32:
37 # /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
38
39 # NOTES:
40 # - mute BEEP mixer if you do not want to hear horrible system bell when
41 #   pressing home/end in url bar or more ^F search results on page.
42 # - build -bp: 1.2G
43 # - build i686: -bc: 2.7G; -bb: ~1.0GB
44 # - build x86_64: ~1.9G
45 # - http://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites
46 # - to look for new tarball, use update-source.sh script
47
48 # NOTE TO USERS:
49 # To use chromium nightly builds for pld-th save to /etc/poldek/repos.d (as chromium-nightly.conf):
50 # http://carme.pld-linux.org/~glen/chromium-browser/th/i686/chromium-nightly.conf
51 # or:
52 # http://carme.pld-linux.org/~glen/chromium-browser/th/x86_64/chromium-nightly.conf
53
54 %define         svndate %{nil}
55 %define         svnver  109393
56 %define         rel             2
57
58 %define         gyp_rev 1014
59 Summary:        A WebKit powered web browser
60 Name:           chromium-browser
61 Version:        16.0.912.36
62 Release:        0.%{svnver}.%{rel}
63 License:        BSD, LGPL v2+ (ffmpeg)
64 Group:          X11/Applications/Networking
65 Source0:        http://carme.pld-linux.org/~glen/chromium-browser/src/beta/%{name}_%{version}~r%{svnver}.orig.tar.gz
66 # Source0-md5:  92eda1bd49fff2e70b703032f1aaab0d
67 #SourceX:       http://ppa.launchpad.net/chromium-daily/ppa/ubuntu/pool/main/c/chromium-browser/%{name}_%{version}~svn%{svndate}r%{svnver}.orig.tar.gz
68 Source2:        %{name}.sh
69 Source3:        %{name}.desktop
70 Source4:        find-lang.sh
71 Source5:        update-source.sh
72 Patch0:         system-libs.patch
73 Patch1:         plugin-searchdirs.patch
74 Patch2:         gyp-system-minizip.patch
75 Patch3:         disable_dlog_and_dcheck_in_release_builds.patch
76 Patch5:         options-support.patch
77 Patch6:         get-webkit_revision.patch
78 Patch7:         dlopen_sonamed_gl.patch
79 Patch8:         chromium_useragent.patch.in
80 URL:            http://www.chromium.org/Home
81 %{?with_gconf:BuildRequires:    GConf2-devel}
82 BuildRequires:  OpenGL-GLU-devel
83 BuildRequires:  alsa-lib-devel
84 BuildRequires:  atk-devel
85 BuildRequires:  bison
86 BuildRequires:  bzip2-devel
87 %{?with_cups:BuildRequires:     cups-devel}
88 BuildRequires:  dbus-glib-devel
89 %{?with_system_flac:BuildRequires:      flac-devel}
90 BuildRequires:  flex
91 BuildRequires:  fontconfig-devel
92 BuildRequires:  glib2-devel
93 BuildRequires:  gperf
94 BuildRequires:  gtk+2-devel
95 %{?with_kerberos:BuildRequires: heimdal-devel}
96 BuildRequires:  libevent-devel
97 %{?with_keyring:BuildRequires:  libgnome-keyring-devel}
98 BuildRequires:  libicu-devel >= 4.6
99 BuildRequires:  libjpeg-devel
100 BuildRequires:  libpng-devel
101 %{?with_selinux:BuildRequires:  libselinux-devel}
102 BuildRequires:  libstdc++-devel
103 %{?with_system_vpx:BuildRequires:       libvpx-devel >= 0.9.5-2}
104 %{?with_system_libwebp:BuildRequires:   libwebp-devel}
105 BuildRequires:  libxml2-devel
106 BuildRequires:  libxslt-devel
107 BuildRequires:  lzma
108 BuildRequires:  minizip-devel
109 BuildRequires:  nspr-devel
110 BuildRequires:  nss-devel >= 1:3.12.3
111 BuildRequires:  pam-devel
112 BuildRequires:  pango-devel
113 BuildRequires:  perl-modules
114 BuildRequires:  pkgconfig
115 %{?with_pulseaudio:BuildRequires:       pulseaudio-devel}
116 BuildRequires:  python
117 #BuildRequires: python-gyp >= 1-%{gyp_rev}
118 BuildRequires:  python-modules
119 BuildRequires:  rpm >= 4.4.9-56
120 BuildRequires:  rpmbuild(macros) >= 1.453
121 %{?with_system_speex:BuildRequires:     speex-devel >= 1:1.2-rc1}
122 BuildRequires:  sqlite3-devel >= 3.6.1
123 BuildRequires:  tar >= 1:1.22
124 BuildRequires:  util-linux
125 %{?with_system_v8:BuildRequires:        v8-devel >= 3.6}
126 BuildRequires:  which
127 BuildRequires:  xorg-lib-libXScrnSaver-devel
128 BuildRequires:  xorg-lib-libXt-devel
129 BuildRequires:  xorg-lib-libXtst-devel
130 %{?with_system_yasm:BuildRequires:      yasm}
131 %{?with_system_zlib:BuildRequires:      zlib-devel}
132 Requires:       browser-plugins >= 2.0
133 Requires:       desktop-file-utils
134 %{?with_system_vpx:Requires:    libvpx >= 0.9.5-2}
135 Requires:       xdg-utils >= 1.0.2-4
136 Provides:       wwwbrowser
137 Obsoletes:      chromium-browser-bookmark_manager < 5.0.388.0
138 Obsoletes:      chromium-browser-inspector < 15.0.863.0
139 ExclusiveArch:  %{ix86} %{x8664} arm
140 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
141
142 %define         find_lang       sh find-lang.sh %{buildroot}
143 # Usage: gyp_with BCOND_NAME [OPTION_NAME]
144 %define         gyp_with() %{expand:%%{?with_%{1}:-D%{?2:use_%{2}}%{!?2:use_%{1}}=1}%%{!?with_%{1}:-D%{?2:use_%{2}}%{!?2:use_%{1}}=0}}
145
146 %if %{without debuginfo}
147 %define         _enable_debug_packages  0
148 %endif
149
150 # undefine if empty, makes prep simplier
151 %if "%{svndate}" == "%{nil}"
152 %undefine       svndate
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 -n %{name}-%{version}~%{?svndate:svn%{svndate}}r%{svnver}
183 SRC=%{name}-%{version}~%{?svndate:svn%{svndate}}r%{svnver}-source.tar.*
184 tar xf $SRC
185 %{__rm} $SRC
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 # Populate the LASTCHANGE file template as we no longer have the VCS files at this point
197 echo "%{svnver}" > src/build/LASTCHANGE.in
198
199 # add chromium and pld to useragent
200 %define pld_version %(echo %{pld_release} | sed -e 'y/[at]/[AT]/')
201 sed -e 's/@BUILD_DIST@/PLD %{pld_version}/g' \
202     -e 's/@BUILD_DIST_NAME@/PLD/g' \
203     -e 's/@BUILD_DIST_VERSION@/%{pld_version}/g' \
204     < %{PATCH8} | %{__patch} -p1
205
206 %{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE4} > find-lang.sh
207
208 %patch0 -p1
209 %patch1 -p1
210 %patch2 -p1
211 %patch3 -p1
212 %patch5 -p1
213 %patch6 -p1
214 %patch7 -p1
215
216 # drop bundled libs, from gentoo
217 remove_bundled_lib() {
218         echo "Removing bundled library $1 ..."
219         local out
220         out=$(find $1 -mindepth 1 ! -iname '*.gyp' -print -delete)
221         if [ -z "$out" ]; then
222                 echo >&2 "No files matched when removing bundled library $1"
223                 exit 1
224         fi
225 }
226
227 cd src
228 remove_bundled_lib "third_party/bzip2"
229 remove_bundled_lib "third_party/icu"
230 remove_bundled_lib "third_party/libevent"
231 remove_bundled_lib "third_party/libjpeg"
232 remove_bundled_lib "third_party/libpng"
233 # third_party/libvpx/libvpx.h should be kept
234 #remove_bundled_lib "third_party/libvpx"
235 remove_bundled_lib "third_party/libxml"
236 remove_bundled_lib "third_party/libxslt"
237 remove_bundled_lib "third_party/zlib"
238 # 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.
239 #remove_bundled_lib "third_party/yasm"
240
241 %if %{with system_v8}
242 # Remove bundled v8.
243 find v8 -type f \! -iname '*.gyp*' -delete
244
245 # The implementation files include v8 headers with full path,
246 # like #include "v8/include/v8.h". Make sure the system headers
247 # will be used.
248 rmdir v8/include
249 ln -s %{_includedir} v8/include
250 %endif
251
252 %build
253 cd src
254 %{__python} build/gyp_chromium --format=make build/all.gyp \
255 %ifarch %{ix86}
256         -Dtarget_arch=ia32 \
257 %endif
258 %ifarch %{x8664}
259         -Dtarget_arch=x64 \
260 %endif
261 %if "%{cc_version}" >= "4.4.0" && "%{cc_version}" < "4.5.0"
262         -Dno_strict_aliasing=1 -Dgcc_version=44 \
263 %endif
264 %if %{with sandboxing}
265         -Dlinux_sandbox_path=%{_libdir}/%{name}/chromium-sandbox \
266         -Dlinux_sandbox_chrome_path=%{_libdir}/%{name}/%{name} \
267 %endif
268         %{!?debug:-Dwerror=} \
269         %{!?debuginfo:-Dfastbuild=1} \
270         %{?with_shared_libs:-Dlibrary=shared_library} \
271         -Dbuild_ffmpegsumo=%{?with_ffmpegsumo:1}%{!?with_ffmpegsumo:0} \
272         -Dffmpeg_branding=Chrome \
273         -Dproprietary_codecs=1 \
274         %{!?with_nacl:-Ddisable_nacl=1} \
275         %{!?with_sse2:-Ddisable_sse2=1} \
276         %{?with_selinux:-Dselinux=1} \
277         %{gyp_with cups} \
278         %{gyp_with flac} \
279         %{gyp_with gconf} \
280         %{gyp_with kerberos} -Dlinux_link_kerberos=0 \
281         %{gyp_with keyring gnome_keyring} -Dlinux_link_gnome_keyring=0 \
282         %{gyp_with pulseaudio} \
283         %{gyp_with system_libwebp} \
284         %{gyp_with system_speex} \
285         %{gyp_with system_sqlite} \
286         %{gyp_with system_v8} \
287         %{gyp_with system_vpx} \
288         %{gyp_with system_yasm} \
289         %{gyp_with system_zlib} \
290         -Duse_system_bzip2=1 \
291         -Duse_system_icu=1 \
292         -Duse_system_libevent=1 \
293         -Duse_system_libjpeg=1 \
294         -Duse_system_libpng=1 \
295         -Duse_system_libxml=1 \
296         -Duse_system_libxslt=1 \
297         -Duse_system_xdg_utils=1 \
298
299 %{__make} chrome %{?with_sandboxing:chrome_sandbox} \
300         BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
301         %{?with_verbose:V=1} \
302         CC="%{__cc}" \
303         CXX="%{__cxx}" \
304         CC.host="%{__cc}" \
305         CXX.host="%{__cxx}" \
306         CFLAGS="%{rpmcflags} %{rpmcppflags}" \
307         CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}"
308
309 %install
310 rm -rf $RPM_BUILD_ROOT
311 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/{themes,locales,plugins,extensions,resources},%{_mandir}/man1,%{_pixmapsdir},%{_desktopdir}}
312
313 cd src/out/%{!?debug:Release}%{?debug:Debug}
314 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
315 %{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
316 cp -a *.pak locales resources $RPM_BUILD_ROOT%{_libdir}/%{name}
317 cp -p chrome.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
318 install -p chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name}
319 install -p chrome_sandbox $RPM_BUILD_ROOT%{_libdir}/%{name}/chromium-sandbox
320 %if %{with ffmpegsumo}
321 install -p libffmpegsumo.so $RPM_BUILD_ROOT%{_libdir}/%{name}
322 %endif
323 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}
324 cd -
325
326 cp -p src/chrome/app/theme/chromium/product_logo_48.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
327
328 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins -b <<'EOF'
329 # http://code.google.com/p/chromium/issues/detail?id=24507
330 gecko-mediaplayer*.so
331 EOF
332
333 # find locales
334 %find_lang %{name}.lang
335 # always package en-US
336 %{__sed} -i -e '/en-US.pak/d' %{name}.lang
337
338 %clean
339 rm -rf $RPM_BUILD_ROOT
340
341 %post
342 %update_desktop_database
343 %update_browser_plugins
344
345 %postun
346 if [ "$1" = 0 ]; then
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 %{_pixmapsdir}/%{name}.png
357 %{_desktopdir}/*.desktop
358 %dir %{_libdir}/%{name}
359 %{_libdir}/%{name}/chrome.pak
360 %{_libdir}/%{name}/resources.pak
361 %dir %{_libdir}/%{name}/locales
362 %{_libdir}/%{name}/locales/en-US.pak
363 %dir %{_libdir}/%{name}/resources
364 %{_libdir}/%{name}/resources/inspector
365 %dir %{_libdir}/%{name}/themes
366 %dir %{_libdir}/%{name}/extensions
367 %dir %{_libdir}/%{name}/plugins
368 %attr(755,root,root) %{_libdir}/%{name}/%{name}
369 # These unique permissions are intentional and necessary for the sandboxing
370 %attr(4555,root,root) %{_libdir}/%{name}/chromium-sandbox
371
372 # ffmpeg libs
373 %if %{with ffmpegsumo}
374 %attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so
375 %endif
376
377 %files l10n -f %{name}.lang
378 %defattr(644,root,root,755)
This page took 0.079752 seconds and 3 git commands to generate.