Sophie

Sophie

distrib > Mageia > 1 > x86_64 > media > nonfree-updates-src > by-pkgid > d2b30818fd60bd73099bb5e54844d379 > files > 1

flash-player-plugin-10.3.183.7-1.mga1.nonfree.src.rpm


%define name	flash-player-plugin
%define version	10.3.183.7
%define rel	1

# backportability
%define _localstatedir /var

%ifarch x86_64
# fake 64-bit package that contains 32-bit flash
# (to avoid having to have 32-bit nonfree repo on 64-bit)
# - Anssi 08/2011
%define _lib	lib
%define _libdir	%{_prefix}/lib
%endif

%ifarch x86_64
# fake 64-bit package
Summary:	Flash Player plugin for browsers - 32-bit version
%else
Summary:	Flash Player plugin for browsers
%endif
Name:		%name
Version:	%version
Release:	%mkrel %rel
License:	Proprietary
URL:		http://www.adobe.com/products/flashplayer/
Group:		Networking/WWW
ExclusiveArch:	%ix86
# fake 64-bit package:
ExclusiveArch:	x86_64

Requires(pre):	curl

# obtained by objdump -x /usr/lib/mozilla/plugins/libflashplayer.so | grep NEEDED
# helper: for i in $(objdump -p libflashplayer.so  | grep NEEDED | awk '{ print $2 }'); do
#	  echo -n "$i: "; rpm -qf /usr/lib64/$i; done
#		libX11.so.6	libXext.so.6	libXt.so.6	libfreetype.so.6
Requires:	%{_lib}x11_6	%{_lib}xext6	%{_lib}xt6	%{_lib}freetype6
#		libfontconfig.so.1	libgtk-x11-2.0.so.0, libgdk-x11-2.0.so.0
Requires:       %{_lib}fontconfig1	%{_lib}gtk+-x11-2.0_0
#		libatk-1.0.so.0	libgdk_pixbuf-2.0.so.0	libpangocairo-1.0.so.0, libpango-1.0.so.0
Requires:	%{_lib}atk1.0_0	%{_lib}gdk_pixbuf2.0_0	%{_lib}pango1.0_0
#		libcairo.so.2	libgobject-2.0.so.0, libgmodule-2.0.so.0, libglib-2.0.so.0
Requires:	%{_lib}cairo2	%{_lib}glib2.0_0
#		libnss3.so, libsmime3.so, libssl3.so	libplds4.so, libplc4.so, libnspr4.so
Requires:	%{_lib}nss3				%{_lib}nspr4
# required for audio, dlopened:
Requires:	%{_lib}alsa2
# dlopened:
Requires:	%{_lib}curl4
# dlopened, for video acceleration:
Suggests:	%{_lib}vdpau1
#
Conflicts:	FlashPlayer < 9.0.115.0-5
Conflicts:	flash-plugin FlashPlayer-plugin flashplayer-plugin
# Conflict with free plugins to avoid user confusion as to which one is
# actually used:
Conflicts:	gnash-firefox-plugin
Conflicts:	swfdec-mozilla
Conflicts:	lightspark-mozilla-plugin
Conflicts:	libflashsupport < 0.20080000.1
Obsoletes:	flash-player-plugin10.2 < 10.2.152
BuildRequires:	kde4-macros
%ifarch x86_64
# fake 64-bit package
Suggests:	nspluginwrapper
%endif
BuildRoot:	%{_tmppath}/%{name}-root

%description
Adobe Flash Player plugin for browsers.

NOTE: This package does not contain the Flash Player itself. The
software will be automatically downloaded from Adobe during the
package installation.

Installing this package indicates acceptance of the EULA, available
from http://www.adobe.com/products/eulas/players/flash/.
%ifarch x86_64
NOTE: This package actually contains the 32-bit version of Flash
Player as 64-bit stable Flash Player is not yet available.

This package will be automatically upgraded to the 64-bit version
when it becomes available.
%endif
# It would be preferable to have the KCM module in the main package with
# simply not requiring any kde stuff. However, standard KDE installation
# doesn't necessary include libkutils4. - Anssi 08/2011

