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