# chrome_stream is either stable, unstable or beta %define chrome_stream stable %define deb_file google-chrome-%{chrome_stream}_current_amd64.deb Summary: Chrome Widevine for Opera Stable Name: opera-widevine Version: 58.0.3029.110 Release: %mkrel 1 License: Proprietary Source1: latest-widevine.sh Group: Networking/WWW URL: https://www.google.com/chrome/ Vendor: Google Inc. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: binutils xz tar wget Conflicts: opera AutoReqProv: no %description Chrome Widevine for Opera Stable based on ruario/latest-widevine.sh https://gist.github.com/ruario/3c873d43eb20553d5014bd4d29fe37f1 Fetches Chrome and extracts out Widevine so that it can be used by Vivaldi. Also works with other Chromium-based browsers, see guide below. %prep %setup -T -n %{name} -c %build %install rm -rf %buildroot mkdir %buildroot mkdir -p %buildroot/tmp mkdir -p %buildroot/opt/google/chrome cd $RPM_SOURCE_DIR wget -nc https://dl.google.com/linux/direct/%{deb_file} # extract data of the Google Chrome deb package ar p $RPM_SOURCE_DIR/%{deb_file} data.tar.xz | xz -d -9 | tar x -C %buildroot/tmp DLVERSION=`zcat %buildroot/tmp/usr/share/doc/google-chrome-stable/changelog.gz | grep Build | awk -F "/" '{print $7}'` if [ ! "%{version}" = "$DLVERSION" ]; then exit 1 fi pushd %buildroot/tmp/opt/google/chrome cp -p libwidevinecdm.so %buildroot/opt/google/chrome cp -p libwidevinecdmadapter.so %buildroot/opt/google/chrome popd rm -rf %buildroot/tmp %clean rm -rf %buildroot %files %defattr(-,root,root) /opt/google/chrome/* %changelog * Thu Apr 27 2017 R.M. Stockmann - 58.0.3029.81-1mdv2011 - new release * Fri Apr 14 2017 R.M. Stockmann - 57.0.2987.133-1mdv2011 - new release