chromium-browser-stable/chromium-browser-stable.spec
2015-05-14 15:21:52 +03:00

324 lines
11 KiB
RPMSpec

%global _build_pkgcheck_set %{nil}
%define crname chromium-browser
%define _crdir %{_libdir}/%{crname}
%define _src %{_topdir}/SOURCES
%define chromium_system_libs 0
Name: chromium-browser-stable
Version: 42.0.2311.153
Release: 1
Summary: A fast web browser based on the Blink engine
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
Source32: chromium.default
Source2: chromium-browser.desktop
Source100: icons.tar.bz2
Source997: depot_tools.tar.xz
Source998: gn-binaries.tar.xz
Source999: new-system-icons.tar.xz
Source1000: README.urpmi
Patch4: chromium-30.0.1599.66-master-prefs-path.patch
# PATCH-FIX-UPSTREAM Add more charset aliases
Patch6: chromium-more-codec-aliases.patch
# PATCH-FIX-OPENSUSE Adjust ldflags for better building
Patch8: adjust-ldflags-no-keep-memory.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
# archlinux arm enhancement patches
Patch100: arm-webrtc-fix.patch
Patch101: chromium-arm-r0.patch
Patch102: skia.patch
Patch200: chromium-widevine.patch
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, ninja
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: libxt-devel pam-devel pkgconfig(libgcrypt)
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
BuildRequires: pkgconfig(gconf-2.0)
BuildRequires: chromium-widevinecdm-plugin
Suggests: chromium-browser-pepper-flash
Suggests: chromium-widevinecdm-plugin
Obsoletes: chromium-browser-pdf-plugin < 17.0.0.169
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 web browser based on the Blink engine
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 -a 997 -a 999
%patch4 -p1 -b .prefs
%patch6 -p0
%patch8 -p1
%patch14 -p1
%patch15 -p1
# archlinux arm enhancements
%patch100 -p0
%patch101 -p0
#patch102 -p0
%patch200 -p1
# build with widevine support
WIDEVINE_VERSION=$(rpm -q chromium-widevinecdm-plugin --qf %%{version})
sed -i "s/@WIDEVINE_VERSION@/$WIDEVINE_VERSION/g" third_party/widevine/cdm/widevine_cdm_version.h
WIDEVINE_SUPPORTED_ARCHS="x64 ia32"
for arch in $WIDEVINE_SUPPORTED_ARCHS; do
mkdir -p third_party/widevine/cdm/linux/$arch
cp %{_libdir}/chromium-browser/libwidevinecdm.so third_party/widevine/cdm/widevine_cdm_*.h third_party/widevine/cdm/linux/$arch/
done
# 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
buildconfig+="-Dwerror=
-Dlinux_sandbox_chrome_path=%{_libdir}/%{name}/chrome
-Duse_openssl=0
-Duse_system_ffmpeg=0
-Dbuild_ffmpegsumo=1
-Dproprietary_codecs=1
-Dremove_webcore_debug_symbols=1
-Dlogging_like_official_build=1
-Dlinux_fpic=1
-Ddisable_sse2=1
-Dcomponent=shared_library
-Dclang=0
-Dtoolkit_uses_gtk=0
-Dffmpeg_branding=Chrome
-Ddisable_nacl=1
-Ddisable_glibc=0
-Ddisable_pnacl=1
-Ddisable_newlib_untar=0
-Duse_system_xdg_utils=1
-Duse_aura=1"
%if 0%{?chromium_system_libs}
buildconfig+=" -Duse_system_flac=1
-Duse_system_speex=1
-Duse_system_libexif=1
-Duse_system_libevent=1
-Duse_system_libmtp=1
-Duse_system_opus=1
-Duse_system_bzip2=1
-Duse_system_harfbuzz=1
-Duse_system_libjpeg=1
-Duse_system_libpng=1
-Duse_system_libxslt=1
-Duse_system_libxml=1
-Duse_system_libyuv=1
-Duse_system_nspr=1
-Duse_system_protobuf=1
-Duse_system_yasm=1"
%else
buildconfig+=" -Duse_system_flac=0
-Duse_system_speex=0
-Duse_system_libexif=0
-Duse_system_libevent=0
-Duse_system_libmtp=0
-Duse_system_opus=0
-Duse_system_bzip2=0
-Duse_system_harfbuzz=0
-Duse_system_libjpeg=0
-Duse_system_libpng=0
-Duse_system_libxslt=0
-Duse_system_libxml=0
-Duse_system_libyuv=0
-Duse_system_nspr=0
-Duse_system_protobuf=0
-Duse_system_yasm=0"
%endif
%ifarch x86_64
buildconfig+=" -Dsystem_libdir=lib64
-Dtarget_arch=x64"
%endif
buildconfig+=" -Duse_system_icu=0
-Duse_pulseaudio=1
-Dlinux_link_libpci=1
-Dlinux_link_gnome_keyring=1
-Dlinux_link_gsettings=1
-Dlinux_link_libgps=1
-Dlinux_link_libspeechd=1
-Djavascript_engine=v8
-Dlinux_use_gold_binary=0
-Dlinux_use_gold_flags=0
-Dgoogle_api_key=AIzaSyD1hTe85_a14kr1Ks8T3Ce75rvbR1_Dx7Q
-Dgoogle_default_client_id=4139804441.apps.googleusercontent.com
-Dgoogle_default_client_secret=KDTRKEZk2jwT_7CDpcmMA--P"
build/linux/unbundle/replace_gyp_files.py $buildconfig
export GYP_GENERATORS='ninja'
./build/gyp_chromium build/all.gyp --depth=. $buildconfig
mkdir -p out/Release
ninja -C out/Release chrome
# Build the required SUID_SANDBOX helper
ninja -C out/Release chrome_sandbox
# Build the ChromeDriver test suite
ninja -C out/Release chromedriver
%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/*.pak %{buildroot}%{_crdir}/
install -m 644 out/Release/icudtl.dat %{buildroot}%{_crdir}/
cp -a out/Release/*_blob.bin %{buildroot}%{_crdir}/
install -m 755 out/Release/libffmpegsumo.so %{buildroot}%{_crdir}/
# chromium components
mkdir -p %{buildroot}%{_crdir}/lib/
cp -av out/Release/lib/*.so %{buildroot}%{_crdir}/lib/
install -m 644 out/Release/locales/*.pak %{buildroot}%{_crdir}/locales/
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}
sed -i "s!@LIBDIR@!%{_libdir}!g" %{buildroot}%{_crdir}/chromium-wrapper
ln -s %{_crdir}/chromedriver %{buildroot}%{_bindir}/chromedriver
# create global config file
mkdir -p %{buildroot}%{_sysconfdir}/default
install -m644 %{SOURCE32} %{buildroot}%{_sysconfdir}/default/%{crname}
# create pepper dir. talkplugin works fine only if sylinks in pepper
mkdir -p %{buildroot}%{_crdir}/pepper
find out/Release/resources/ -name "*.d" -exec rm {} \;
cp -r out/Release/resources %{buildroot}%{_crdir}
# 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 {} \;
mkdir -p %{buildroot}%{_docdir}/%{name}
install -p -m755 %{SOURCE1000} %{buildroot}%{_docdir}/%{name}
%files -n chromium-browser
%files
%defattr(-,root,root,-)
%config %{_sysconfdir}/%{crname}
%config %{_sysconfdir}/default/%{crname}
%{_bindir}/%{crname}
%{_crdir}/chromium-wrapper
%{_crdir}/chrome
%{_crdir}/chrome-sandbox
%{_crdir}/icudtl.dat
%{_crdir}/libffmpegsumo.so
%{_crdir}/locales
%{_crdir}/lib
%{_crdir}/resources.pak
%{_crdir}/resources
%{_crdir}/chrome_100_percent.pak
%{_crdir}/content_resources.pak
%{_crdir}/keyboard_resources.pak
%{_crdir}/*_blob.bin
%{_crdir}/themes
%{_crdir}/default_apps
%dir %{_crdir}/pepper
%{_mandir}/man1/%{crname}*
%{_datadir}/applications/*.desktop
%{_iconsdir}/hicolor/*/apps/%{crname}.*
%{_docdir}/%{name}/README.urpmi
%files -n chromedriver
%defattr(-,root,root,-)
%doc LICENSE AUTHORS
%{_bindir}/chromedriver
%{_crdir}/chromedriver