%ifnarch x86_64
# fake 64-bit package
%package kde
Summary:	Flash Player KDE settings module
Group:		Networking/WWW
Requires:	%{name} = %{version}-%{release}
Requires(post):	%{name} = %{version}-%{release}
# helper: for i in $(objdump -p usr/lib/kde4/kcm_adobe_flash_player.so  | grep NEEDED | awk '{ print $2 }'); do
#	  echo -n "$i: "; rpm -qf /usr/lib64/$i; done
Requires:	%{_lib}kdeui5
Requires:	%{_lib}sm6
Requires:	%{_lib}ice6
Requires:	%{_lib}x11_6
Requires:	%{_lib}xext6
Requires:	%{_lib}xft2
Requires:	%{_lib}xau6
Requires:	%{_lib}xdmcp6
Requires:	%{_lib}xpm4
Requires:	%{_lib}kutils4
Requires:	%{_lib}kdecore5
Requires:	%{_lib}qtdbus4
Requires:	%{_lib}qtcore4
Requires:	%{_lib}qtsvg4
Requires:	%{_lib}qtgui4
Conflicts:	flash-player-plugin < 10.3.183.5
Conflicts:	flash-player-plugin11 < 11.0.1.98-0.b2.080811.2

%description kde
KDE settings module for Adobe Flash Player.

NOTE: This package does not contain the software itself. The
software will be automatically downloaded from the Adobe server
during the package installation.

Installing this package indicates acceptance of the EULA, available
from http://www.adobe.com/products/eulas/players/flash/.

%endif

%prep
%setup -c -T

# The linuxdownload.adobe.com rpm usually stays up longer, but fpdownload.macromedia.com is faster.
# Their md5sums usually differ.
#ifarch %ix86
# fake 64-bit package
%define downurl1 http://fpdownload.macromedia.com/get/flashplayer/current/flash-plugin-%version-release.i386.rpm
%define tmd5sum1 951d2b9703e903b3c0ed700e2bbc5857
%define downurl2 http://linuxdownload.adobe.com/linux/i386/flash-plugin-%version-release.i386.rpm
%define tmd5sum2 7c9fe718e8c7fb0a6b54560be74384e8
%define tarname flash-plugin-%version-release.i386.rpm
%define tartype	rpm
#endif

%if 0
# fake 64-bit package
#ifarch x86_64
%define downurl1 http://download.macromedia.com/pub/labs/flashplayer10/libflashplayer-%version.linux-x86_64.so.tar.gz
%define tmd5sum1 none, not available
%define downurl2 %nil
%define tmd5sum2 %nil
%define tarname libflashplayer-%version.linux-x86_64.so.tar.gz
%define tartype tar
%endif

%define file %{_localstatedir}/lib/%{name}/%{tarname}

%install
rm -rf %{buildroot}

install -d -m755 %{buildroot}%{_localstatedir}/lib/%{name}
install -d -m755 %{buildroot}%{_libdir}/mozilla/plugins
touch %{buildroot}%{_libdir}/mozilla/plugins/libflashplayer.so
touch %{buildroot}%{_libdir}/mozilla/plugins/LICENSE.flashplayer
touch %{buildroot}%{_libdir}/mozilla/plugins/README.flashplayer
touch %{buildroot}%{_localstatedir}/lib/%{name}/%{tarname}

install -d -m755 %{buildroot}%{_bindir}
touch %{buildroot}%{_bindir}/flash-player-properties

%ifnarch x86_64
# fake 64-bit package
install -d -m755 %{buildroot}%{_kde_services}
touch %{buildroot}%{_kde_services}/kcm_adobe_flash_player.desktop
install -d -m755 %{buildroot}%{_kde_libdir}/kde4
touch %{buildroot}%{_kde_libdir}/kde4/kcm_adobe_flash_player.so
%endif

install -d -m755 %{buildroot}%{_datadir}/applications
touch %{buildroot}%{_datadir}/applications/flash-player-properties.desktop

for i in 16 22 24 32 48; do
	install -d -m755 %{buildroot}%{_iconsdir}/hicolor/${i}x${i}/apps
	touch %{buildroot}%{_iconsdir}/hicolor/${i}x${i}/apps/flash-player-properties.png
done

