From e62c75c08cc8e380e309b657eaf04e06686a208e Mon Sep 17 00:00:00 2001 From: CyberLeo Date: Mon, 22 Aug 2011 12:26:06 -0500 Subject: [PATCH] www-plugins/adobe-flash: import 11.0.1.98-b2-20110808 --- www-plugins/adobe-flash/Manifest | 7 + ...adobe-flash-11.0.1.98_beta201108082.ebuild | 229 ++++++++++++++++++ ...adobe-flash-11.0.1.98_beta201108082.reason | 1 + .../adobe-flash/files/flashplugin-lahf-fix.c | 29 +++ .../adobe-flash/files/memcpy-to-memmove.sh | 40 +++ www-plugins/adobe-flash/files/mms.cfg | 117 +++++++++ 6 files changed, 423 insertions(+) create mode 100644 www-plugins/adobe-flash/Manifest create mode 100644 www-plugins/adobe-flash/adobe-flash-11.0.1.98_beta201108082.ebuild create mode 100644 www-plugins/adobe-flash/adobe-flash-11.0.1.98_beta201108082.reason create mode 100644 www-plugins/adobe-flash/files/flashplugin-lahf-fix.c create mode 100644 www-plugins/adobe-flash/files/memcpy-to-memmove.sh create mode 100644 www-plugins/adobe-flash/files/mms.cfg diff --git a/www-plugins/adobe-flash/Manifest b/www-plugins/adobe-flash/Manifest new file mode 100644 index 0000000..4d8a0bd --- /dev/null +++ b/www-plugins/adobe-flash/Manifest @@ -0,0 +1,7 @@ +AUX flashplugin-lahf-fix.c 1038 RMD160 8b4550179b919f82acb67813eff33462bebeeb74 SHA1 628b3d672416d386134f79dbcedba333bd5558a9 SHA256 52acc6658eb7d49fb167c848345f7dcb49e4057e2872ca8319bccbff6728df6d +AUX memcpy-to-memmove.sh 1418 RMD160 322005bfe0717630b945eb71ae4aa808a1d14d5e SHA1 72ee58862db06ee235055123137604619273819f SHA256 08a7203d19ca0d1ecbfaf6c46d915a28e2de81da97e42ef3c56e3d370c380096 +AUX mms.cfg 4420 RMD160 b73a91462e1db48fb40983e896cb06b3deb2a51e SHA1 3e56ecb32b938f46eea17a924fa0b006c66a3e6e SHA256 0dd2a9f9aab559243c4d282b5c143ed8876b8d6f8be519bfa8ca6e8fc0c55d9a +DIST flashplayer11_b2_install_lin_32_080811.tar.gz 6757665 RMD160 850f80802b9176ae75208b6b28330c849d610ed0 SHA1 b117ff27111281b58cf4b32efca1505e0ef2ecf9 SHA256 e9780187a1fd0b21a7cac5f0859020b87f9f2355c7810af60dde6436c386f7be +DIST flashplayer11_b2_install_lin_64_080811.tar.gz 7047824 RMD160 0d92ab6fff1f6b2fdcc57ecede70a3d79337a34b SHA1 fd02c7512a4d56c896ee9213ca09fd484aa325c0 SHA256 5b2d8c3744031adad49121c959f2e899cbca2e91592c6773b1ba61d0ff2bafd1 +EBUILD adobe-flash-11.0.1.98_beta201108082.ebuild 7299 RMD160 14a4730c0dc2403f2740ffaa0f42116233dd2566 SHA1 f03dca6fe138d8f4769b84280afdf5fd74815b14 SHA256 9f3bbb1d846d55f633ce675200cf50652144688c88d767e8f63260a6d5c0d6be +MISC adobe-flash-11.0.1.98_beta201108082.reason 60 RMD160 ebbf4f65eb0d609afb77b7732dbbcf1bfc0cf1f2 SHA1 f03bc2ffa4ccf806e0de39c3cba6ba0af6df104c SHA256 db3365c3f35d708799eb6717d194811dd036a6e6434ef9451ac7876c5a6ffb03 diff --git a/www-plugins/adobe-flash/adobe-flash-11.0.1.98_beta201108082.ebuild b/www-plugins/adobe-flash/adobe-flash-11.0.1.98_beta201108082.ebuild new file mode 100644 index 0000000..f109d3c --- /dev/null +++ b/www-plugins/adobe-flash/adobe-flash-11.0.1.98_beta201108082.ebuild @@ -0,0 +1,229 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-plugins/adobe-flash/adobe-flash-11.0.1.60_beta201107131-r1.ebuild,v 1.1 2011/07/18 18:00:00 lack Exp $ + +EAPI=4 +inherit nsplugins multilib toolchain-funcs versionator + +# Specal version parsing for date-based 'square' releases +# For proper date ordering in the ebuild we are using CCYYMMDD, whereas Adobe +# uses MMDDYY in their filename. Plus we tack on the release number, too. +EBUILD_DATE=$(get_version_component_range $(get_version_component_count)) +DATE_SUFFIX=${EBUILD_DATE: -5:4}${EBUILD_DATE:6:2} +REL_SUFFIX=${EBUILD_DATE: -1} +MY_64B_URI="http://download.macromedia.com/pub/labs/flashplatformruntimes/flashplayer11/flashplayer11_b${REL_SUFFIX}_install_lin_64_${DATE_SUFFIX}.tar.gz" +MY_32B_URI="http://download.macromedia.com/pub/labs/flashplatformruntimes/flashplayer11/flashplayer11_b${REL_SUFFIX}_install_lin_32_${DATE_SUFFIX}.tar.gz" + +DESCRIPTION="Adobe Flash Player" +SRC_URI="x86? ( ${MY_32B_URI} ) +amd64? ( + multilib? ( + 32bit? ( ${MY_32B_URI} ) + 64bit? ( ${MY_64B_URI} ) + ) + !multilib? ( ${MY_64B_URI} ) +)" +#HOMEPAGE="http://www.adobe.com/" +HOMEPAGE="http://labs.adobe.com/downloads/flashplayer11.html" +IUSE="multilib +32bit +64bit vdpau bindist kde" +SLOT="0" + +KEYWORDS="-* ~amd64 ~x86" +LICENSE="AdobeFlash-11_beta" +RESTRICT="strip mirror" + +S="${WORKDIR}" + +NATIVE_DEPS="x11-libs/gtk+:2 + media-libs/fontconfig + dev-libs/nss + net-misc/curl + vdpau? ( x11-libs/libvdpau ) + kde? ( kde-base/kcmshell ) + >=sys-libs/glibc-2.4" + +EMUL_DEPS="vdpau? ( >=app-emulation/emul-linux-x86-xlibs-20110129 ) + >=app-emulation/emul-linux-x86-gtklibs-20100409-r1 + app-emulation/emul-linux-x86-soundlibs" + +DEPEND="amd64? ( multilib? ( !64bit? ( www-plugins/nspluginwrapper ) ) )" +RDEPEND="x86? ( $NATIVE_DEPS ) + amd64? ( + multilib? ( + 64bit? ( $NATIVE_DEPS ) + 32bit? ( $EMUL_DEPS ) + ) + !multilib? ( $NATIVE_DEPS ) + ) + || ( media-fonts/liberation-fonts media-fonts/corefonts ) + ${DEPEND}" + +# Where should this all go? (Bug #328639) +INSTALL_BASE="opt/Adobe/flash-player" + +# Ignore QA warnings in these binary closed-source libraries, since we can't fix +# them: +QA_TEXTRELS="${INSTALL_BASE}/plugin/libflashplayer.so + ${INSTALL_BASE}32/libflashplayer.so" + +pkg_setup() { + einfo "Date is $EBUILD_DATE suffix is $DATE_SUFFIX" + if use x86; then + export native_install=1 + elif use amd64; then + # amd64 users may unselect the native 64bit binary, if they choose + if ! use multilib || use 64bit; then + export native_install=1 + else + unset native_install + fi + + if use multilib && use 32bit; then + export amd64_32bit=1 + else + unset amd64_32bit + fi + + if use multilib && ! use 32bit && ! use 64bit; then + eerror "You must select at least one architecture USE flag (32bit or 64bit)" + die "No library version selected [-32bit -64bit]" + fi + + unset need_lahf_wrapper + if [[ $native_install ]]; then + # 64bit flash requires the 'lahf' instruction (bug #268336) + # Also, check if *any* of the processors are affected (bug #286159) + if grep '^flags' /proc/cpuinfo | grep -qv 'lahf_lm'; then + export need_lahf_wrapper=1 + fi + fi + fi +} + +src_unpack() { + if [[ $amd64_32bit ]]; then + # Since the 32-bit and 64-bit tarballs collide, put the 32-bit one + # elsewhere: + local my_32b_src=${MY_32B_URI##*/} + local my_64b_src=${MY_64B_URI##*/} + unpack $my_64b_src + mkdir 32bit + pushd 32bit >/dev/null + unpack $my_32b_src + popd >/dev/null + else + default_src_unpack + fi +} + +src_compile() { + if [[ $need_lahf_wrapper ]]; then + # This experimental wrapper, from Maks Verver via bug #268336 should + # emulate the missing lahf instruction affected platforms. + $(tc-getCC) -fPIC -shared -nostdlib -lc -oflashplugin-lahf-fix.so \ + "${FILESDIR}/flashplugin-lahf-fix.c" \ + || die "Compile of flashplugin-lahf-fix.so failed" + fi +} + +src_install() { + if [[ $native_install ]]; then + BASE=${INSTALL_BASE} + + # The plugin itself + exeinto /${BASE}/plugin + doexe libflashplayer.so + inst_plugin /${BASE}/plugin/libflashplayer.so + + # The optional KDE4 KCM plugin + if use kde; then + exeinto /usr/$(get_libdir)/kde4/ + doexe usr/lib/kde4/kcm_adobe_flash_player.so + insinto /usr/share/kde4/services + doins usr/share/kde4/services/kcm_adobe_flash_player.desktop + else + # No KDE applet, so allow the GTK utility to show up in KDE: + sed -i usr/share/applications/flash-player-properties.desktop \ + -e "/^NotShowIn=KDE;/d" || die "sed of .desktop file failed" + fi + + # The userland 'properties' standalone app: + exeinto /${BASE}/bin + doexe usr/bin/flash-player-properties + for icon in $(find usr/share/icons/ -name '*.png'); do + insinto /$(dirname $icon) + doins $icon + done + insinto usr/share/applications + sed -i usr/share/applications/flash-player-properties.desktop \ + -e "s:^Exec=:Exec=/${BASE}/bin/:" || die "sed of .desktop file failed" + doins usr/share/applications/flash-player-properties.desktop + fi + + if [[ $need_lahf_wrapper ]]; then + # This experimental wrapper, from Maks Verver via bug #268336 should + # emulate the missing lahf instruction affected platforms. + exeinto /${INSTALL_BASE} + doexe flashplugin-lahf-fix.so + inst_plugin /${INSTALL_BASE}/flashplugin-lahf-fix.so + fi + + if [[ $amd64_32bit ]]; then + # Only install the plugin, nothing else for 32-bit. + local oldabi="${ABI}" + ABI="x86" + + # 32b plugin + pushd "${S}/32bit" + exeinto /${INSTALL_BASE}32 + doexe libflashplayer.so + inst_plugin /${INSTALL_BASE}32/libflashplayer.so + popd + + ABI="${oldabi}" + fi + + # The magic config file! + insinto "/etc/adobe" + doins "${FILESDIR}/mms.cfg" +} + +pkg_postinst() { + if use amd64; then + if [[ $need_lahf_wrapper ]]; then + ewarn "Your processor does not support the 'lahf' instruction which is used" + ewarn "by Adobe's 64-bit flash binary. We have installed a wrapper which" + ewarn "should allow this plugin to run. If you encounter problems, please" + ewarn "adjust your USE flags to install only the 32-bit version and reinstall:" + ewarn " ${CATEGORY}/$PN[+32bit -64bit]" + elog + fi + if has_version 'www-plugins/nspluginwrapper'; then + if [[ $native_install ]]; then + # TODO: Perhaps parse the output of 'nspluginwrapper -l' + # However, the 64b flash plugin makes + # 'nspluginwrapper -l' segfault. + local FLASH_WRAPPER="${ROOT}/usr/lib64/nsbrowser/plugins/npwrapper.libflashplayer.so" + if [[ -f ${FLASH_WRAPPER} ]]; then + einfo "Removing duplicate 32-bit plugin wrapper: Native 64-bit plugin installed" + nspluginwrapper -r "${FLASH_WRAPPER}" + fi + else + einfo "nspluginwrapper detected: Installing plugin wrapper" + local oldabi="${ABI}" + ABI="x86" + local FLASH_SOURCE="${ROOT}/${INSTALL_BASE}32/libflashplayer.so" + nspluginwrapper -i "${FLASH_SOURCE}" + ABI="${oldabi}" + fi + elif [[ ! $native_install ]]; then + elog "To use the 32-bit flash player in a native 64-bit browser," + elog "you must install www-plugins/nspluginwrapper" + fi + fi + + ewarn "Flash player is closed-source, with a long history of security" + ewarn "issues. Please consider only running flash applets you know to" + ewarn "be safe. The 'flashblock' extension may help for mozilla users:" + ewarn " https://addons.mozilla.org/en-US/firefox/addon/433" +} diff --git a/www-plugins/adobe-flash/adobe-flash-11.0.1.98_beta201108082.reason b/www-plugins/adobe-flash/adobe-flash-11.0.1.98_beta201108082.reason new file mode 100644 index 0000000..483abaf --- /dev/null +++ b/www-plugins/adobe-flash/adobe-flash-11.0.1.98_beta201108082.reason @@ -0,0 +1 @@ +Older 11 beta release is gone; importing newer beta release diff --git a/www-plugins/adobe-flash/files/flashplugin-lahf-fix.c b/www-plugins/adobe-flash/files/flashplugin-lahf-fix.c new file mode 100644 index 0000000..9338b73 --- /dev/null +++ b/www-plugins/adobe-flash/files/flashplugin-lahf-fix.c @@ -0,0 +1,29 @@ +/* Simple work-around for running the 64-bit Adobe Flash plug-in version 10 + on Athlon64 processors without support for the lahf instruction. + +Compile with: +cc -fPIC -shared -nostdlib -lc -oflashplugin-lahf-fix.so flashplugin-lahf-fix.c +Then place the .so file in the plug-in directory (e.g. $HOME/.mozilla/plugins) +or use LD_PRELOAD to force Firefox to load the library. + + - Maks Verver July 2009 */ + +#define _GNU_SOURCE +#include +#include +#include + +static void sig_handler(int signal, siginfo_t *info, void *context) { + if (signal != SIGILL) return; + if (*(char*)info->si_addr != (char)0x9f) abort(); + greg_t *regs = ((ucontext_t*)context)->uc_mcontext.gregs; + ((char*)®s[REG_RAX])[1] = ((char*)®s[REG_EFL])[0]; + regs[REG_RIP]++; +} + +static struct sigaction old_sa, new_sa = { + .sa_flags = SA_SIGINFO, + .sa_sigaction = &sig_handler }; + +int _init() { sigaction(SIGILL, &new_sa, &old_sa); return 0; } +int _fini() { sigaction(SIGILL, &old_sa, &new_sa); return 0; } diff --git a/www-plugins/adobe-flash/files/memcpy-to-memmove.sh b/www-plugins/adobe-flash/files/memcpy-to-memmove.sh new file mode 100644 index 0000000..b1632e5 --- /dev/null +++ b/www-plugins/adobe-flash/files/memcpy-to-memmove.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# Quick and dirty, but inefficient shellscript that +# turns all memcpy calls into memmove calls +# From Ray Strode + +set -e + +INPUT="$1" + +MEMCPY=0x$(objdump -S -j .plt $INPUT | grep memcpy |awk '{ print $1 }') +[ $MEMCPY = "0x" ] && echo "Can't find memcpy call in $INPUT PLT" 1>&2 && exit 1 + +MEMMOVE=0x$(objdump -S -j .plt $INPUT | grep memmove |awk '{ print $1 }') +[ $MEMMOVE = "0x" ] && echo "Can't find memmove call in $INPUT PLT" 1>&2 && exit 2 + +DELTA=$(($MEMMOVE - $MEMCPY)) +MEMCPY="$(printf '%x' $MEMCPY)" + +TEMP_OUTPUT="$(mktemp)" +trap "rm -f $TEMP_OUTPUT" ERR + +cp $INPUT $TEMP_OUTPUT +objdump -S -j .text $INPUT | while read offset e8 byte1 byte2 byte3 byte4 call call_offset rest; do + test "$call_offset" = "$MEMCPY" || continue; + + OFFSET=$(printf "0x%x" $((0x${offset%:} + 1))) + NUMBER="0x${byte4}${byte3}${byte2}${byte1}" + echo -n "Changing call at offset $OFFSET from [${byte1} ${byte2} ${byte3} ${byte4}]" + NUMBER=$(printf "0x%08x" $(($NUMBER + $DELTA))) + + BYTE1=$(printf "%02x" $((($NUMBER >> 24) & 0xff))) + BYTE2=$(printf "%02x" $((($NUMBER >> 16) & 0xff))) + BYTE3=$(printf "%02x" $((($NUMBER >> 8) & 0xff))) + BYTE4=$(printf "%02x" $((($NUMBER >> 0) & 0xff))) + + echo " to [${BYTE4} ${BYTE3} ${BYTE2} ${BYTE1}]" + echo -ne "\x$BYTE4\x$BYTE3\x$BYTE2\x$BYTE1" | dd of=$TEMP_OUTPUT bs=1 seek=$(($OFFSET)) count=4 conv=notrunc 2> /dev/null +done + +mv $TEMP_OUTPUT $INPUT diff --git a/www-plugins/adobe-flash/files/mms.cfg b/www-plugins/adobe-flash/files/mms.cfg new file mode 100644 index 0000000..3d53391 --- /dev/null +++ b/www-plugins/adobe-flash/files/mms.cfg @@ -0,0 +1,117 @@ +# +# /etc/adobe/mms.cfg: Adobe Flash privacy and security settings +# +# For more details on the meaning of most of these options, please visit: +# http://www.adobe.com/devnet/flashplayer/articles/flash_player_admin_guide.html +# + +# Lets you prevent users from designating any files on the local file system as +# trusted +# 0 = Not Allowed, 1 = Allowed (default) +#AllowUserLocalTrust = 1 + +# Lets you specify a hard limit on the amount of local storage that Flash Player +# uses for the storage of common Flash components +# Size in megabytes (default is 20), 0 = Component storage disabled +#AssetCacheSize = 20 + +# Lets you prevent Flash Player from automatically checkingfor and installing +# updated versions +# 0 = Not Disabled (default), 1 = Disabled +AutoUpdateDisable = 1 + +# Lets you specify how often to check for an updated version of Flash Player +# Number of days, 0 = Every startup +# There is no default value, which falls back to the user's setting (30 days by +# default) +#AutoUpdateInterval = + +# Lets you prevent SWF files from accessing webcams or microphones +# 0 = Not Disabled (default), 1 = Disabled +#AVHardwareDisable = 0 + +# Lets you prevent information on installed fonts from being displayed +# 0 = Not Disabled (default), 1 = Disabled +#DisableDeviceFontEnumeration = 0 + +# Lets you prevent networking or file system access if any kind +# Set to the executable filename, default is empty +#DisableNetworkAndFilesystemInHostApp = + +# Lets you prevent native code applications that are digitally signed and +# delivered by Adobe from being downloaded +# 0 = Not Disabled (default), 1 = Disabled +#DisableProductDownload = 0 + +# Lets you enable or disable the use of the Socket.connect() and +# XMLSocket.connect() methods +# 0 = Not Disabled (default), 1 = Disabled +#DisableSockets = 0 + +# Lets you create a whitelist of servers to which socket connections are allowed +# Set to hostname or IP address. This can be specified multiple times in this +# file to allow more than one host, and only takes effect if DisableSockets +# (above) is set to 1. +#EnableSocketsTo = localhost.localdomain +#EnableSocketsTo = 127.0.0.1 + +# Lets you prevent the ActionScript FileReference API from performing file +# downloads +# 0 = Not Disabled (default), 1 = Disabled +#FileDownloadDisable = 0 + +# Lets you prevent the ActionScript FileReference API from prerforming file +# uploads +# 0 = Not Disabled (default), 1 = Disabled +#FileUploadDisable = 0 + +# Lets you disable SWF files playing via a browser plug-in from being displayed +# in full-screen mode +# 0 = Not Disabled (default), 1 = Disabled +#FullScreenDisable = 0 + +# Lets you specify whether SWF files produced for Flash Player 6 and earlier can +# execute an operation that has been restricted in a newer version of Flash +# Player +# 0 = Deny, 1 = Allow +# There is no default value, which falls back to the user's setting (Defaults to +# "Ask" +#LegacyDomainMatching = + +# Lets you specify how Flash Player should determine whether to execute certain +# local SWF files that were originally produced for Flash Player 7 and earlier +# 0 = Deny, 1 = Allow +# There is no default value, which falls back to the user's setting +#LocalFileLegacyAction = + +# Lets you prevent local SWF files from having read access to files on local +# drive +# 0 = Not Disabled (default), 1 = Disabled +#LocalFileReadDisable = 0 + +# Lets you specify a hard limit on the amout of local storage that Flash Player +# uses (per domain) for persistent shared objects +# 1 = no storage, 2 = 10KB, 3 = 100KB, 4 = 1MB, 5 = 10MB, +# 6 = User specified (default) +# If the user does not specify a limit, the default is 100KB. +#LocalStorageLimit = 6 + +# Lets you override GPU validation checks to force hardware acceleration +# Warning: This may make your player (more) unstable! +# 0 = Check GPU (default), 1 = Skip checks +# More details: +# http://blogs.adobe.com/penguin.swf/2008/08/secrets_of_the_mmscfg_file_1.html +#OverrideGPUValidation = 0 + +# Lets you specify whether third-party SWF files can read and write locally +# persistent shared objects +# 0 = disabled, 1 = enabled +# There is no default value, which falls back to the user's setting +#ThirdPartyStorage = + +# Lets you disable "Windowless" mode, which may cause crashes in firefox +# version 3.01 and earlier. +# 0 = Not Disabled (default), 1 = Disabled +# More details: +# http://blogs.adobe.com/penguin.swf/2008/08/windowless_mode_fix.html +#WindowlessDisable = 0 -- 2.42.0