Name:          flashplugin
Version:       @SRPMVERSION@
Release:       @SRPMRELEASE@
Epoch:         1
Summary:       Macromedia Flash plugin for web browsers
Group:         Applications/Web
Vendor:        @vendor@
Distribution:  @distribution@
Packager:      Silvan Calarco <silvan.calarco@mambasoft.it>
URL:           http://macromedia.rediris.es/
Source:        LICENSE
License:       Non Distributable
BuildPrereq:   wget
BuildPrereq:   /usr/bin/tempfile
# NOTE: requires the backward compatible version of the libstdc++ library
Obsoletes:     flash
Provides:      flash = %{version}
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

%description
Macromedia Flash plugin for web browsers.

%prep
%setup -c -n %{name}-%{version} -D -T

[ -r /etc/sysconfig/@sysconfigfile@ ] || exit 1
declare -A SRPMVERSION SRPMRELEASE
. /etc/sysconfig/@sysconfigfile@

[ "${FLASH_PLUGIN_PCK}" ] || exit 1
[ "${FLASH_PLUGIN_URL}" ] || \
   FLASH_PLUGIN_URL="http://macromedia.rediris.es/rpmsource/"

tmpdir=$(mktemp -q -d -t flashplugin.XXXXXXXX)
[ $? -eq 0 ] || exit 1

[ -f ${tmpdir}/${FLASH_PLUGIN_PCK} ] ||
   wget -nv --timeout=10 --tries=2 \
      ${FLASH_PLUGIN_URL}${FLASH_PLUGIN_PCK} -O ${tmpdir}/${FLASH_PLUGIN_PCK}
[ -f ${tmpdir}/${FLASH_PLUGIN_PCK} ] || exit 1

if [ `echo ${FLASH_PLUGIN_PCK} | grep "tar.bz2$"` ]; then   
   tar xjf ${tmpdir}/${FLASH_PLUGIN_PCK}
else
   tar xzf ${tmpdir}/${FLASH_PLUGIN_PCK}
fi

%build -q

%install
[ "%{buildroot}" != / ] && rm -rf %{buildroot}

install -D libflashplayer.so \
    %{buildroot}%{_libdir}/mozilla/plugins/flashplayer.so

cp %{S:0} LICENSE

rm -fr ${tmpdir}

%clean
[ "%{buildroot}" != / ] && rm -rf %{buildroot}

%files
%defattr(-,root,root)
%{_libdir}/mozilla/plugins/flashplayer.so
%doc LICENSE

%changelog
* Fri Jun 18 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 10.1-1mamba
- changed version to 10.1
- rename plugin from libflashplayer.so to flashplayer.so

* Fri Dec 05 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 10-1mamba
- changed version to 10

* Mon Oct 01 2007 Silvan Calarco <silvan.calarco@mambasoft.it> 9-1mamba
- changed version to 9
- added support for both bz2 and gzip source archives

* Thu Feb 01 2007 Davide Madrisan <davide.madrisan@qilinux.it> 0.9-1qilnx
- get download parameters from a sysconfig file

* Sun Dec 24 2006 Silvan Calarco <silvan.calarco@qilinux.it> 7.0.69-1qilnx
- update to 7.0.69

* Tue May 09 2006 Silvan Calarco <silvan.calarco@qilinux.it> 7.0.63-2qilnx
- fix installation paths
- add LICENSE file

* Tue May 02 2006 Silvan Calarco <silvan.calarco@qilinux.it> 7.0.63-1qilnx

* Tue May 02 2006 Silvan Calarco <silvan.calarco@qilinux.it> 7.0.63-1qilnx
- new version build
- download flash from macromedia.rediris.es

* Mon Nov 28 2005 Massimo Pintore <massimo.pintore@qilinux.it> 7.0.61-1qilnx
- new version build
-  changed repository

* Fri May 28 2004 Silvan Calarco <silvan.calarco@qilinux.it> 7.0.25-1qilnx
- new version build

* Wed Nov 06 2003 Davide Madrisan <davide.madrisan@qilinux.it> 6.0r79-2qilnx
- specfile

* Tue Jul 22 2003 Silvan Calarco <silvan.calarco@qinet.it> 6.0r79-1qilnx
- first build for Flash
