1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $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 $
6 inherit nsplugins multilib toolchain-funcs versionator
8 # Specal version parsing for date-based 'square' releases
9 # For proper date ordering in the ebuild we are using CCYYMMDD, whereas Adobe
10 # uses MMDDYY in their filename. Plus we tack on the release number, too.
11 EBUILD_DATE=$(get_version_component_range $(get_version_component_count))
12 DATE_SUFFIX=${EBUILD_DATE: -5:4}${EBUILD_DATE:6:2}
13 REL_SUFFIX=${EBUILD_DATE: -1}
14 MY_64B_URI="http://download.macromedia.com/pub/labs/flashplatformruntimes/flashplayer11/flashplayer11_b${REL_SUFFIX}_install_lin_64_${DATE_SUFFIX}.tar.gz"
15 MY_32B_URI="http://download.macromedia.com/pub/labs/flashplatformruntimes/flashplayer11/flashplayer11_b${REL_SUFFIX}_install_lin_32_${DATE_SUFFIX}.tar.gz"
17 DESCRIPTION="Adobe Flash Player"
18 SRC_URI="x86? ( ${MY_32B_URI} )
21 32bit? ( ${MY_32B_URI} )
22 64bit? ( ${MY_64B_URI} )
24 !multilib? ( ${MY_64B_URI} )
26 #HOMEPAGE="http://www.adobe.com/"
27 HOMEPAGE="http://labs.adobe.com/downloads/flashplayer11.html"
28 IUSE="multilib +32bit +64bit vdpau bindist kde"
31 KEYWORDS="-* ~amd64 ~x86"
32 LICENSE="AdobeFlash-11_beta"
33 RESTRICT="strip mirror"
37 NATIVE_DEPS="x11-libs/gtk+:2
41 vdpau? ( x11-libs/libvdpau )
42 kde? ( kde-base/kcmshell )
45 EMUL_DEPS="vdpau? ( >=app-emulation/emul-linux-x86-xlibs-20110129 )
46 >=app-emulation/emul-linux-x86-gtklibs-20100409-r1
47 app-emulation/emul-linux-x86-soundlibs"
49 DEPEND="amd64? ( multilib? ( !64bit? ( www-plugins/nspluginwrapper ) ) )"
50 RDEPEND="x86? ( $NATIVE_DEPS )
53 64bit? ( $NATIVE_DEPS )
56 !multilib? ( $NATIVE_DEPS )
58 || ( media-fonts/liberation-fonts media-fonts/corefonts )
61 # Where should this all go? (Bug #328639)
62 INSTALL_BASE="opt/Adobe/flash-player"
64 # Ignore QA warnings in these binary closed-source libraries, since we can't fix
66 QA_TEXTRELS="${INSTALL_BASE}/plugin/libflashplayer.so
67 ${INSTALL_BASE}32/libflashplayer.so"
70 einfo "Date is $EBUILD_DATE suffix is $DATE_SUFFIX"
72 export native_install=1
74 # amd64 users may unselect the native 64bit binary, if they choose
75 if ! use multilib || use 64bit; then
76 export native_install=1
81 if use multilib && use 32bit; then
87 if use multilib && ! use 32bit && ! use 64bit; then
88 eerror "You must select at least one architecture USE flag (32bit or 64bit)"
89 die "No library version selected [-32bit -64bit]"
92 unset need_lahf_wrapper
93 if [[ $native_install ]]; then
94 # 64bit flash requires the 'lahf' instruction (bug #268336)
95 # Also, check if *any* of the processors are affected (bug #286159)
96 if grep '^flags' /proc/cpuinfo | grep -qv 'lahf_lm'; then
97 export need_lahf_wrapper=1
104 if [[ $amd64_32bit ]]; then
105 # Since the 32-bit and 64-bit tarballs collide, put the 32-bit one
107 local my_32b_src=${MY_32B_URI##*/}
108 local my_64b_src=${MY_64B_URI##*/}
111 pushd 32bit >/dev/null
120 if [[ $need_lahf_wrapper ]]; then
121 # This experimental wrapper, from Maks Verver via bug #268336 should
122 # emulate the missing lahf instruction affected platforms.
123 $(tc-getCC) -fPIC -shared -nostdlib -lc -oflashplugin-lahf-fix.so \
124 "${FILESDIR}/flashplugin-lahf-fix.c" \
125 || die "Compile of flashplugin-lahf-fix.so failed"
130 if [[ $native_install ]]; then
134 exeinto /${BASE}/plugin
135 doexe libflashplayer.so
136 inst_plugin /${BASE}/plugin/libflashplayer.so
138 # The optional KDE4 KCM plugin
140 exeinto /usr/$(get_libdir)/kde4/
141 doexe usr/lib/kde4/kcm_adobe_flash_player.so
142 insinto /usr/share/kde4/services
143 doins usr/share/kde4/services/kcm_adobe_flash_player.desktop
145 # No KDE applet, so allow the GTK utility to show up in KDE:
146 sed -i usr/share/applications/flash-player-properties.desktop \
147 -e "/^NotShowIn=KDE;/d" || die "sed of .desktop file failed"
150 # The userland 'properties' standalone app:
152 doexe usr/bin/flash-player-properties
153 for icon in $(find usr/share/icons/ -name '*.png'); do
154 insinto /$(dirname $icon)
157 insinto usr/share/applications
158 sed -i usr/share/applications/flash-player-properties.desktop \
159 -e "s:^Exec=:Exec=/${BASE}/bin/:" || die "sed of .desktop file failed"
160 doins usr/share/applications/flash-player-properties.desktop
163 if [[ $need_lahf_wrapper ]]; then
164 # This experimental wrapper, from Maks Verver via bug #268336 should
165 # emulate the missing lahf instruction affected platforms.
166 exeinto /${INSTALL_BASE}
167 doexe flashplugin-lahf-fix.so
168 inst_plugin /${INSTALL_BASE}/flashplugin-lahf-fix.so
171 if [[ $amd64_32bit ]]; then
172 # Only install the plugin, nothing else for 32-bit.
173 local oldabi="${ABI}"
178 exeinto /${INSTALL_BASE}32
179 doexe libflashplayer.so
180 inst_plugin /${INSTALL_BASE}32/libflashplayer.so
186 # The magic config file!
188 doins "${FILESDIR}/mms.cfg"
193 if [[ $need_lahf_wrapper ]]; then
194 ewarn "Your processor does not support the 'lahf' instruction which is used"
195 ewarn "by Adobe's 64-bit flash binary. We have installed a wrapper which"
196 ewarn "should allow this plugin to run. If you encounter problems, please"
197 ewarn "adjust your USE flags to install only the 32-bit version and reinstall:"
198 ewarn " ${CATEGORY}/$PN[+32bit -64bit]"
201 if has_version 'www-plugins/nspluginwrapper'; then
202 if [[ $native_install ]]; then
203 # TODO: Perhaps parse the output of 'nspluginwrapper -l'
204 # However, the 64b flash plugin makes
205 # 'nspluginwrapper -l' segfault.
206 local FLASH_WRAPPER="${ROOT}/usr/lib64/nsbrowser/plugins/npwrapper.libflashplayer.so"
207 if [[ -f ${FLASH_WRAPPER} ]]; then
208 einfo "Removing duplicate 32-bit plugin wrapper: Native 64-bit plugin installed"
209 nspluginwrapper -r "${FLASH_WRAPPER}"
212 einfo "nspluginwrapper detected: Installing plugin wrapper"
213 local oldabi="${ABI}"
215 local FLASH_SOURCE="${ROOT}/${INSTALL_BASE}32/libflashplayer.so"
216 nspluginwrapper -i "${FLASH_SOURCE}"
219 elif [[ ! $native_install ]]; then
220 elog "To use the 32-bit flash player in a native 64-bit browser,"
221 elog "you must install www-plugins/nspluginwrapper"
225 ewarn "Flash player is closed-source, with a long history of security"
226 ewarn "issues. Please consider only running flash applets you know to"
227 ewarn "be safe. The 'flashblock' extension may help for mozilla users:"
228 ewarn " https://addons.mozilla.org/en-US/firefox/addon/433"