install -d -m755 %{buildroot}%{_datadir}/%{name}
cat > %{buildroot}%{_datadir}/%{name}/functions << EOF
tar_extract() {
	extractdir=\$(mktemp -d --tmpdir=/tmp)
	if [ -z "\$extractdir" ]; then
		echo "Error during extraction." >&2
		exit 1
	fi

	cd "\$extractdir" || exit 1
%if "%tartype" == "rpm"
	rpm2cpio "%file" | cpio -i --quiet -d
%else
	tar -xzf "%file"
%endif

	FILENUM=1
	FILE_SRC="\$FILE1_SRC"
	FILE_DST="\$FILE1_DST"
	while [ -n "\$FILE_SRC" ]; do
		mv -f "\$FILE_SRC" "\$FILE_DST"
		FILENUM=\$((FILENUM+1))
		eval FILE_SRC="\\\$FILE\${FILENUM}_SRC"
		eval FILE_DST="\\\$FILE\${FILENUM}_DST"
	done
	rm -rf "\$extractdir"
}
EOF

%clean
rm -rf %{buildroot}

%pre
checkmd5sum() {
	[ -e "$1" ] || return 1
	FILEMD5="$(md5sum $1 | cut -d" " -f1)"
	[ -n "$FILEMD5" ] || return 1
	MD5NUM=1
	eval MD5SUM="\$MD5SUM$MD5NUM"
	while [ "$MD5SUM" ]; do
		[ "$MD5SUM" = "$FILEMD5" ] && return 0
		MD5NUM=$((MD5NUM+1))
		eval MD5SUM="\$MD5SUM$MD5NUM"
	done
	return 1
}
MD5SUM1="%{tmd5sum1}"
MD5SUM2="%{tmd5sum2}"
MD5SUM3=
URL1="%{downurl1}"
URL2="%{downurl2}"
URL3=

URLNUM=1

install -d -m 0755 %{_localstatedir}/lib/%{name}

echo "Note that by downloading the Adobe Flash Player you indicate your acceptance of"
echo "the EULA, available from http://www.adobe.com/products/eulas/players/flash/"
while ! checkmd5sum "%file"; 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 "%file"
		[ "$(ls -A "%{_localstatedir}/lib/%{name}")" ] && rm -rf "%{_localstatedir}/lib/%{name}"
		exit 1
	fi
	URLNUM=$((URLNUM+1))
	echo "Downloading from $URL:"
	curl --connect-timeout 20 -m 10800 -L "$URL" > "%file"
done

%post
FILE1_SRC="usr/lib/flash-plugin/libflashplayer.so"
FILE1_DST="%{_libdir}/mozilla/plugins/libflashplayer.so"
FILE2_SRC="usr/lib/flash-plugin/LICENSE"
FILE2_DST="%{_libdir}/mozilla/plugins/LICENSE.flashplayer"
FILE3_SRC="usr/lib/flash-plugin/README"
FILE3_DST="%{_libdir}/mozilla/plugins/README.flashplayer"

FILE4_SRC="usr/bin/flash-player-properties"
FILE4_DST="%{_bindir}/flash-player-properties"
FILE5_SRC="usr/share/applications/flash-player-properties.desktop"
FILE5_DST="%{_datadir}/applications/flash-player-properties.desktop"

FILE6_SRC="usr/share/icons/hicolor/16x16/apps/flash-player-properties.png"
FILE6_DST="%{_iconsdir}/hicolor/16x16/apps/flash-player-properties.png"
FILE7_SRC="usr/share/icons/hicolor/22x22/apps/flash-player-properties.png"
FILE7_DST="%{_iconsdir}/hicolor/22x22/apps/flash-player-properties.png"
FILE8_SRC="usr/share/icons/hicolor/24x24/apps/flash-player-properties.png"
FILE8_DST="%{_iconsdir}/hicolor/24x24/apps/flash-player-properties.png"
FILE9_SRC="usr/share/icons/hicolor/32x32/apps/flash-player-properties.png"
FILE9_DST="%{_iconsdir}/hicolor/32x32/apps/flash-player-properties.png"
FILE10_SRC="usr/share/icons/hicolor/48x48/apps/flash-player-properties.png"
FILE10_DST="%{_iconsdir}/hicolor/48x48/apps/flash-player-properties.png"
FILE11_SRC=

