File flash-player.spec of Package flash-player.openSUSE_13.2_NonFree_Update

#
# spec file for package flash-player
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define build_standalone 1

Name:           flash-player
Version:        11.2.202.460
Release:        0
Summary:        Adobe Flash Plugin and Standalone Player
License:        SUSE-NonFree
Group:          Productivity/Networking/Web/Browsers
Url:            http://get.adobe.com/flashplayer/
%ifarch %ix86
Source0:        install_flash_player_%{version}_linux.i386.tar.gz
Source1:        flashplayer_%{version}_sa.i386.tar.gz
%endif
%ifarch x86_64
Source0:        install_flash_player_%{version}_linux.x86_64.tar.gz
Source1:        flashplayer_11.1.102.55_sa.x86_64.tar.bz2
%endif
# License referenced from http://www.adobe.com/legal/licenses-terms.html
Source2:        http://wwwimages.adobe.com/content/dam/Adobe/en/legal/licenses-terms/pdf/Flash%20Player_14.0.pdf
Source4:        flashplayer.desktop
Source5:        flashplayer.png
Source6:        mms.cfg
Source99:       update.sh
NoSource:       99
# PATCH-FIX-OPENSUSE desktop.diff -- Fix desktop file to be GNOME compatible
Patch0:         desktop.diff
# PATCH-FIX-OPENSUSE kcm_adobe_flash_player.desktop.patch asterios.dramis@gmail.com -- Make the KCM module X-KDE-System-Settings-Parent-Category entry compatible with newer KDE versions
Patch1:         kcm_adobe_flash_player.desktop.patch
%if 0%{?suse_version} > 1100
BuildRequires:  kde4-filesystem
%endif
%if 0%{?suse_version}
BuildRequires:  update-desktop-files
%endif
# Flash Player and the plugin dynamically opens that one and segfaults if not available (2008-11-12)
%ifarch %ix86
Requires:       libasound.so.2
Requires:       libcurl.so.4
%endif
%ifarch x86_64
Requires:       libasound.so.2()(64bit)
Requires:       libcurl.so.4()(64bit)
%endif
Provides:       flash-plugin = %{version}
%if 0%{?suse_version} >= 1110
# flash 10 does not need libflashsupport and using it can cause device conflicts
# just let flash talk with the default alsa plugin - bnc#539656
Provides:       libflashsupport = 1.2
Obsoletes:      libflashsupport <= 1.2
%ifarch x86_64
Provides:       libflashsupport-32bit = 1.2
Obsoletes:      libflashsupport-32bit <= 1.2
%endif
%endif
Provides:       netscape-plugins
Obsoletes:      netscape-plugins
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExclusiveArch:  %ix86 x86_64
%if 0%{!?_kde4_libdir:1}
%define _kde4_libdir %{_libdir}
%endif
%if 0%{!?_kde4_datadir:1}
%define _kde4_datadir %{_datadir}
%endif
%if 0%{!?_kde4_sharedir:1}
%define _kde4_sharedir %{_kde4_datadir}/kde4
%endif
%if 0%{!?_kde4_modulesdir:1}
%define _kde4_modulesdir %{_kde4_libdir}/kde4
%endif
%if 0%{!?_kde4_servicesdir:1}
%define _kde4_servicesdir %{_kde4_sharedir}/services
%endif

%description
This package contains Adobe's Flash Plugin for the supported Web
browsers in addition to a standalone flash player application.

%if 0%{?suse_version} > 1100

%package gnome
Summary:        Adobe Flash Plugin and Standalone Player Settings
Group:          Productivity/Networking/Web/Browsers
Requires:       %{name} = %{version}
Supplements:    packageand(gnome-session:flash-player)

%description gnome
This package contains Adobe's Flash Plugin Settings for the GNOME desktop.

%package kde4
Summary:        Adobe Flash Plugin and Standalone Player Settings
Group:          Productivity/Networking/Web/Browsers
Requires:       %{name} = %{version}
Supplements:    packageand(kdebase4-session:flash-player)
%kde4_runtime_requires

%description kde4
This package contains Adobe's Flash Plugin Settings for the KDE 4 desktop.

