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