. %{_datadir}/%{name}/functions
tar_extract

# show in KDE as well (in case user doesn't have -kde subpkg
sed -i 's,NotShowIn=KDE;,,' %{_datadir}/applications/flash-player-properties.desktop
# otherwise KDE hides it:
sed -i 's,GNOME;,,' %{_datadir}/applications/flash-player-properties.desktop

echo "Installation successful."

if [ "$(uname -m)" == x86_64 ]; then
	if ! [ -x %{_bindir}/nspluginwrapper ]; then
		echo "Install nspluginwrapper if you want to use the plugin with 64bit browsers too."
	fi
fi

%ifnarch x86_64
# fake 64-bit package
%post kde
FILE1_SRC="usr/lib/kde4/kcm_adobe_flash_player.so"
FILE1_DST="%{_kde_libdir}/kde4/kcm_adobe_flash_player.so"
FILE2_SRC="usr/share/kde4/services/kcm_adobe_flash_player.desktop"
FILE2_DST="%{_kde_services}/kcm_adobe_flash_player.desktop"

. %{_datadir}/%{name}/functions
tar_extract

if [ "$(uname -m)" == x86_64 ]; then
	echo "Note: Adobe Flash Player configurator can only be accessed from the normal Tools"
	echo "menu instead of KDE System Settings (due to this being a 64bit system)."
	rm -f %{_kde_services}/kcm_adobe_flash_player.desktop
fi
%endif

%files
%defattr(-,root,root)
%dir %{_localstatedir}/lib/%{name}
%ghost %{_localstatedir}/lib/%{name}/%{tarname}
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/functions

%dir %{_libdir}/mozilla
%dir %{_libdir}/mozilla/plugins
%ghost %{_libdir}/mozilla/plugins/libflashplayer.so
%ghost %{_libdir}/mozilla/plugins/LICENSE.flashplayer
%ghost %{_libdir}/mozilla/plugins/README.flashplayer

%ghost %{_bindir}/flash-player-properties
%ghost %{_datadir}/applications/flash-player-properties.desktop
%ghost %{_iconsdir}/hicolor/*/apps/flash-player-properties.png

%ifnarch x86_64
# fake 64-bit package
%files kde
%defattr(-,root,root)
%ghost %{_kde_libdir}/kde4/kcm_adobe_flash_player.so
%ghost %{_kde_services}/kcm_adobe_flash_player.desktop
%endif


%changelog

* Mon Aug 29 2011 anssi <anssi> 10.3.183.7-1.mga1
+ Revision: 135985
- new version 10.3.183.7
- clean up on download failure
- provide a fake 64-bit version of the package which installs the
  32-bit version of the Flash Player, to make the installation easier
  on 64-bit installations that do not have 32-bit nonfree repository
  set up by default; the package will be automatically upgraded to
  a true 64-bit stable Flash Player when it becomes available
- new version
  o fixes CVE-2011-2130, CVE-2011-2134, CVE-2011-2135, CVE-2011-2136,
    CVE-2011-2137, CVE-2011-2138, CVE-2011-2139, CVE-2011-2140,
    CVE-2011-2414, CVE-2011-2415, CVE-2011-2416, CVE-2011-2417,
    CVE-2011-2425
- split out KDE KCM module into -kde subpackage (bug #1275)
- download in %%pre instead of %%posttrans
- unpack in %%post instead of %%posttrans
- always re-enable GTK flash-player-properties in KDE as well
- drop now unneeded calls to nspluginwrapper and gtk-icon-cache,
  they are now handled by filetriggers

  + ahmad <ahmad>
    - Change references of PLF to Mageia in download-flash-player-plugin
    - Update to 10.3.181.34
    - Update to 10.3.181.26 (CVE-2011-2110)

  + pterjan <pterjan>
    - Update to 10.3.181.22 (CVE-2011-2107)

* Fri May 13 2011 anssi <anssi> 10.3.181.14-1.mga1
+ Revision: 98265
- new version
- adapt script for added files
- 32bit KDE now has a settings applet in KDE System Settings, other desktops
  (including 64bit KDE) have a standalone configuration application

* Wed Apr 20 2011 ennael <ennael> 10.2.159.1-1.mga1
+ Revision: 89107
- imported package flash-player-plugin