]> git.pld-linux.org Git - packages/chromium-browser.git/blob - chromium-browser.spec
- up to 14.0.796.0-0.89573
[packages/chromium-browser.git] / chromium-browser.spec
1 #
2 # Conditional build:
3 %bcond_with     verbose         # verbose build (V=1)
4 %bcond_with     selinux         # with SELinux (need policy first)
5 %bcond_with     shared_libs     # with shared libs
6 %bcond_with     sse2            # use SSE2 instructions
7 %bcond_with     system_sqlite   # with system sqlite
8 %bcond_with     system_v8       # with system v8
9 %bcond_without  ffmpegsumo      # build with ffmpegsumo
10 %bcond_without  sandboxing      # with sandboxing
11 %bcond_without  system_zlib     # with system zlib
12 %bcond_without  keyring         # with keyring support (gnome-keyring dlopened, kwalletd via dbus)
13 %bcond_without  debuginfo       # disable debuginfo creation (it is huge)
14
15 # TODO
16 # - check system sqlite linking problems
17
18 # NOTES:
19 # - mute BEEP mixer if you do not want to hear horrible system bell when
20 #   pressing home/end in url bar or more ^F search results on page.
21 # - build i686: -bp: ~570MB; bc: ~928MB; -bb: ~1.0GB
22 # - build x86_64: -bp: ~570MB; bc: ~990MB; -bb: ~1.0GB
23 # - http://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites
24 # - to look for new tarball, use update-source.sh script
25
26 # NOTE TO USERS:
27 # To use chromium nightly builds for pld-th save to /etc/poldek/repos.d (as chromium-nightly.conf):
28 # http://carme.pld-linux.org/~glen/chromium-browser/th/i686/chromium-nightly.conf
29 # or:
30 # http://carme.pld-linux.org/~glen/chromium-browser/th/x86_64/chromium-nightly.conf
31
32 %define         svndate 20110617
33 %define         svnver  89573
34 %define         rel     1
35
36 Summary:        A WebKit powered web browser
37 Name:           chromium-browser
38 Version:        14.0.796.0
39 Release:        0.%{svnver}.%{rel}
40 License:        BSD, LGPL v2+ (ffmpeg)
41 Group:          X11/Applications/Networking
42 Source0:        http://ppa.launchpad.net/chromium-daily/ppa/ubuntu/pool/main/c/chromium-browser/%{name}_%{version}~svn%{svndate}r%{svnver}.orig.tar.gz
43 # Source0-md5:  1aa753bd81120eaaf75012f32bc5c408
44 Source2:        %{name}.sh
45 Source3:        %{name}.desktop
46 Source4:        find-lang.sh
47 Source5:        update-source.sh
48 Patch0:         system-libs.patch
49 Patch1:         plugin-searchdirs.patch
50 Patch2:         gyp-system-minizip.patch
51 Patch3:         disable_dlog_and_dcheck_in_release_builds.patch
52 # http://aur.archlinux.org/packages/chromium-browser-svn/chromium-browser-svn/search-workaround.patch
53 Patch4:         search-workaround.patch
54 Patch5:         options-support.patch
55 Patch6:         get-webkit_revision.patch
56 Patch7:         dlopen_sonamed_gl.patch
57 Patch8:         chromium_useragent.patch.in
58 Patch9:         %{name}-tcmalloc.patch
59 URL:            http://code.google.com/chromium/
60 BuildRequires:  GConf2-devel
61 BuildRequires:  OpenGL-GLU-devel
62 BuildRequires:  alsa-lib-devel
63 BuildRequires:  atk-devel
64 BuildRequires:  bison
65 BuildRequires:  bzip2-devel
66 BuildRequires:  cups-devel
67 BuildRequires:  dbus-glib-devel
68 BuildRequires:  flex
69 BuildRequires:  fontconfig-devel
70 BuildRequires:  glib2-devel
71 BuildRequires:  gperf
72 BuildRequires:  gtk+2-devel
73 BuildRequires:  libevent-devel
74 %{?with_keyring:BuildRequires:  libgnome-keyring-devel}
75 BuildRequires:  libicu-devel >= 4.6
76 BuildRequires:  libjpeg-devel
77 BuildRequires:  libpng-devel
78 %{?with_selinux:BuildRequires:  libselinux-devel}
79 BuildRequires:  libstdc++-devel
80 BuildRequires:  libvpx-devel >= 0.9.5-2
81 BuildRequires:  libxml2-devel
82 BuildRequires:  libxslt-devel
83 BuildRequires:  lzma
84 BuildRequires:  minizip-devel
85 BuildRequires:  nspr-devel
86 BuildRequires:  nss-devel >= 1:3.12.3
87 BuildRequires:  pam-devel
88 BuildRequires:  pango-devel
89 BuildRequires:  perl-modules
90 BuildRequires:  pkgconfig
91 BuildRequires:  python
92 BuildRequires:  rpm >= 4.4.9-56
93 # grep googlecode_url.*gyp src/DEPS |cut -d'"' -f6 | cut -d@ -f2
94 BuildRequires:  python-gyp >= 1-840
95 BuildRequires:  python-modules
96 BuildRequires:  rpmbuild(macros) >= 1.453
97 BuildRequires:  sqlite3-devel >= 3.6.1
98 BuildRequires:  util-linux
99 %{?with_system_v8:BuildRequires:        v8-devel}
100 BuildRequires:  which
101 BuildRequires:  xorg-lib-libXScrnSaver-devel
102 BuildRequires:  xorg-lib-libXt-devel
103 BuildRequires:  xorg-lib-libXtst-devel
104 BuildRequires:  yasm
105 %{?with_system_zlib:BuildRequires:      zlib-devel}
106 Requires:       browser-plugins >= 2.0
107 Requires:       libvpx >= 0.9.5-2
108 Requires:       xdg-utils >= 1.0.2-4
109 Provides:       wwwbrowser
110 Obsoletes:      chromium-browser-bookmark_manager
111 ExclusiveArch:  %{ix86} %{x8664} arm
112 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
113
114 %define         find_lang       sh find-lang.sh %{buildroot}
115
116 %if %{without debuginfo}
117 %define         _enable_debug_packages  0
118 %endif
119
120 %description
121 Chromium is an open-source browser project that aims to build a safer,
122 faster, and more stable way for all Internet users to experience the
123 web.
124
125 Chromium serves as a base for Google Chrome, which is Chromium
126 rebranded (name and logo) with very few additions such as usage
127 tracking and an auto-updater system.
128
129 %package inspector
130 Summary:        Page inspector for the chromium-browser
131 Group:          Development/Tools
132 Requires:       %{name} = %{version}-%{release}
133
134 %description inspector
135 Chromium is an open-source browser project that aims to build a safer,
136 faster, and more stable way for all Internet users to experience the
137 web.
138
139 This package contains 'inspector', allowing web developpers to inspect
140 any element of a web page at runtime (html, javascript, css, ..)
141
142 %package l10n
143 Summary:        chromium-browser language packages
144 Group:          I18n
145 Requires:       %{name} = %{version}-%{release}
146
147 %description l10n
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 This package contains language packages for 50 languages:
153
154 ar, bg, bn, ca, cs, da, de, el, en-GB, es-419, es, et, fi, fil, fr,
155 gu, he, hi, hr, hu, id, it, ja, kn, ko, lt, lv, ml, mr, nb, nl, or,
156 pl, pt-BR, pt-PT, ro, ru, sk, sl, sr, sv, ta, te, th, tr, uk, vi,
157 zh-CN, zh-TW
158
159 %prep
160 %setup -q -n %{name}-%{version}~svn%{svndate}r%{svnver}
161 lzma -dc %{name}-%{version}~svn%{svndate}r%{svnver}-source.tar.lzma | tar x
162 rm -f %{name}-%{version}~svn%{svndate}r%{svnver}-source.tar.lzma
163
164 # Google's versioning is interesting. They never reset "BUILD", which is how we jumped
165 # from 3.0.201.0 to 4.0.202.0 as they moved to a new major branch
166 . ./src/chrome/VERSION
167 ver=$MAJOR.$MINOR.$BUILD.$PATCH
168 if [ "$ver" != %{version} ]; then
169         exit 1
170 fi
171
172 # Populate the LASTCHANGE file template as we no longer have the VCS files at this point
173 echo "%{svnver}" > src/build/LASTCHANGE.in
174
175 # add chromium and pld to useragent
176 %define pld_version %(echo %{pld_release} | sed -e 'y/[at]/[AT]/')
177 sed -e 's/@BUILD_DIST@/PLD %{pld_version}/g' \
178     -e 's/@BUILD_DIST_NAME@/PLD/g' \
179     -e 's/@BUILD_DIST_VERSION@/%{pld_version}/g' \
180     < %{PATCH8} | %{__patch} -p1
181
182 %{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE4} > find-lang.sh
183
184 %patch0 -p1
185 %patch1 -p1
186 %patch2 -p1
187 %patch3 -p1
188 %patch4 -p1
189 %patch5 -p1
190 %patch6 -p1
191 %patch7 -p1
192
193 %patch9 -p1
194
195 # drop bundled libs, from gentoo
196 remove_bundled_lib() {
197         echo "Removing bundled library $1 ..."
198         local out
199         out=$(find $1 -mindepth 1 ! -iname '*.gyp' -print -delete)
200         if [ -z "$out" ]; then
201                 echo >&2 "No files matched when removing bundled library $1"
202                 exit 1
203         fi
204 }
205
206 cd src
207 remove_bundled_lib "third_party/bzip2"
208 remove_bundled_lib "third_party/icu"
209 remove_bundled_lib "third_party/libevent"
210 remove_bundled_lib "third_party/libjpeg"
211 remove_bundled_lib "third_party/libpng"
212 # third_party/libvpx/libvpx.h should be kept
213 #remove_bundled_lib "third_party/libvpx"
214 remove_bundled_lib "third_party/libxml"
215 remove_bundled_lib "third_party/libxslt"
216 remove_bundled_lib "third_party/zlib"
217
218 %build
219 cd src
220 %{__python} build/gyp_chromium --format=make build/all.gyp \
221 %ifarch %{ix86}
222         -Dtarget_arch=ia32 \
223 %endif
224 %ifarch %{x8664}
225         -Dtarget_arch=x64 \
226 %endif
227 %if "%{cc_version}" >= "4.4.0" && "%{cc_version}" < "4.5.0"
228         -Dno_strict_aliasing=1 -Dgcc_version=44 \
229 %endif
230 %if %{with sandboxing}
231         -Dlinux_sandbox_path=%{_libdir}/%{name}/chromium-sandbox \
232         -Dlinux_sandbox_chrome_path=%{_libdir}/%{name}/%{name} \
233 %endif
234         %{!?debug:-Dwerror=} \
235         %{!?debuginfo:-Dfastbuild=1} \
236         %{?with_shared_libs:-Dlibrary=shared_library} \
237         -Djavascript_engine=%{?with_system_v8:system-v8}%{!?with_system_v8:v8} \
238         -Dbuild_ffmpegsumo=%{?with_ffmpegsumo:1}%{!?with_ffmpegsumo:0} \
239         -Duse_system_bzip2=1 \
240         -Duse_system_icu=1 \
241         -Duse_system_libevent=1 \
242         -Duse_system_libjpeg=1 \
243         -Duse_system_libpng=1 \
244         -Duse_system_libxml=1 \
245         -Duse_system_libxslt=1 \
246         -Duse_system_sqlite=%{?with_system_sqlite:1}%{!?with_system_sqlite:0} \
247         -Duse_system_vpx=1 \
248         -Duse_system_xdg_utils=1 \
249         -Duse_system_yasm=1 \
250         -Duse_system_zlib=%{?with_system_zlib:1}%{!?with_system_zlib:0} \
251         -Dffmpeg_branding=Chrome \
252         -Dproprietary_codecs=1 \
253 %if %{with keyring}
254         -Duse_gnome_keyring=1 -Dlinux_link_gnome_keyring=0 \
255 %else
256         -Duse_gnome_keyring=0 \
257 %endif
258         %{!?with_sse2:-Ddisable_sse2=1} \
259 %if %{with selinux}
260         -Dselinux=1 \
261 %endif
262
263 %{__make} chrome %{?with_sandboxing:chrome_sandbox} \
264         BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
265         %{?with_verbose:V=1} \
266         CC="%{__cc}" \
267         CXX="%{__cxx}" \
268         CC.host="%{__cc}" \
269         CXX.host="%{__cxx}" \
270         CFLAGS="%{rpmcflags} %{rpmcppflags}" \
271         CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}"
272
273 %install
274 rm -rf $RPM_BUILD_ROOT
275 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/{themes,locales,plugins,extensions,resources},%{_mandir}/man1,%{_pixmapsdir},%{_desktopdir}}
276
277 cd src/out/%{!?debug:Release}%{?debug:Debug}
278 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
279 %{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
280 cp -a *.pak locales resources $RPM_BUILD_ROOT%{_libdir}/%{name}
281 cp -p chrome.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
282 install -p chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name}
283 install -p chrome_sandbox $RPM_BUILD_ROOT%{_libdir}/%{name}/chromium-sandbox
284 %if %{with ffmpegsumo}
285 install -p libffmpegsumo.so $RPM_BUILD_ROOT%{_libdir}/%{name}
286 %endif
287 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}
288 cd -
289
290 cp -p src/chrome/app/theme/chromium/product_logo_48.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
291
292 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins -b <<'EOF'
293 # http://code.google.com/p/chromium/issues/detail?id=24507
294 gecko-mediaplayer*.so
295 EOF
296
297 # find locales
298 %find_lang %{name}.lang
299 %{__sed} -i -e '/en-US.pak/d' %{name}.lang
300
301 %clean
302 rm -rf $RPM_BUILD_ROOT
303
304 %post
305 %update_browser_plugins
306
307 %postun
308 if [ "$1" = 0 ]; then
309         %update_browser_plugins
310 fi
311
312 %files -f %{name}.lang
313 %defattr(644,root,root,755)
314 %{_browserpluginsconfdir}/browsers.d/%{name}.*
315 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
316 %attr(755,root,root) %{_bindir}/%{name}
317 %{_mandir}/man1/%{name}.1*
318 %{_pixmapsdir}/%{name}.png
319 %{_desktopdir}/*.desktop
320 %dir %{_libdir}/%{name}
321 %{_libdir}/%{name}/chrome.pak
322 %{_libdir}/%{name}/resources.pak
323 %dir %{_libdir}/%{name}/locales
324 %{_libdir}/%{name}/locales/en-US.pak
325 %dir %{_libdir}/%{name}/resources
326 %dir %{_libdir}/%{name}/themes
327 %dir %{_libdir}/%{name}/extensions
328 %dir %{_libdir}/%{name}/plugins
329 %attr(755,root,root) %{_libdir}/%{name}/%{name}
330 # These unique permissions are intentional and necessary for the sandboxing
331 %attr(4555,root,root) %{_libdir}/%{name}/chromium-sandbox
332
333 # ffmpeg libs
334 %if %{with ffmpegsumo}
335 %attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so
336 %endif
337
338 %files inspector
339 %defattr(644,root,root,755)
340 %{_libdir}/%{name}/resources/inspector
341
342 %files l10n -f %{name}.lang
343 %defattr(644,root,root,755)
This page took 0.047961 seconds and 4 git commands to generate.