Sophie

Sophie

distrib > Mageia > 7 > i586 > media > nonfree-updates > by-pkgid > d71e3285f26c9432f4c1c80df9096362 > scriptlet

flash-player-plugin-32.0.0.414-1.mga7.nonfree.i586.rpm

PREIN

/bin/sh
checksha256sum() {
	[ -e "$1" ] || return 1
	FILESHA256="$(sha256sum $1 | cut -d" " -f1)"
	FILESIZE="$(stat -c%s "$1")"
	[ -n "$FILESHA256" ] || return 1
	[ -n "$FILESIZE" ] || return 1
	SHA256NUM=1
	eval SHA256SUM="\$SHA256SUM$SHA256NUM"
	while [ "$SHA256SUM" ]; do
		[ "${SHA256SUM%:*}" = "$FILESHA256" ] && [ "${SHA256SUM#*:}" = "$FILESIZE" ] && return 0
		SHA256NUM=$((SHA256NUM+1))
		eval SHA256SUM="\$SHA256SUM$SHA256NUM"
	done
	return 1
}

get_proxy_from_urpmi() {
	if [ -e /etc/urpmi/proxy.cfg ]; then
		proxy="$(grep ^http_proxy= /etc/urpmi/proxy.cfg 2>/dev/null)"
		proxy_user="$(grep ^proxy_user= /etc/urpmi/proxy.cfg 2>/dev/null)"

		proxy="${proxy#http_proxy=}"
		proxy_user="${proxy_user#proxy_user=}"

		[ -n "$proxy" ] && echo "--proxy $proxy"
		[ -n "$proxy_user" ] && echo "--proxy-user $proxy_user"
	fi
}

SHA256SUM1="f45afe9bb949bb4a4fc73b23d16673ea1b08c3ef0b4329e2ebdb7d3c1afbaaec:8816341"
SHA256SUM2=""
SHA256SUM3="f45afe9bb949bb4a4fc73b23d16673ea1b08c3ef0b4329e2ebdb7d3c1afbaaec:8816341"
SHA256SUM4=
URL1="http://fpdownload.adobe.com/get/flashplayer/pdc/32.0.0.414/flash-player-ppapi-32.0.0.414-release.i386.rpm"
URL2=""
URL3="http://linuxdownload.adobe.com/linux/i386/flash-player-ppapi-32.0.0.414-release.i386.rpm"
URL4=

URLNUM=1

install -d -m 0755 /var/lib/flash-player-plugin

echo "Note that by downloading the Adobe Flash Player you indicate your acceptance of"
echo "the EULA, available at http://www.adobe.com/products/eulas/players/flash/"
while ! checksha256sum "/var/lib/flash-player-plugin/flash-player-ppapi-32.0.0.414-release.i386.rpm"; do
	eval URL="\$URL$URLNUM"
	if [ -z "$URL" ]; then
		echo "Error: Unable to download Flash Player. This is likely due to this package" >&2
		echo "       being too old. Please file a bug report at https://bugs.mageia.org" >&2
		echo "       so that the package gets updated. Thank you." >&2
		echo "" >&2
		echo "       In the meantime, you can download Flash Player manually from" >&2
		echo "       http://get.adobe.com/flashplayer/" >&2
		rm -f "/var/lib/flash-player-plugin/flash-player-ppapi-32.0.0.414-release.i386.rpm"
		[ "$(ls -A "/var/lib/flash-player-plugin")" ] && rm -rf "/var/lib/flash-player-plugin"
		[[ -n $DURING_INSTALL ]] && exit 0 || exit 1
	fi
	URLNUM=$((URLNUM+1))
	echo "Downloading from $URL:"
	curl --connect-timeout 20 -m 10800 -L $(get_proxy_from_urpmi) "$URL" > "/var/lib/flash-player-plugin/flash-player-ppapi-32.0.0.414-release.i386.rpm"
done

POSTIN

/bin/sh
FILE1_SRC="usr/lib/flash-plugin/libpepflashplayer.so"
FILE1_DST="/usr/lib/chromium-browser/PepperFlash/libpepflashplayer.so"
FILE1_PRM="0755"

FILE2_SRC="usr/share/doc/flash-player-ppapi-32.0.0.414/license.pdf"
FILE2_DST="/usr/lib/chromium-browser/PepperFlash/doc/license.pdf"
FILE2_PRM="0644"
FILE3_SRC="usr/share/doc/flash-player-ppapi-32.0.0.414/readme.txt"
FILE3_DST="/usr/lib/chromium-browser/PepperFlash/doc/readme.txt"
FILE3_PRM="0644"
FILE4_SRC="usr/share/doc/flash-player-ppapi-32.0.0.414/notice.txt"
FILE4_DST="/usr/lib/chromium-browser/PepperFlash/doc/notice.txt"
FILE4_PRM="0644"
FILE5_SRC="usr/share/doc/flash-player-ppapi-32.0.0.414/LGPL.txt"
FILE5_DST="/usr/lib/chromium-browser/PepperFlash/doc/LGPL.txt"
FILE5_PRM="0644"

FILE6_SRC="usr/lib/flash-plugin/manifest.json"
FILE6_DST="/usr/lib/chromium-browser/PepperFlash/manifest.json"
FILE6_PRM="0644"

FILE7_SRC=

. /usr/share/flash-player-plugin/functions
tar_extract

# Make Firefox see that the plugin has been updated
# (this file has %verify(not mtime) set):
touch --no-create /usr/lib/mozilla/plugins/libfreshwrapper-flashplayer.so

echo "Adobe Flash Player installation successful."