chromium-browser-stable-sla.../chromium-browser-stable.spec
2018-09-26 00:21:20 +03:00

713 lines
23 KiB
RPMSpec

# This spec file is based on other spec files, ebuilds, PKGBUILDs available from
# [1] https://repos.fedorapeople.org/repos/spot/chromium/
# [2] https://copr.fedoraproject.org/coprs/churchyard/chromium-russianfedora-tested/
# [3] https://www.archlinux.org/packages/extra/x86_64/chromium/
# [4] https://src.fedoraproject.org/rpms/chromium/
# [5] https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/
# Get the version number of latest stable version
# $ curl -s 'https://omahaproxy.appspot.com/all?os=linux&channel=stable' | sed 1d | cut -d , -f 3
%global _build_pkgcheck_set %{nil}
# eol 'fix' corrupts some .bin
%define dont_fix_eol 1
%define _disable_lto 1
%define crname chromium-browser
%define _crdir %{_libdir}/%{crname}
%define _src %{_topdir}/SOURCES
%define chromium_system_libs 1
%define ffmpeg 1
%define icu 0
%define libva 1
%define clang 1
%define jsoncpp 0
# Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys
# Note: these are for Mageia use ONLY.
# For your own builds, please get your own set of keys.
%define google_api_key AIzaSyDhhIHB_kQZodiWr8yDAm8E3GwEyiXmuDU
%define google_default_client_id 1039996407057-q599ngv7i6ni4sbkd2fsns30246r9s9v.apps.googleusercontent.com
%define google_default_client_secret mRHXPjlS4cLpp1beCiXoYbLZ
Summary: A fast web browser based on the Blink engine
Name: chromium-browser-stable
Version: 69.0.3497.100
Release: 1
License: BSD, LGPL
Group: Networking/WWW
Url: https://www.chromium.org/Home
Source0: https://commondatastorage.googleapis.com/chromium-browser-official/chromium-%{version}.tar.xz
Source1: chromium-wrapper
Source2: chromium-browser.desktop
# Setup toolchain for rosa builds, from gentoo
# https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/files/toolchain/BUILD.gn
Source5: BUILD.gn
Source10: %{name}.rpmlintrc
Source30: master_preferences
Source31: default_bookmarks.html
Source32: chromium.default
Source100: icons.tar.bz2
Source997: depot_tools.tar.xz
Source999: new-system-icons.tar.xz
Patch4: chromium-30.0.1599.66-master-prefs-path.patch
Patch22: chromium-54-proprietary-codecs-assert.patch
%if 0%{jsoncpp}
# (cjw) add missing unbundle gn files (1)
Patch28: chromium-53-gn-system-icu-jsoncpp.patch
%endif
# (cjw) build pdfium with system libtiff and libpng
Patch30: chromium-52-pdfium-system-libtiff-libpng.patch
# (cjw) Recognize mimetypes for matroska (.mkv) and AVI (.avi) formats (video/x-matroska and audio/x-matroska, video/x-msvideo) + handle A52 "AC3" and DTS compressed audio.
Patch32: chromium-55-extra-media.patch
# (cjw) fix webrtc build with system ffmpeg
Patch35: chromium-50-system-ffmpeg-3.patch
# (cjw) fix build with current glib...
Patch36: chromium-58-glib.patch
# clang builtin subtract functions, scoped enum
Patch47: chromium-61-gcc5.patch
# New from Debian
Patch500: chromium-third-party-cookies-off-by-default.patch
Patch501: chromium-ps-print.patch
# Google patched their bundled copy of icu 54 to include API functionality that wasn't added until 55.
# :P
Patch502: chromium-45.0.2454.101-system-icu-54-does-not-have-detectHostTimeZone.patch
# Patch to fix build with use_system_libvpx
# Chromium bug #541273
# fix build with icu other than 54
Patch504: chromium-system-icu-r0.patch
# https://aur.archlinux.org/packages/chromium-vaapi/
Patch508: chromium-vaapi-r20.patch
Patch509: chromium-widevine-r2.patch
# ROSA Build
Patch600: chromium-buildname-60.0.3112.90.patch
# Patch to fix build
Patch601: chromium-62-include-cstdlib.patch
# https://github.com/RussianFedora/chromium/blob/fedora-stable/chromium-66.0.3359.81-system-clang.patch
Patch603: chromium-66.0.3359.81-system-clang.patch
# http://ftp.riken.jp/Linux/gentoo/www-client/chromium/files/
Patch604: chromium-compiler-r4.patch
Patch605: chromium-ffmpeg-ebp-r1.patch
# https://chromium.googlesource.com/chromium/src/+/40a8d84a54ac47d3299194c5377aebd71714f1f0%5E%21/
Patch607: chromium-67.0.3396.87-fix-build-llvm-ar.patch
# /usr/bin/ld.lld: error: undefined symbol: Cr_z_***
Patch626: chromium-68.0.3440.106-linker-build-error.patch
# Add "ROSA" to the user agent string
Patch627: chromium-68.0.3440.106-rosa-user-agent.patch
# Do not prefix libpng functions
Patch629: chromium-60.0.3112.78-no-libpng-prefix.patch
# Fix errors build in 69
Patch631: chromium-69.0.3497.100-build-error-in-clang6.patch
Provides: %{crname} = %{EVRD}
Conflicts: chromium-browser-unstable
Conflicts: chromium-browser-beta
Obsoletes: chromium-browser < 1:9.0.597.94
BuildRequires: bison
%if 0%{?clang}
BuildRequires: clang
BuildRequires: lld
BuildRequires: libcxx-devel
BuildRequires: libcxxabi-devel
%endif
# gn needs these
BuildRequires: libstdc++-static-devel
BuildRequires: flex
BuildRequires: git
BuildRequires: gperf
BuildRequires: gyp
BuildRequires: ninja
BuildRequires: nodejs >= 6.7.0
BuildRequires: util-linux
BuildRequires: yasm
BuildRequires: atomic-devel
BuildRequires: bzip2-devel
BuildRequires: cap-devel
BuildRequires: cups-devel
BuildRequires: elfutils-devel
BuildRequires: jpeg-devel
%if 0%{jsoncpp}
BuildRequires: jsoncpp-devel
%endif
BuildRequires: pam-devel
BuildRequires: snappy-devel
BuildRequires: speech-dispatcher-devel
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(atk)
BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(expat)
%if 0%{?ffmpeg}
BuildRequires: pkgconfig(libavcodec) >= 4.0.2
%endif
BuildRequires: pkgconfig(flac)
BuildRequires: pkgconfig(fontconfig)
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(gconf-2.0)
BuildRequires: pkgconfig(gl)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(glu)
BuildRequires: pkgconfig(gnome-keyring-1)
BuildRequires: pkgconfig(gstreamer-plugins-base-1.0)
BuildRequires: pkgconfig(gtk+-2.0)
BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: pkgconfig(harfbuzz)
%if 0%{icu}
BuildRequires: pkgconfig(icu-i18n)
%endif
BuildRequires: pkgconfig(libexif)
BuildRequires: pkgconfig(libgcrypt)
BuildRequires: pkgconfig(libgpsd)
BuildRequires: pkgconfig(libmtp)
BuildRequires: pkgconfig(libopenjp2)
BuildRequires: pkgconfig(libpci)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(libpulse)
BuildRequires: pkgconfig(libtiff-4)
BuildRequires: pkgconfig(libusb-1.0)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(libxslt)
%if 0%{?libva}
BuildRequires: pkgconfig(libva)
%endif
BuildRequires: pkgconfig(minizip)
BuildRequires: pkgconfig(nspr)
BuildRequires: pkgconfig(nss)
BuildRequires: pkgconfig(opus)
BuildRequires: pkgconfig(speex)
BuildRequires: pkgconfig(udev)
BuildRequires: pkgconfig(xscrnsaver)
BuildRequires: pkgconfig(xt)
BuildRequires: pkgconfig(xtst)
BuildRequires: pkgconfig(zlib)
BuildRequires: pythonegg(beautifulsoup4)
BuildRequires: pythonegg(html5lib)
Suggests: chromium-browser-pepper-flash
Conflicts: chromium-widevinecdm-plugin < 54
Obsoletes: chromium-widevinecdm-plugin < 54
Conflicts: chromium-browser-beta
Conflicts: chromium-browser-unstable
Obsoletes: chromium-browser < 1:9.0.597.94
Obsoletes: chromium-browser-pdf-plugin < 17.0.0.169
Provides: %{crname} = %{EVRD}
ExclusiveArch: %{ix86} 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.
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.
%files
%config %{_sysconfdir}/%{crname}
%config %{_sysconfdir}/default/%{crname}
%{_bindir}/%{crname}
%{_crdir}/chromium-wrapper
%{_crdir}/chrome
%{_crdir}/chrome-sandbox
%{_crdir}/icudtl.dat
%{_crdir}/locales
%{_crdir}/*.pak
%{_crdir}/resources
%{_crdir}/themes
%{_crdir}/default_apps
%{_crdir}/swiftshader
%dir %{_crdir}/pepper
%{_datadir}/applications/*.desktop
%{_iconsdir}/hicolor/*/apps/chromium*
%post
# Remove chromium-browser-install package if we have it installed
if [ `rpm -q chromium-browser-install | wc -w` == 1 ]
then
rpm -e chromium-browser-install
fi
#----------------------------------------------------------------------------
%package -n chromium-browser
Summary: A fast web browser based on the Blink engine
Epoch: 1
Group: Networking/WWW
# No %%{EVRD}
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.
%files -n chromium-browser
#----------------------------------------------------------------------------
%package -n chromedriver
Summary: WebDriver for Google Chrome/Chromium
Group: Development/Other
# No %%{EVRD}
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.
%files -n chromedriver
%doc LICENSE AUTHORS
%{_bindir}/chromedriver
%{_crdir}/chromedriver
#----------------------------------------------------------------------------
%prep
%setup -qn chromium-%{version} -a 997 -a 999
%patch4 -p1 -b .prefs
%patch22 -p1
%if 0%{jsoncpp}
%patch28 -p1
%endif
%patch30 -p1
%patch32 -p1
%if 0%{?ffmpeg}
%patch35 -p1
%endif
%patch36 -p1
%patch47 -p1
# new from debian
%patch500 -p1
%patch501 -p1
%if 0%{icu}
%patch502 -p1 -b .system-icu
%patch504 -p0 -b .icu-ver
%endif
%if 0%{?libva}
%patch508 -p1 -b .vaapi
%endif
%patch509 -p1
%patch600 -p1
%patch601 -p1
%patch603 -p1
%patch604 -p1
%patch605 -p1
%patch607 -p1
%patch626 -p1
%patch627 -p1
%patch629 -p1
%patch631 -p1 -b .clang6
mkdir -p third_party/llvm-build/Release+Asserts/bin
pushd third_party/llvm-build/Release+Asserts/bin
ln -sf /usr/bin/clang clang
ln -sf /usr/bin/clang++ clang++
popd
# Remove most of the bundled libraries. Libraries specified below (taken from
# Gentoo's Chromium ebuild) are the libraries that needs to be preserved.
build/linux/unbundle/remove_bundled_libraries.py \
'buildtools/third_party/libc++' \
'buildtools/third_party/libc++abi' \
'base/third_party/dmg_fp' \
'base/third_party/dynamic_annotations' \
'base/third_party/icu' \
'base/third_party/libevent' \
'base/third_party/nspr' \
'base/third_party/superfasthash' \
'base/third_party/symbolize' \
'base/third_party/valgrind' \
'base/third_party/xdg_mime' \
'base/third_party/xdg_user_dirs' \
'chrome/third_party/mozilla_security_manager' \
'courgette/third_party' \
'net/third_party/http2' \
'net/third_party/mozilla_security_manager' \
'net/third_party/nss' \
'net/third_party/quic' \
'net/third_party/spdy' \
'third_party/WebKit' \
'third_party/abseil-cpp' \
'third_party/adobe' \
'third_party/analytics' \
'third_party/angle' \
'third_party/angle/src/common/third_party/base' \
'third_party/angle/src/common/third_party/smhasher' \
'third_party/angle/src/third_party/compiler' \
'third_party/angle/src/third_party/libXNVCtrl' \
'third_party/angle/src/third_party/trace_event' \
'third_party/angle/third_party/glslang' \
'third_party/angle/third_party/spirv-headers' \
'third_party/angle/third_party/spirv-tools' \
'third_party/angle/third_party/vulkan-headers' \
'third_party/angle/third_party/vulkan-loader' \
'third_party/angle/third_party/vulkan-tools' \
'third_party/angle/third_party/vulkan-validation-layers' \
'third_party/apple_apsl' \
'third_party/blanketjs' \
'third_party/blink' \
'third_party/boringssl' \
'third_party/boringssl/src/third_party/fiat' \
'third_party/breakpad' \
'third_party/breakpad/breakpad/src/third_party/curl' \
'third_party/brotli' \
'third_party/cacheinvalidation' \
'third_party/catapult' \
'third_party/catapult/common/py_vulcanize/third_party/rcssmin' \
'third_party/catapult/common/py_vulcanize/third_party/rjsmin' \
'third_party/catapult/third_party/beautifulsoup4' \
'third_party/catapult/third_party/html5lib-python' \
'third_party/catapult/third_party/polymer' \
'third_party/catapult/third_party/six' \
'third_party/catapult/tracing/third_party/d3' \
'third_party/catapult/tracing/third_party/gl-matrix' \
'third_party/catapult/tracing/third_party/jszip' \
'third_party/catapult/tracing/third_party/mannwhitneyu' \
'third_party/catapult/tracing/third_party/oboe' \
'third_party/catapult/tracing/third_party/pako' \
'third_party/ced' \
'third_party/cld_3' \
'third_party/crashpad' \
'third_party/crashpad/crashpad/third_party/zlib/' \
'third_party/crc32c' \
'third_party/cros_system_api' \
'third_party/devscripts' \
'third_party/dom_distiller_js' \
'third_party/expat' \
'third_party/ffmpeg' \
'third_party/fips181' \
'third_party/flac' \
'third_party/flatbuffers' \
'third_party/flot' \
'third_party/fontconfig' \
'third_party/freetype' \
'third_party/glslang-angle' \
'third_party/google_input_tools' \
'third_party/google_input_tools/third_party/closure_library' \
'third_party/google_input_tools/third_party/closure_library/third_party/closure' \
'third_party/googletest' \
'third_party/harfbuzz-ng' \
'third_party/hunspell' \
'third_party/iccjpeg' \
'third_party/icu' \
'third_party/inspector_protocol' \
'third_party/jinja2' \
'third_party/jstemplate' \
'third_party/khronos' \
'third_party/leveldatabase' \
'third_party/libXNVCtrl' \
'third_party/libaddressinput' \
'third_party/libaom' \
'third_party/libdrm' \
'third_party/libjingle' \
'third_party/libjpeg_turbo' \
'third_party/libphonenumber' \
'third_party/libpng' \
'third_party/libsecret' \
'third_party/libsrtp' \
'third_party/libsync' \
'third_party/libudev' \
'third_party/libusb' \
'third_party/libvpx' \
'third_party/libvpx/source/libvpx/third_party/x86inc' \
'third_party/libxml' \
'third_party/libxml/chromium' \
'third_party/libxslt' \
'third_party/libwebm' \
'third_party/libwebp' \
'third_party/libyuv' \
'third_party/llvm-build' \
'third_party/lss' \
'third_party/lzma_sdk' \
'third_party/markupsafe' \
'third_party/mesa' \
'third_party/metrics_proto' \
'third_party/modp_b64' \
'third_party/node' \
'third_party/node/node_modules/polymer-bundler/lib/third_party/UglifyJS2' \
'third_party/openh264' \
'third_party/openmax_dl' \
'third_party/opus' \
'third_party/ots' \
'third_party/pdfium' \
'third_party/pdfium/third_party/agg23' \
'third_party/pdfium/third_party/base' \
'third_party/pdfium/third_party/bigint' \
'third_party/pdfium/third_party/freetype' \
'third_party/pdfium/third_party/lcms' \
'third_party/pdfium/third_party/libopenjpeg20' \
'third_party/pdfium/third_party/libpng16' \
'third_party/pdfium/third_party/libtiff' \
'third_party/pdfium/third_party/skia_shared' \
'third_party/perfetto' \
'third_party/ply' \
'third_party/polymer' \
'third_party/protobuf' \
'third_party/protobuf/third_party/six' \
'third_party/pyjson5' \
'third_party/qcms' \
'third_party/qunit' \
'third_party/re2' \
'third_party/rnnoise' \
'third_party/s2cellid' \
'third_party/sfntly' \
'third_party/simplejson' \
'third_party/sinonjs' \
'third_party/skia' \
'third_party/skia/third_party/gif' \
'third_party/skia/third_party/skcms' \
'third_party/skia/third_party/vulkan' \
'third_party/smhasher' \
'third_party/snappy' \
'third_party/speech-dispatcher' \
'third_party/spirv-headers' \
'third_party/spirv-tools-angle' \
'third_party/sqlite' \
'third_party/swiftshader' \
'third_party/swiftshader/third_party/subzero' \
'third_party/swiftshader/third_party/LLVM' \
'third_party/swiftshader/third_party/llvm-subzero' \
'third_party/tcmalloc' \
'third_party/test_fonts' \
'third_party/unrar' \
'third_party/usb_ids' \
'third_party/usrsctp' \
'third_party/vulkan' \
'third_party/vulkan-validation-layers' \
'third_party/web-animations-js' \
'third_party/webdriver' \
'third_party/webrtc' \
'third_party/widevine' \
'third_party/woff2' \
'third_party/xdg-utils' \
'third_party/yasm' \
'third_party/zlib' \
'third_party/zlib/google' \
'tools/gn/base/third_party/icu' \
'url/third_party/mozilla' \
'v8/src/third_party/utf8-decoder' \
'v8/src/third_party/valgrind' \
'v8/third_party/antlr4' \
'v8/third_party/inspector_protocol' \
--do-remove
# Remove bundled ICU; its header files appear to get picked up instead of
# the system ones, leading to errors during the final link stage.
# https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/BNGvJc08B6Q
#find third_party/icu -type f \! -regex '.*\.\(gn\|gni\|isolate\)' -delete
# Hard code extra version
FILE=chrome/common/channel_info_posix.cc
sed -i.orig -e 's/getenv("CHROME_VERSION_EXTRA")/"%{product_vendor} %{product_version}"/' $FILE
cmp $FILE $FILE.orig && exit 1
# setup node
mkdir -p third_party/node/linux/node-linux-x64/bin
ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/node
%build
%define system_gn_list ffmpeg flac libxslt snappy yasm libpng zlib
# opus
# icu
# libevent
# libvpx
# libwebp
# System libxml must be built with icu support to be used in Chromium
# libxml
# handled by upstream regular build scripts? : freetype harfbuzz-ng
# jsoncpp
%if %{mdvver} >= 201610
%define use_gold false
%else
%define use_gold true
%endif
%if 0%{clang}
%define is_clang true
%else
%define is_clang false
%endif
# widevinecdmadapter
# Build error with widevinecdmadapter in 67.0.3396.62 (fixed)
%define widevine 1
%if 0%{widevine}
%define is_widevine true
%else
%define is_widevine false
%endif
%define lld 1
%if 0%{lld}
%define is_lld true
%else
%define is_lld false
%endif
# jumbo https://chromium.googlesource.com/chromium/src/+/master/docs/jumbo.md
# (Alzim) 1 - localhost, 0 - ABF build
%define localhost 0
%if 0%{localhost}
%define is_limit 75
%else
%define is_limit 25
%endif
%if 0%{?libva}
%define is_vaapi true
%else
%define is_vaapi false
%endif
# v NO TABS IN HERE!
%define gn_config use_sysroot=false \
system_libdir="%{_lib}" \
icu_use_data_file=true \
enable_nacl=false \
is_nacl_glibc=false \
binutils_path="%{_bindir}" \
linux_use_bundled_binutils=false \
use_gold=%{use_gold} \
custom_toolchain="%{_sourcedir}:default" \
proprietary_codecs=true \
enable_ac3_eac3_audio_demuxing=true \
enable_mse_mpeg2ts_stream_parser=true \
enable_hevc_demuxing=true \
use_system_libjpeg=true \
use_libjpeg_turbo=false \
enable_widevine=%{is_widevine} \
pdf_enable_xfa=true \
use_pulseaudio=true \
use_allocator="none" \
treat_warnings_as_errors=false \
fatal_linker_warnings=false \
use_aura=true \
use_libpci = true \
is_debug=false \
is_clang=%{is_clang} \
clang_use_chrome_plugins=false \
clang_base_path="/usr" \
use_jumbo_build = true \
jumbo_file_merge_limit = %{is_limit} \
use_lld=%{is_lld} \
use_system_freetype=true \
use_system_harfbuzz=true \
use_system_libpng=true \
use_vaapi=%{is_vaapi} \
v8_use_external_startup_data=false \
google_api_key="%{google_api_key}" \
google_default_client_id="%{google_default_client_id}" \
google_default_client_secret="%{google_default_client_secret}"
build/linux/unbundle/replace_gn_files.py --system-libraries %{system_gn_list}
third_party/libaddressinput/chromium/tools/update-strings.py
%if 0%{?clang}
export CC=clang
export CXX=clang++
export AR=ar
export NM=nm
# flags to fix i586 builds
export LDFLAGS="$LDFLAGS -Wl,-z,notext"
%else
%setup_compile_flags
CC=%{__cc}; export CC
CXX=%{__cxx}; export CXX
AR=%{__ar}; export AR
NM=%{__nm}; export NM
LD=%{__cxx}; export LD
# filter out some flags to fix i586 builds
CFLAGS=$(echo "$CFLAGS"|sed -e 's/-gdwarf-4//' -e 's/-fvar-tracking-assignments//' -e 's/-frecord-gcc-switches//')
CXXFLAGS=$(echo "$CXXFLAGS"|sed -e 's/-gdwarf-4//' -e 's/-fvar-tracking-assignments//' -e 's/-frecord-gcc-switches//')
CFLAGS="$CFLAGS -Wno-error=pointer-to-int-cast -Wno-error=int-to-pointer-cast"
CXXFLAGS="$CXXFLAGS -Wno-error=attributes -Wno-error=comment -Wno-error=unused-variable -Wno-error=strict-overflow -Wno-error=deprecated-declarations"
%endif
python tools/gn/bootstrap/bootstrap.py --gn-gen-args='%{gn_config}'
out/Release/gn gen --args='%{gn_config}' out/Release
pushd out/Release
# widevinecdmadapter
# Build error with widevinecdmadapter in 67.0.3396.62
ninja %{_smp_mflags} chrome chrome_sandbox chromedriver
popd
%install
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_crdir}/locales
mkdir -p %{buildroot}%{_crdir}/themes
mkdir -p %{buildroot}%{_crdir}/default_apps
install -m 755 %{SOURCE1} %{buildroot}%{_crdir}/chromium-wrapper
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/*.pak %{buildroot}%{_crdir}/
install -m 644 out/Release/icudtl.dat %{buildroot}%{_crdir}/
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
cp -r out/Release/swiftshader %{buildroot}%{_crdir}
# 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 %{SOURCE2} %{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 {} \;