]> git.pld-linux.org Git - packages/chromium-browser.git/blob - chromium-browser.spec
- support %{nil} in svndate
[packages/chromium-browser.git] / chromium-browser.spec
1 #
2 # Conditional build:
3 %bcond_without  debuginfo               # disable debuginfo creation (it is huge)
4 %bcond_without  ffmpegsumo              # build with ffmpegsumo
5 %bcond_with             kerberos                # build with kerberos support (dlopened if support compiled, library names in src/net/http/http_auth_gssapi_posix.cc)
6 %bcond_without  keyring                 # with keyring support (gnome-keyring dlopened, kwalletd via dbus)
7 %bcond_with             nacl                    # build Native Client support
8 %bcond_without  sandboxing              # with sandboxing
9 %bcond_with             selinux                 # with SELinux (need policy first)
10 %bcond_with             shared_libs             # with shared libs
11 %bcond_with             sse2                    # use SSE2 instructions
12 %bcond_without  system_speex    # with system speex
13 %bcond_with             system_sqlite   # with system sqlite
14 %bcond_with             system_v8               # with system v8
15 %bcond_with             system_yasm             # with system yasm
16 %bcond_without  system_zlib             # with system zlib
17 %bcond_with             verbose                 # verbose build (V=1)
18
19 # TODO
20 # - check system sqlite linking problems
21 # - find system deps: find -name '*.gyp*' | xargs grep 'use_system.*=='
22 # - use_system_speex
23 # - use_system_libwebp
24 # - use_system_flac
25 # - use_system_ssl (use_openssl: http://crbug.com/62803)
26 # - use_system_v8
27 # - use_system_ffmpeg
28 # - other defaults: src/build/common.gypi
29
30 # build broken on x86-64 due 32bit exe:
31 # /home/users/glen/rpm/BUILD.x86_64-linux/chromium-browser-15.0.863.0~svn20110826r98379/src/native_client/toolchain/linux_x86_newlib/bin/x86_64-nacl-ar: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped
32 # build broken on x86-32:
33 # /home/users/glen/rpm/BUILD.i686-linux/chromium-browser-15.0.863.0~svn20110826r98379/src/native_client/toolchain/linux_x86_newlib/bin/../lib/gcc/x86_64-nacl/acl/bin/ld: crtbegin.o: No such file: No such file or directory
34
35 # NOTES:
36 # - mute BEEP mixer if you do not want to hear horrible system bell when
37 #   pressing home/end in url bar or more ^F search results on page.
38 # - build -bp: 1.2G
39 # - build i686: -bc: 2.7G; -bb: ~1.0GB
40 # - build x86_64: -bc: ~990MB; -bb: ~1.0GB
41 # - http://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites
42 # - to look for new tarball, use update-source.sh script
43
44 # NOTE TO USERS:
45 # To use chromium nightly builds for pld-th save to /etc/poldek/repos.d (as chromium-nightly.conf):
46 # http://carme.pld-linux.org/~glen/chromium-browser/th/i686/chromium-nightly.conf
47 # or:
48 # http://carme.pld-linux.org/~glen/chromium-browser/th/x86_64/chromium-nightly.conf
49
50 %define         svndate %{nil}
51 %define         svnver  108057
52 %define         rel             1
53
54 %define         gyp_rev 1014
55 Summary:        A WebKit powered web browser
56 Name:           chromium-browser
57 Version:        16.0.912.21
58 Release:        0.%{svnver}.%{rel}
59 License:        BSD, LGPL v2+ (ffmpeg)
60 Group:          X11/Applications/Networking
61 Source0:        http://carme.pld-linux.org/~glen/chromium-browser/src/beta/%{name}_%{version}~r%{svnver}.orig.tar.gz
62 # Source0-md5:  a8c42ee43796b5efb11ca330c420445c
63 #SourceX:       http://ppa.launchpad.net/chromium-daily/ppa/ubuntu/pool/main/c/chromium-browser/%{name}_%{version}~svn%{svndate}r%{svnver}.orig.tar.gz
64 Source2:        %{name}.sh
65 Source3:        %{name}.desktop
66 Source4:        find-lang.sh
67 Source5:        update-source.sh
68 Patch0:         system-libs.patch
69 Patch1:         plugin-searchdirs.patch
70 Patch2:         gyp-system-minizip.patch
71 Patch3:         disable_dlog_and_dcheck_in_release_builds.patch
72 Patch5:         options-support.patch
73 Patch6:         get-webkit_revision.patch
74 Patch7:         dlopen_sonamed_gl.patch
75 Patch8:         chromium_useragent.patch.in
76 URL:            http://www.chromium.org/Home
77 BuildRequires:  GConf2-devel
78 BuildRequires:  OpenGL-GLU-devel
79 BuildRequires:  alsa-lib-devel
80 BuildRequires:  atk-devel
81 BuildRequires:  bison
82 BuildRequires:  bzip2-devel
83 BuildRequires:  cups-devel
84 BuildRequires:  dbus-glib-devel
85 BuildRequires:  flex
86 BuildRequires:  fontconfig-devel
87 BuildRequires:  glib2-devel
88 BuildRequires:  gperf
89 BuildRequires:  gtk+2-devel
90 %{?with_kerberos:BuildRequires: heimdal-devel}
91 BuildRequires:  libevent-devel
92 %{?with_keyring:BuildRequires:  libgnome-keyring-devel}
93 BuildRequires:  libicu-devel >= 4.6
94 BuildRequires:  libjpeg-devel
95 BuildRequires:  libpng-devel
96 %{?with_selinux:BuildRequires:  libselinux-devel}
97 BuildRequires:  libstdc++-devel
98 BuildRequires:  libvpx-devel >= 0.9.5-2
99 BuildRequires:  libxml2-devel
100 BuildRequires:  libxslt-devel
101 BuildRequires:  lzma
102 BuildRequires:  minizip-devel
103 BuildRequires:  nspr-devel
104 BuildRequires:  nss-devel >= 1:3.12.3
105 BuildRequires:  pam-devel
106 BuildRequires:  pango-devel
107 BuildRequires:  perl-modules
108 BuildRequires:  pkgconfig
109 BuildRequires:  pulseaudio-devel
110 BuildRequires:  python
111 #BuildRequires: python-gyp >= 1-%{gyp_rev}
112 BuildRequires:  python-modules
113 BuildRequires:  rpm >= 4.4.9-56
114 BuildRequires:  rpmbuild(macros) >= 1.453
115 %{?with_system_speex:BuildRequires:     speex-devel >= 1:1.2-rc1}
116 BuildRequires:  sqlite3-devel >= 3.6.1
117 BuildRequires:  tar >= 1:1.22
118 BuildRequires:  util-linux
119 %{?with_system_v8:BuildRequires:        v8-devel}
120 BuildRequires:  which
121 BuildRequires:  xorg-lib-libXScrnSaver-devel
122 BuildRequires:  xorg-lib-libXt-devel
123 BuildRequires:  xorg-lib-libXtst-devel
124 %{?with_system_yasm:BuildRequires:      yasm}
125 %{?with_system_zlib:BuildRequires:      zlib-devel}
126 Requires:       browser-plugins >= 2.0
127 Requires:       desktop-file-utils
128 Requires:       libvpx >= 0.9.5-2
129 Requires:       xdg-utils >= 1.0.2-4
130 Provides:       wwwbrowser
131 Obsoletes:      chromium-browser-bookmark_manager < 5.0.388.0
132 Obsoletes:      chromium-browser-inspector < 15.0.863.0
133 ExclusiveArch:  %{ix86} %{x8664} arm
134 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
135
136 %define         find_lang       sh find-lang.sh %{buildroot}
137
138 %if %{without debuginfo}
139 %define         _enable_debug_packages  0
140 %endif
141
142 # undefine if empty, makes prep simplier
143 %if "%{svndate}" == "%{nil}"
144 %undefine       svndate
145 %endif
146
147 %description
148 Chromium is an open-source browser project that aims to build a safer,
149 faster, and more stable way for all Internet users to experience the
150 web.
151
152 Chromium serves as a base for Google Chrome, which is Chromium
153 rebranded (name and logo) with very few additions such as usage
154 tracking and an auto-updater system.
155
156 %package l10n
157 Summary:        chromium-browser language packages
158 Group:          I18n
159 Requires:       %{name} = %{version}-%{release}
160
161 %description l10n
162 Chromium is an open-source browser project that aims to build a safer,
163 faster, and more stable way for all Internet users to experience the
164 web.
165
166 This package contains language packages for 50 languages:
167
168 ar, bg, bn, ca, cs, da, de, el, en-GB, es-419, es, et, fi, fil, fr,
169 gu, he, hi, hr, hu, id, it, ja, kn, ko, lt, lv, ml, mr, nb, nl, or,
170 pl, pt-BR, pt-PT, ro, ru, sk, sl, sr, sv, ta, te, th, tr, uk, vi,
171 zh-CN, zh-TW
172
173 %prep
174 %setup -q -n %{name}-%{version}~%{?svndate:svn%{svndate}}r%{svnver}
175 SRC=%{name}-%{version}~%{?svndate:svn%{svndate}}r%{svnver}-source.tar.*
176 tar xf $SRC
177 %{__rm} $SRC
178
179 # Google's versioning is interesting. They never reset "BUILD", which is how we jumped
180 # from 3.0.201.0 to 4.0.202.0 as they moved to a new major branch
181 . ./src/chrome/VERSION
182 ver=$MAJOR.$MINOR.$BUILD.$PATCH
183 test "$ver" = %{version}
184
185 gyp_rev=$(grep googlecode_url.*gyp src/DEPS | cut -d'"' -f6 | cut -d@ -f2)
186 test "$gyp_rev" = %{gyp_rev} || :
187
188 # Populate the LASTCHANGE file template as we no longer have the VCS files at this point
189 echo "%{svnver}" > src/build/LASTCHANGE.in
190
191 # add chromium and pld to useragent
192 %define pld_version %(echo %{pld_release} | sed -e 'y/[at]/[AT]/')
193 sed -e 's/@BUILD_DIST@/PLD %{pld_version}/g' \
194     -e 's/@BUILD_DIST_NAME@/PLD/g' \
195     -e 's/@BUILD_DIST_VERSION@/%{pld_version}/g' \
196     < %{PATCH8} | %{__patch} -p1
197
198 %{__sed} -e 's,@localedir@,%{_libdir}/%{name},' %{SOURCE4} > find-lang.sh
199
200 %patch0 -p1
201 %patch1 -p1
202 %patch2 -p1
203 %patch3 -p1
204 %patch5 -p1
205 %patch6 -p1
206 %patch7 -p1
207
208 # drop bundled libs, from gentoo
209 remove_bundled_lib() {
210         echo "Removing bundled library $1 ..."
211         local out
212         out=$(find $1 -mindepth 1 ! -iname '*.gyp' -print -delete)
213         if [ -z "$out" ]; then
214                 echo >&2 "No files matched when removing bundled library $1"
215                 exit 1
216         fi
217 }
218
219 cd src
220 remove_bundled_lib "third_party/bzip2"
221 remove_bundled_lib "third_party/icu"
222 remove_bundled_lib "third_party/libevent"
223 remove_bundled_lib "third_party/libjpeg"
224 remove_bundled_lib "third_party/libpng"
225 # third_party/libvpx/libvpx.h should be kept
226 #remove_bundled_lib "third_party/libvpx"
227 remove_bundled_lib "third_party/libxml"
228 remove_bundled_lib "third_party/libxslt"
229 remove_bundled_lib "third_party/zlib"
230 # third_party/yasm/source/patched-yasm/modules/arch/x86/gen_x86_insn.py', needed by `out/Release/obj/gen/third_party/yasm/x86insns.c'.  Stop.
231 #remove_bundled_lib "third_party/yasm"
232
233 %build
234 cd src
235 %{__python} build/gyp_chromium --format=make build/all.gyp \
236 %ifarch %{ix86}
237         -Dtarget_arch=ia32 \
238 %endif
239 %ifarch %{x8664}
240         -Dtarget_arch=x64 \
241 %endif
242 %if "%{cc_version}" >= "4.4.0" && "%{cc_version}" < "4.5.0"
243         -Dno_strict_aliasing=1 -Dgcc_version=44 \
244 %endif
245 %if %{with sandboxing}
246         -Dlinux_sandbox_path=%{_libdir}/%{name}/chromium-sandbox \
247         -Dlinux_sandbox_chrome_path=%{_libdir}/%{name}/%{name} \
248 %endif
249         %{!?debug:-Dwerror=} \
250         %{!?debuginfo:-Dfastbuild=1} \
251         %{?with_shared_libs:-Dlibrary=shared_library} \
252         -Djavascript_engine=%{?with_system_v8:system-v8}%{!?with_system_v8:v8} \
253         -Dbuild_ffmpegsumo=%{?with_ffmpegsumo:1}%{!?with_ffmpegsumo:0} \
254         -Dffmpeg_branding=Chrome \
255         -Dproprietary_codecs=1 \
256         %{!?with_nacl:-Ddisable_nacl=1} \
257         %{!?with_sse2:-Ddisable_sse2=1} \
258         %{?with_selinux:-Dselinux=1} \
259         -Duse_system_bzip2=1 \
260         -Duse_system_icu=1 \
261         -Duse_system_libevent=1 \
262         -Duse_system_libjpeg=1 \
263         -Duse_system_libpng=1 \
264         -Duse_system_libxml=1 \
265         -Duse_system_libxslt=1 \
266         -Duse_system_speex=%{?with_system_speex:1}%{!?with_system_speex:0} \
267         -Duse_system_sqlite=%{?with_system_sqlite:1}%{!?with_system_sqlite:0} \
268         -Duse_system_vpx=1 \
269         -Duse_system_xdg_utils=1 \
270         -Duse_system_yasm=%{?with_system_yasm:1}%{!?with_system_yasm:0} \
271         -Duse_system_zlib=%{?with_system_zlib:1}%{!?with_system_zlib:0} \
272 %if %{with kerberos}
273         -Duse_kerberos=1 -Dlinux_link_kerberos=0 \
274 %else
275         -Duse_kerberos=0 \
276 %endif
277 %if %{with keyring}
278         -Duse_gnome_keyring=1 -Dlinux_link_gnome_keyring=0 \
279 %else
280         -Duse_gnome_keyring=0 \
281 %endif
282
283 %{__make} chrome %{?with_sandboxing:chrome_sandbox} \
284         BUILDTYPE=%{!?debug:Release}%{?debug:Debug} \
285         %{?with_verbose:V=1} \
286         CC="%{__cc}" \
287         CXX="%{__cxx}" \
288         CC.host="%{__cc}" \
289         CXX.host="%{__cxx}" \
290         CFLAGS="%{rpmcflags} %{rpmcppflags}" \
291         CXXFLAGS="%{rpmcxxflags} %{rpmcppflags}"
292
293 %install
294 rm -rf $RPM_BUILD_ROOT
295 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/{themes,locales,plugins,extensions,resources},%{_mandir}/man1,%{_pixmapsdir},%{_desktopdir}}
296
297 cd src/out/%{!?debug:Release}%{?debug:Debug}
298 install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}
299 %{__sed} -i -e 's,@libdir@,%{_libdir}/%{name},' $RPM_BUILD_ROOT%{_bindir}/%{name}
300 cp -a *.pak locales resources $RPM_BUILD_ROOT%{_libdir}/%{name}
301 cp -p chrome.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
302 install -p chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/%{name}
303 install -p chrome_sandbox $RPM_BUILD_ROOT%{_libdir}/%{name}/chromium-sandbox
304 %if %{with ffmpegsumo}
305 install -p libffmpegsumo.so $RPM_BUILD_ROOT%{_libdir}/%{name}
306 %endif
307 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_desktopdir}
308 cd -
309
310 cp -p src/chrome/app/theme/chromium/product_logo_48.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
311
312 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins -b <<'EOF'
313 # http://code.google.com/p/chromium/issues/detail?id=24507
314 gecko-mediaplayer*.so
315 EOF
316
317 # find locales
318 %find_lang %{name}.lang
319 %{__sed} -i -e '/en-US.pak/d' %{name}.lang
320
321 %clean
322 rm -rf $RPM_BUILD_ROOT
323
324 %post
325 %update_desktop_database
326 %update_browser_plugins
327
328 %postun
329 if [ "$1" = 0 ]; then
330         %update_browser_plugins
331 fi
332
333 %files -f %{name}.lang
334 %defattr(644,root,root,755)
335 %{_browserpluginsconfdir}/browsers.d/%{name}.*
336 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
337 %attr(755,root,root) %{_bindir}/%{name}
338 %{_mandir}/man1/%{name}.1*
339 %{_pixmapsdir}/%{name}.png
340 %{_desktopdir}/*.desktop
341 %dir %{_libdir}/%{name}
342 %{_libdir}/%{name}/chrome.pak
343 %{_libdir}/%{name}/resources.pak
344 %dir %{_libdir}/%{name}/locales
345 %{_libdir}/%{name}/locales/en-US.pak
346 %dir %{_libdir}/%{name}/resources
347 %{_libdir}/%{name}/resources/inspector
348 %dir %{_libdir}/%{name}/themes
349 %dir %{_libdir}/%{name}/extensions
350 %dir %{_libdir}/%{name}/plugins
351 %attr(755,root,root) %{_libdir}/%{name}/%{name}
352 # These unique permissions are intentional and necessary for the sandboxing
353 %attr(4555,root,root) %{_libdir}/%{name}/chromium-sandbox
354
355 # ffmpeg libs
356 %if %{with ffmpegsumo}
357 %attr(755,root,root) %{_libdir}/%{name}/libffmpegsumo.so
358 %endif
359
360 %files l10n -f %{name}.lang
361 %defattr(644,root,root,755)
This page took 0.114581 seconds and 3 git commands to generate.