chromium-browser-stable/chromium-browser-stable.spec
2014-02-24 19:07:48 +04:00

270 lines
9.4 KiB
RPMSpec

%define crname chromium-browser
%define _crdir %{_libdir}/%{crname}
%define _src %{_topdir}/SOURCES
Name: chromium-browser-stable
Version: 33.0.1750.117
Release: 1
Summary: A fast webkit-based web browser
Group: Networking/WWW
License: BSD, LGPL
Source0: https://commondatastorage.googleapis.com/chromium-browser-official/chromium-%{version}.tar.xz
Source1: chromium-wrapper
Source30: master_preferences
Source31: default_bookmarks.html
Source2: chromium-browser.desktop
Source100: icons.tar.bz2
Source998: gn-binaries.tar.xz
Patch4: chromium-30.0.1599.66-master-prefs-path.patch
Patch5: chromium-browser-big-icon.patch
# PATCH-FIX-OPENSUSE patches in system glew library
Patch13: chromium-25.0.1364.172-system-glew.patch
# PATCH-FIX-OPENSUSE removes build part for courgette
Patch14: chromium-25.0.1364.172-no-courgette.patch
# PATCH-FIX-OPENSUSE Compile the sandbox with -fPIE settings
Patch15: chromium-25.0.1364.172-sandbox-pie.patch
# PATCH-FIX-OPENSUSE Remove the SVN revision for the chromedriver as that this fails with the tarball
#Patch16: chromium-fix-chromedriver-build.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Provides: %{crname}
Conflicts: chromium-browser-unstable
Conflicts: chromium-browser-beta
Obsoletes: chromium-browser < 1:9.0.597.94
BuildRequires: bison, flex, gtk2-devel, atk-devel, libexpat-devel, gperf
BuildRequires: nspr-devel, nss-devel, libalsa-devel, util-linux
BuildRequires: glib2-devel, bzip2-devel, zlib-devel
BuildRequires: jpeg-devel, pkgconfig(gl), mesaglu-devel
BuildRequires: libxscrnsaver-devel, dbus-glib-devel, cups-devel
BuildRequires: libgnome-keyring-devel libvpx-devel libxtst-devel
BuildRequires: libxslt-devel libxml2-devel libxt-devel pam-devel
BuildRequires: libevent-devel pkgconfig(flac) pulseaudio-devel
BuildRequires: elfutils-devel udev-devel speex-devel yasm
BuildRequires: pkgconfig(harfbuzz) pkgconfig(libmtp) pkgconfig(libgpsd)
BuildRequires: speech-dispatcher-devel pkgconfig(libusb-1.0)
BuildRequires: pkgconfig(libpci) pkgconfig(gstreamer-plugins-base-1.0), gyp
BuildRequires: pkgconfig(opus) pkgconfig(libwebp) pkgconfig(minizip)
BuildRequires: pkgconfig(libexif) cap-devel
ExclusiveArch: i586 x86_64 armv7l
%description
Chromium is a browser that combines a minimal design with sophisticated
technology to make the web faster, safer, and easier.
This is the stable channel Chromium browser. It offers a rock solid
browser which is updated with features and fixes once they have been
thoroughly tested. If you want the latest features, install the
chromium-browser-unstable package instead.
Note: If you are reverting from unstable to stable or beta channel, you may
experience tab crashes on startup. This crash only affects tabs restored
during the first launch due to a change in how tab state is stored.
See http://bugs.chromium.org/34688. It's always a good idea to back up
your profile before changing channels.
%package -n chromium-browser
Summary: A fast webkit-based web browser (transition package)
Epoch: 1
Group: Networking/WWW
Requires: %{name} = %{version}-%{release}
%description -n chromium-browser
Chromium is a browser that combines a minimal design with sophisticated
technology to make the web faster, safer, and easier.
This is a transition package that installs the stable channel Chromium
browser. If you prefer the dev channel browser, install the
chromium-browser-unstable package instead.
%package -n chromedriver
Summary: WebDriver for Google Chrome/Chromium
Group: Development/Other
Requires: %{name} = %{version}-%{release}
%description -n chromedriver
WebDriver is an open source tool for automated testing of webapps across many
browsers. It provides capabilities for navigating to web pages, user input,
JavaScript execution, and more. ChromeDriver is a standalone server which
implements WebDriver's wire protocol for Chromium. It is being developed by
members of the Chromium and WebDriver teams.
%prep
%setup -q -n chromium-%{version} -a 998
%patch4 -p1 -b .prefs
%patch5 -p1 -b .big-icon
%patch13 -p1
%patch14 -p1
%patch15 -p1
# Hard code extra version
FILE=chrome/common/chrome_version_info_posix.cc
sed -i.orig -e 's/getenv("CHROME_VERSION_EXTRA")/"%{product_vendor} %{product_version}"/' $FILE
cmp $FILE $FILE.orig && exit 1
%build
export GYP_GENERATORS=make
./build/gyp_chromium -f make build/all.gyp --depth=. \
-D linux_sandbox_path=%{_crdir}/chrome-sandbox \
-D linux_sandbox_chrome_path=%{_crdir}/chrome \
-D linux_link_gnome_keyring=0 \
-D use_gconf=0 \
-D werror='' \
-D use_system_sqlite=0 \
-D use_system_libxml=1 \
-D use_system_zlib=0 \
-D use_system_bzip2=1 \
-D use_system_libbz2=1 \
-D use_system_xdg_utils=1 \
-D use_system_yasm=1 \
-D use_system_libpng=1 \
-D use_system_libjpeg=1 \
-D use_system_libevent=1 \
-D use_system_speex=1 \
-D use_system_flac=1 \
-D use_system_vpx=1 \
-D use_system_icu=0 \
-D use_system_libusb=1 \
-D use_system_libexif=1 \
-D use_system_libsrtp=0 \
-D use_system_libmtp=1 \
-D use_system_opus=1 \
-D use_system_libwebp=1 \
-D use_system_harfbuzz=1 \
-D use_system_minizip=1 \
-D build_ffmpegsumo=1 \
-D use_system_ffmpeg=0 \
-D ffmpeg_branding=Chrome \
-D proprietary_codecs=1 \
-D use_pulseaudio=1 \
-D use_system_v8=0 \
-D use_system_protobuf=0 \
-D linux_link_libpci=1 \
-D linux_link_gsettings=1 \
-D linux_link_libspeechd=1 \
-D linux_link_kerberos=1 \
-D linux_link_libgps=1 \
-D use_system_libyuv=1 \
-D use_system_libxslt=1 \
-D use_system_nspr=1 \
-D disable_nacl=1 \
-D logging_like_official_build=1 \
-D remove_webcore_debug_symbols=1 \
-D linux_fpic=1 \
-Dgoogle_api_key='AIzaSyD1hTe85_a14kr1Ks8T3Ce75rvbR1_Dx7Q' \
-Dgoogle_default_client_id='4139804441.apps.googleusercontent.com' \
-Dgoogle_default_client_secret='KDTRKEZk2jwT_7CDpcmMA--P' \
%ifarch i586
-D disable_sse2=1 \
-D release_extra_cflags="-march=i586"
%endif
%ifarch armv7l
-D target_arch=arm \
-D disable_nacl=1 \
-D linux_use_tcmalloc=0 \
-D armv7=1 \
-D release_extra_cflags="-marm"
%endif
# Note: DON'T use system sqlite (3.7.3) -- it breaks history search
%make chrome chrome_sandbox chromedriver BUILDTYPE=Release
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_crdir}/locales
mkdir -p %{buildroot}%{_crdir}/themes
mkdir -p %{buildroot}%{_crdir}/default_apps
mkdir -p %{buildroot}%{_mandir}/man1
install -m 755 %{_src}/chromium-wrapper %{buildroot}%{_crdir}/
install -m 755 out/Release/chrome %{buildroot}%{_crdir}/
install -m 4755 out/Release/chrome_sandbox %{buildroot}%{_crdir}/chrome-sandbox
cp -a out/Release/chromedriver %{buildroot}%{_crdir}/chromedriver
install -m 644 out/Release/chrome.1 %{buildroot}%{_mandir}/man1/%{crname}.1
install -m 644 out/Release/chrome.pak %{buildroot}%{_crdir}/
install -m 644 out/Release/chrome_100_percent.pak %{buildroot}%{_crdir}/
install -m 644 out/Release/content_resources.pak %{buildroot}%{_crdir}/
install -m 755 out/Release/libffmpegsumo.so %{buildroot}%{_crdir}/
#%ifnarch armv7l
#install -m 755 out/Release/libppGoogleNaClPluginChrome.so %{buildroot}%{_crdir}/
#install -m 755 out/Release/nacl_helper_bootstrap %{buildroot}%{_crdir}/
#install -m 755 out/Release/nacl_helper %{buildroot}%{_crdir}/
#install -m 644 out/Release/nacl_irt_*.nexe %{buildroot}%{_crdir}/
#%endif
install -m 644 out/Release/locales/*.pak %{buildroot}%{_crdir}/locales/
#install -m 755 out/Release/xdg-mime %{buildroot}%{_crdir}/
#install -m 755 out/Release/xdg-settings %{buildroot}%{_crdir}/
install -m 644 out/Release/resources.pak %{buildroot}%{_crdir}/
install -m 644 chrome/browser/resources/default_apps/* %{buildroot}%{_crdir}/default_apps/
ln -s %{_crdir}/chromium-wrapper %{buildroot}%{_bindir}/%{crname}
ln -s %{_crdir}/chromedriver %{buildroot}%{_bindir}/chromedriver
find out/Release/resources/ -name "*.d" -exec rm {} \;
cp -r out/Release/resources %{buildroot}%{_crdir}
# Strip NaCl IRT
#%ifarch x86_64
#./native_client/toolchain/linux_x86_newlib/bin/x86_64-nacl-strip %{buildroot}%{_crdir}/nacl_irt_x86_64.nexe
#%endif
#%ifarch i586
#./native_client/toolchain/linux_x86_newlib/bin/i686-nacl-strip %{buildroot}%{_crdir}/nacl_irt_x86_32.nexe
#%endif
# desktop file
mkdir -p %{buildroot}%{_datadir}/applications
install -m 644 %{_src}/%{crname}.desktop %{buildroot}%{_datadir}/applications/
# icon
mkdir -p %{buildroot}%{_iconsdir}/hicolor/
tar xjf %{SOURCE100} -C %{buildroot}%{_iconsdir}/hicolor/
mkdir -p %{buildroot}%{_sysconfdir}/%{crname}
install -m 0644 %{SOURCE30} %{buildroot}%{_sysconfdir}/%{crname}/
install -m 0644 %{SOURCE31} %{buildroot}%{_sysconfdir}/%{crname}/
find %{buildroot} -name "*.nexe" -exec strip {} \;
%clean
rm -rf %{buildroot}
%files -n chromium-browser
%files
%defattr(-,root,root,-)
%config %{_sysconfdir}/%{crname}
%{_bindir}/%{crname}
%{_crdir}/chromium-wrapper
%{_crdir}/chrome
%{_crdir}/chrome-sandbox
%{_crdir}/chrome.pak
%{_crdir}/libffmpegsumo.so
#%ifnarch armv7l
#%{_crdir}/libppGoogleNaClPluginChrome.so
#%{_crdir}/nacl_helper_bootstrap
#%{_crdir}/nacl_helper
#%{_crdir}/nacl_irt_*.nexe
#%endif
%{_crdir}/locales
%{_crdir}/resources.pak
%{_crdir}/resources
%{_crdir}/chrome_100_percent.pak
%{_crdir}/content_resources.pak
%{_crdir}/themes
%{_crdir}/default_apps
#%{_crdir}/xdg-mime
#%{_crdir}/xdg-settings
%{_mandir}/man1/%{crname}*
%{_datadir}/applications/*.desktop
%{_iconsdir}/hicolor/*/apps/%{crname}.*
%files -n chromedriver
%defattr(-,root,root,-)
%doc LICENSE AUTHORS
%{_bindir}/chromedriver
%{_crdir}/chromedriver