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