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