%endif

%prep
%setup -q -c %{name}-%{version} -a 0 -b 1
%patch0
%patch1
cp %{SOURCE2} .
mkdir EULA
mv Flash%20Player_14.0.pdf EULA/Flash\ Player_14.0.pdf

%build

%install
install -Dpm 0755 libflashplayer.so %{buildroot}%{_libdir}/browser-plugins/libflashplayer.so
# bnc#761975
#install -m 644 -D %{SOURCE6} %{buildroot}/etc/adobe/mms.cfg

mkdir -p %{buildroot}%{_datadir}/icons
rm -rf usr/share/icons/hicolor/24x24
%if 0%{?suse_version} <= 1100
rm -rf usr/share/icons/hicolor/*/apps/flash-player-properties.png
%endif
cp -a usr/share/icons/* %{buildroot}%{_datadir}/icons

%if 0%{?suse_version} > 1100
# KDE frontend
install -Dpm 0755 usr/%{_lib}/kde4/kcm_adobe_flash_player.so %{buildroot}%{_kde4_modulesdir}/kcm_adobe_flash_player.so
install -Dpm 0644 usr/share/kde4/services/kcm_adobe_flash_player.desktop %{buildroot}%{_kde4_servicesdir}/kcm_adobe_flash_player.desktop
# GNOME frontend
install -Dpm 0755 usr/bin/flash-player-properties %{buildroot}%{_bindir}/flash-player-properties
install -Dpm 0644 usr/share/applications/flash-player-properties.desktop %{buildroot}%{_datadir}/applications/flash-player-properties.desktop
%endif

%if %build_standalone
%if 0%{?suse_version} > 1030
%ifarch %ix86
if test -f install_flash_player_linux_sa/flashplayer ; then
	install -Dpm 0755 install_flash_player_linux_sa/flashplayer %{buildroot}%{_bindir}/flashplayer
else
	install -Dpm 0755 flashplayer %{buildroot}%{_bindir}/flashplayer
fi
install -Dpm 0644 %{SOURCE4} %{buildroot}%{_datadir}/applications/flashplayer.desktop
install -Dpm 0644 %{SOURCE5} %{buildroot}%{_datadir}/pixmaps/flashplayer.png
%suse_update_desktop_file flashplayer
%endif
%endif
%endif

%if 0%{?suse_version} > 1100
%suse_update_desktop_file flash-player-properties
%endif

%post
# This is an ugly hack: flash-player hard-requires SSE2. rpm nor zypp can
# limit installation to SSE2 equipped systems only. We have to choose one
# from two bad things: Install and let it crash or install and
# deliberately break it. We do the second here. (bnc856386).
if ! grep -q '^flags.*sse2' /proc/cpuinfo ; then
	rm %{_libdir}/browser-plugins/libflashplayer.so
%if 0%{?suse_version} > 1030
%ifarch %ix86
	rm %{_bindir}/flashplayer
%endif
%endif
	echo >&2 "Flash Player requires CPU with SSE2. It cannot work on your system."
	echo >&2 "Please uninstall it!"
fi

%files
%defattr(-,root,root,-)
%doc readme.txt EULA
%{_libdir}/browser-plugins/libflashplayer.so
#/etc/adobe/mms.cfg
#%dir /etc/adobe
%if 0%{?suse_version} > 1020
%{_datadir}/icons/hicolor/*x*/apps/flash-player-properties.png
%endif
%if %build_standalone
%if 0%{?suse_version} > 1030
%ifarch %ix86
%{_bindir}/flashplayer
%{_datadir}/applications/flashplayer.desktop
%{_datadir}/pixmaps/flashplayer.png
%endif
%endif
%endif

%if 0%{?suse_version} > 1100

%files gnome
%defattr(-,root,root,-)
%{_bindir}/flash-player-properties
%{_datadir}/applications/flash-player-properties.desktop

%files kde4
%defattr(-,root,root,-)
%{_kde4_modulesdir}/kcm_adobe_flash_player.so
%{_kde4_servicesdir}/kcm_adobe_flash_player.desktop

%endif

%changelog
openSUSE Build Service is sponsored by