# Template file for 'google-earth-pro'

pkgname=google-earth-pro
version=7.3.7.1155
revision=1
archs="x86_64"
depends="alsa-lib desktop-file-utils fontconfig glu gst-plugins-base1
 hicolor-icon-theme libSM libXi libXrender libcups libproxy nss qt5-script
 qt5-sensors qt5-webkit"
short_desc="Explore the far reaches of the world"
maintainer="Jason Elswick <jason@jasondavid.us>"
license="custom:Google"
homepage="https://www.google.com/earth/index.html"
distfiles="https://dl.google.com/dl/earth/client/current/google-earth-pro-stable_current_amd64.deb"
checksum=956146a4ee1f0b2c312bf9da8c7cc54287ed7c21058985ffdf59e5a094b30b23
repository=nonfree
restricted=yes
nostrip=yes

post_extract() {
	$XBPS_FETCH_CMD https://www.google.com/intl/ALL/policies/terms/index.html>Google-Terms-of-Service.html \
		https://www.google.com/help/terms_maps.html>Google-Earth-Additional-Terms-of-Service.html \
		https://www.google.com/help/legalnotices_maps.html>Legal-Notices-for-Google-Earth-and-Google-Earth-APIs.html \
		https://www.google.com/intl/ALL/policies/privacy/index.html>Google-Privacy-Policy.html
	rm index.html legalnotices_maps.html terms_maps.html
}

do_install() {
	vcopy opt /
	vcopy usr /

	vinstall opt/google/earth/pro/google-earth-pro.desktop 644 usr/share/applications

	for i in 16 22 24 32 48 64 128 256; do
		vinstall opt/google/earth/pro/product_logo_${i}.png 644 \
			usr/share/icons/hicolor/${i}x${i}/apps ${pkgname}.png
	done

	for i in Google-Terms-of-Service.html \
		Google-Earth-Additional-Terms-of-Service.html \
		Legal-Notices-for-Google-Earth-and-Google-Earth-APIs.html \
		Google-Privacy-Policy.html; do
			vlicense ${i}
	done

	vsed -i '/googleearth-bin/s/^/LC_NUMERIC=en_US.UTF-8 /' \
		${DESTDIR}/opt/google/earth/pro/googleearth
}
