]>
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) |
f1b276d4 ER |
5 | %bcond_with system_v8 # with system v8 |
6 | %bcond_without system_zlib # with system zlib | |
7 | %bcond_with system_sqlite # with system sqlite | |
8 | %bcond_with system_ffmpeg # with system ffmpeg_mt | |
9 | %bcond_without sandboxing # with sandboxing | |
10 | %bcond_with shared_libs # with shared libs | |
0c480b89 | 11 | |
6d92f81c | 12 | # TODO |
f1b276d4 | 13 | # - check system sqlite linking problems |
2351db3b | 14 | |
e53ecfb5 | 15 | # NOTES: |
f1b276d4 ER |
16 | # - use nosource until the package is ready to be stbr, no point poisioning distfiles |
17 | # - build i686: -bp: ~570MB; bc: ~928MB; -bb: ~1.0GB | |
18 | # - build x86_64: -bp: ~570MB; bc: ~990MB; -bb: ~1.0GB | |
19 | # - http://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites | |
20 | # - lynx -dump http://ppa.launchpad.net/chromium-daily/ppa/ubuntu/pool/main/c/chromium-browser/ | grep orig.tar.gz | |
21 | ||
22 | %define svndate 20100202 | |
23 | %define svnver 37790 | |
ea5832be | 24 | %define rel 1 |
11ad81c4 | 25 | |
11ad81c4 | 26 | Summary: A WebKit powered web browser |
05f72ae2 | 27 | Name: chromium-browser |
f1b276d4 ER |
28 | Version: 5.0.313.0 |
29 | Release: 0.%{svnver}.%{rel} | |
05f72ae2 | 30 | License: BSD, LGPL v2+ (ffmpeg) |
e53ecfb5 | 31 | Group: X11/Applications/Networking |
f1b276d4 | 32 | Source0: http://ppa.launchpad.net/chromium-daily/ppa/ubuntu/pool/main/c/chromium-browser/%{name}_%{version}~svn%{svndate}r%{svnver}.orig.tar.gz |
ea5832be | 33 | # Source0-md5: 49d2d8f289facc215566a4f1aec37cb9 |
8b53130d ER |
34 | Source2: %{name}.sh |
35 | Source3: %{name}.desktop | |
589d90ea | 36 | Source4: find-lang.sh |
48b341f5 | 37 | Patch0: system-libs.patch |
38 | Patch1: plugin-searchdirs.patch | |
39 | Patch2: gyp-system-minizip.patch | |
40 | Patch5: options-support.patch | |
41 | Patch11: memory_details-iceweasel.patch | |
42 | Patch12: libpng14.patch | |
f1b276d4 | 43 | URL: http://code.google.com/chromium/ |
05f72ae2 | 44 | BuildRequires: GConf2-devel |
f1b276d4 | 45 | BuildRequires: OpenGL-GLU-devel |
05f72ae2 ER |
46 | BuildRequires: alsa-lib-devel |
47 | BuildRequires: atk-devel | |
48 | BuildRequires: bison | |
11ad81c4 | 49 | BuildRequires: bzip2-devel |
05f72ae2 | 50 | BuildRequires: dbus-devel |
11ad81c4 | 51 | BuildRequires: flex |
11ad81c4 | 52 | BuildRequires: fontconfig-devel |
f1b276d4 | 53 | BuildRequires: glib2-devel |
05f72ae2 | 54 | BuildRequires: gperf |
8b53130d | 55 | BuildRequires: gtk+2-devel |
05f72ae2 ER |
56 | BuildRequires: libevent-devel |
57 | BuildRequires: libjpeg-devel | |
58 | BuildRequires: libpng-devel | |
e266589e | 59 | %{?with_selinux:BuildRequires: libselinux-devel} |
05f72ae2 | 60 | BuildRequires: libstdc++-devel |
f1b276d4 | 61 | BuildRequires: libxml2-devel |
11ad81c4 | 62 | BuildRequires: libxslt-devel |
f1b276d4 | 63 | BuildRequires: lzma |
11ad81c4 | 64 | BuildRequires: minizip-devel |
05f72ae2 | 65 | BuildRequires: nspr-devel |
f1b276d4 ER |
66 | BuildRequires: nss-devel >= 1:3.12.3 |
67 | BuildRequires: pango-devel | |
48b341f5 | 68 | BuildRequires: perl-modules |
69 | BuildRequires: pkgconfig | |
f1b276d4 ER |
70 | BuildRequires: python |
71 | BuildRequires: python-gyp >= 0.1-0.770 | |
48b341f5 | 72 | BuildRequires: python-modules |
f1b276d4 ER |
73 | BuildRequires: rpmbuild(macros) >= 1.453 |
74 | BuildRequires: sqlite3-devel >= 3.6.1 | |
e79c688f | 75 | %{?with_system_v8:BuildRequires: v8-devel} |
f1b276d4 ER |
76 | BuildRequires: xorg-lib-libXScrnSaver-devel |
77 | %{?with_system_zlib:BuildRequires: zlib-devel} | |
e53ecfb5 ER |
78 | Requires: browser-plugins >= 2.0 |
79 | Provides: wwwbrowser | |
2351db3b | 80 | ExclusiveArch: %{ix86} %{x8664} arm |
11ad81c4 | 81 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
11ad81c4 | 82 | |
589d90ea ER |
83 | %define find_lang sh find-lang.sh %{buildroot} |
84 | ||
11ad81c4 AM |
85 | %description |
86 | Chromium is an open-source web browser, powered by WebKit. | |
87 | ||
f1b276d4 ER |
88 | %package inspector |
89 | Summary: Page inspector for the chromium-browser | |
90 | Group: Development/Tools | |
91 | Requires: %{name} = %{version}-%{release} | |
05f72ae2 | 92 | |
f1b276d4 ER |
93 | %description inspector |
94 | Chromium is an open-source browser project that aims to build a safer, | |
95 | faster, and more stable way for all Internet users to experience the | |
96 | web. | |
97 | ||
98 | This package contains 'inspector', allowing web developpers to inspect | |
99 | any element of a web page at runtime (html, javascript, css, ..) | |
100 | ||
101 | %package l10n | |
102 | Summary: chromium-browser language packages | |
103 | Group: I18n | |
104 | Requires: %{name} = %{version}-%{release} | |
105 | ||
106 | %description l10n | |
107 | Chromium is an open-source browser project that aims to build a safer, | |
108 | faster, and more stable way for all Internet users to experience the | |
109 | web. | |
110 | ||
111 | This package contains language packages for 50 languages: | |
112 | ||
113 | ar, bg, bn, ca, cs, da, de, el, en-GB, es-419, es, et, fi, fil, fr, | |
114 | gu, he, hi, hr, hu, id, it, ja, kn, ko, lt, lv, ml, mr, nb, nl, or, | |
115 | pl, pt-BR, pt-PT, ro, ru, sk, sl, sr, sv, ta, te, th, tr, uk, vi, | |
116 | zh-CN, zh-TW | |
117 | ||
118 | %prep | |
119 | %setup -q -n %{name}-%{version}~svn%{svndate}r%{svnver} | |
120 | lzma -dc %{name}-%{version}~svn%{svndate}r%{svnver}-source.tar.lzma | tar x | |
121 | rm -f %{name}-%{version}~svn%{svndate}r%{svnver}-source.tar.lzma | |
589d90ea | 122 | |
05f72ae2 ER |
123 | # Google's versioning is interesting. They never reset "BUILD", which is how we jumped |
124 | # from 3.0.201.0 to 4.0.202.0 as they moved to a new major branch | |
0c480b89 ER |
125 | . ./src/chrome/VERSION |
126 | ver=$MAJOR.$MINOR.$BUILD.$PATCH | |
05f72ae2 ER |
127 | if [ "$ver" != %{version} ]; then |
128 | exit 1 | |
129 | fi | |
130 | ||
f1b276d4 ER |
131 | # Populate the LASTCHANGE file template as we no longer have the VCS files at this point |
132 | echo "%{svnver}" > src/build/LASTCHANGE.in | |
133 | ||
134 | sed -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE4} > find-lang.sh | |
135 | ||
05f72ae2 ER |
136 | %patch0 -p1 |
137 | %patch1 -p1 | |
138 | %patch2 -p1 | |
05f72ae2 | 139 | %patch5 -p1 |
ed58dfe0 | 140 | %patch11 -p1 |
f1b276d4 | 141 | %patch12 -p1 |
0c480b89 | 142 | |
e266589e | 143 | %build |
f1b276d4 ER |
144 | cd src |
145 | %{__python} build/gyp_chromium --format=make build/all.gyp \ | |
146 | %ifarch %{ix86} | |
147 | -Dtarget_arch=ia32 \ | |
148 | %endif | |
149 | %ifarch %{x8664} | |
0c480b89 ER |
150 | -Dtarget_arch=x64 \ |
151 | %endif | |
f1b276d4 ER |
152 | %if "%{cc_version}" >= "4.4.0" |
153 | -Dno_strict_aliasing=1 -Dgcc_version=44 \ | |
154 | %endif | |
155 | %if %{with sandboxing} | |
156 | -Dlinux_sandbox_path=%{_libdir}/%{name}/chromium-sandbox \ | |
157 | -Dlinux_sandbox_chrome_path=%{_libdir}/%{name}/%{name} \ | |
158 | %endif | |
159 | %{!?debug:-Dwerror=} \ | |
160 | %{?with_shared_libs:-Dlibrary=shared_library} \ | |
161 | -Djavascript_engine=%{?with_system_v8:system-v8}%{!?with_system_v8:v8} \ | |
0c480b89 | 162 | -Duse_system_bzip2=1 \ |
f1b276d4 ER |
163 | -Duse_system_ffmpeg=%{?with_system_ffmpeg:1}%{!?with_system_ffmpeg:0} \ |
164 | -Duse_system_libevent=1 \ | |
0c480b89 | 165 | -Duse_system_libjpeg=1 \ |
f1b276d4 ER |
166 | -Duse_system_libpng=1 \ |
167 | -Duse_system_libxml=1 \ | |
168 | -Duse_system_libxslt=1 \ | |
169 | -Duse_system_sqlite=%{?with_system_sqlite:1}%{!?with_system_sqlite:0} \ | |
170 | -Duse_system_zlib=%{?with_system_zlib:1}%{!?with_system_zlib:0} \ | |
171 | %if %{with arch} | |
172 | -Duse_system_yasm=1 \ | |
173 | -Dffmpeg_branding=Chrome \ | |
174 | %endif | |
0c480b89 ER |
175 | %if %{with selinux} |
176 | -Dselinux=1 \ | |
177 | %endif | |
11ad81c4 | 178 | |
f1b276d4 ER |
179 | %{__make} chrome %{?with_sandboxing:chrome_sandbox} \ |
180 | BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \ | |
181 | %{?with_verbose:V=1} \ | |
182 | CC="%{__cc}" \ | |
183 | CXX="%{__cxx}" \ | |
184 | CC.host="%{__cc}" \ | |
185 | CXX.host="%{__cxx}" \ | |
186 | CFLAGS="%{rpmcflags}" \ | |
187 | CXXFLAGS="%{rpmcxxflags}" | |
11ad81c4 AM |
188 | |
189 | %install | |
190 | rm -rf $RPM_BUILD_ROOT | |
f1b276d4 | 191 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/{themes,locales,plugins,extensions,resources},%{_mandir}/man1,%{_pixmapsdir},%{_desktopdir}} |
e266589e | 192 | |
f1b276d4 ER |
193 | cd src/out/%{!?debug:Release}%{?debug:Debug} |
194 | ||
195 | install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name} | |
196 | %{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name} | |
197 | cp -a chrome.pak $RPM_BUILD_ROOT%{_libdir}/%{name} | |
198 | cp -a locales/*.pak $RPM_BUILD_ROOT%{_libdir}/%{name}/locales | |
199 | cp -a resources/* $RPM_BUILD_ROOT%{_libdir}/%{name}/resources | |
200 | find $RPM_BUILD_ROOT%{_libdir}/%{name}/resources -name '*.d' | xargs rm | |
201 | cp -a chrome.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1 | |
202 | cp -a product_logo_48.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png | |
203 | install -p chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name} | |
e53ecfb5 | 204 | install -p chrome_sandbox $RPM_BUILD_ROOT%{_libdir}/%{name}/chromium-sandbox |
f1b276d4 ER |
205 | install -p libffmpegsumo.so $RPM_BUILD_ROOT%{_libdir}/%{name} |
206 | install -p xdg-settings $RPM_BUILD_ROOT%{_libdir}/%{name} | |
207 | cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir} | |
0c480b89 ER |
208 | cd - |
209 | ||
f1b276d4 | 210 | %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins |
11ad81c4 | 211 | |
589d90ea ER |
212 | # find locales |
213 | %find_lang %{name}.lang | |
f1b276d4 | 214 | %{__sed} -i -e '/en-US.pak/d' %{name}.lang |
589d90ea | 215 | |
11ad81c4 AM |
216 | %clean |
217 | rm -rf $RPM_BUILD_ROOT | |
218 | ||
f1b276d4 ER |
219 | %post |
220 | %update_browser_plugins | |
221 | ||
222 | %postun | |
223 | if [ "$1" = 0 ]; then | |
224 | %update_browser_plugins | |
225 | fi | |
226 | ||
589d90ea | 227 | %files -f %{name}.lang |
11ad81c4 | 228 | %defattr(644,root,root,755) |
f1b276d4 ER |
229 | %{_browserpluginsconfdir}/browsers.d/%{name}.* |
230 | %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist | |
231 | %attr(755,root,root) %{_bindir}/%{name} | |
232 | %{_mandir}/man1/%{name}.1* | |
233 | %{_pixmapsdir}/%{name}.png | |
11ad81c4 | 234 | %{_desktopdir}/*.desktop |
0c480b89 ER |
235 | %dir %{_libdir}/%{name} |
236 | %{_libdir}/%{name}/chrome.pak | |
589d90ea | 237 | %dir %{_libdir}/%{name}/locales |
f1b276d4 ER |
238 | %{_libdir}/%{name}/locales/en-US.pak |
239 | %dir %{_libdir}/%{name}/resources | |
240 | %dir %{_libdir}/%{name}/themes | |
241 | %dir %{_libdir}/%{name}/extensions | |
242 | %dir %{_libdir}/%{name}/plugins | |
243 | %attr(755,root,root) %{_libdir}/%{name}/%{name} | |
0c480b89 | 244 | # These unique permissions are intentional and necessary for the sandboxing |
e53ecfb5 | 245 | %attr(4555,root,root) %{_libdir}/%{name}/chromium-sandbox |
f1b276d4 ER |
246 | |
247 | # ffmpeg libs | |
248 | %attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so | |
249 | ||
250 | # bundle this copy until xdg-utils will have this itself | |
251 | %attr(755,root,root) %{_libdir}/%{name}/xdg-settings | |
252 | ||
253 | %files inspector | |
254 | %defattr(644,root,root,755) | |
255 | %{_libdir}/%{name}/resources/inspector | |
256 | ||
257 | %files l10n -f %{name}.lang | |
258 | %defattr(644,root,root,755) |