# Packmangroup: Multimedia
# Packmanpackagename: mplayerplug-in
# Packman: Rainer Lay
# Packmandepends: MPlayer

Name:           mplayerplug-in
Version:        3.25
Release:        0.pm.0
Packager:       Rainer <rainer@links2linux.de>
Vendor:         suse
Distribution:	SUSE LINUX 10.1 (i586)

Source0:        mplayerplug-in-3.25.tar.gz

BuildRoot:      %{_tmppath}/buildroot-%{name}-%{version}

License:        GPL
Group: 		Browser/Plugin
Summary: 	MPlayer Plugin for Netscape/Mozilla
Summary(de): 	MPlayer Plugin fuer Netscape/Mozilla
URL: 		http://mplayerplug-in.sourceforge.net/
Requires:	MPlayer
BuildRequires:	gecko-sdk

Requires:	atk >= %( rpm -q --queryformat '%{VERSION}' atk )
Requires:	cairo >= %( rpm -q --queryformat '%{VERSION}' cairo )
Requires:	fontconfig >= %( rpm -q --queryformat '%{VERSION}' fontconfig )
Requires:	freetype2 >= %( rpm -q --queryformat '%{VERSION}' freetype2 )
Requires:	glib2 >= %( rpm -q --queryformat '%{VERSION}' glib2 )
Requires:	glibc >= %( rpm -q --queryformat '%{VERSION}' glibc )
Requires:	glitz >= %( rpm -q --queryformat '%{VERSION}' glitz )
Requires:	gtk2 >= %( rpm -q --queryformat '%{VERSION}' gtk2 )
Requires:	libgcc >= %( rpm -q --queryformat '%{VERSION}' libgcc )
Requires:	libpng >= %( rpm -q --queryformat '%{VERSION}' libpng )
Requires:	libstdc++ >= %( rpm -q --queryformat '%{VERSION}' libstdc++ )
Requires:	pango >= %( rpm -q --queryformat '%{VERSION}' pango )
Requires:	xorg-x11-libs >= %( rpm -q --queryformat '%{VERSION}' xorg-x11-libs )
Requires:	zlib >= %( rpm -q --queryformat '%{VERSION}' zlib )

%define config_dir /etc

%description
mplayerplug-in is a Netscape/Mozilla browser plugin to allow playing embedded movies on web pages.

Should work with Mozilla and MozillaFirefox

%description -l de
mplayerplug-in ist ein Netscape/Mozilla browser plugin, dass das Abspielen von eingebetteten 
Filmen erlaubt.

Sollte mit Mozilla und MozillaFirefox funktionieren.

%prep
%setup -qn %{name}

%build
export CFLAGS="`/opt/mozilla/bin/mozilla-config --cflags`"
%configure --enable-wmp --enable-qt --enable-rm --enable-gmp
make %{?jobs:-j%jobs}

%install
[ -d %{buildroot} -a "%{buildroot}" != "" ] && rm -rf  %{buildroot}
./install.sh %{buildroot}
mv %{buildroot}%_libdir/mozilla/plugins %{buildroot}%_libdir/browser-plugins
rmdir  %{buildroot}%_libdir/mozilla
chmod -x %{buildroot}%_libdir/browser-plugins/*xpt

%post
for d in /opt/mozilla/lib /opt/MozillaFirefox/lib ; do
  for mod in in-gmp in-qt in-rm in-rm in-wmp in ; do
    if [ -d $d/plugins    ]; then ln -sf %_libdir/browser-plugins/mplayerplug-$mod.so $d/plugins/;     fi
    if [ -d $d/components ]; then ln -sf %_libdir/browser-plugins/mplayerplug-$mod.xpt $d/components/; fi
  done
done

%postun
for d in /opt/mozilla/lib /opt/MozillaFirefox/lib ; do
  for mod in in-gmp in-qt in-rm in-rm in-wmp in ; do
    if [ -e $d/plugins/mplayerplug-$mod.so     ]; then rm -f $d/plugins/mplayerplug-$mod.so ; fi
    if [ -e $d/components/mplayerplug-$mod.xpt ]; then rm -f $d/components/mplayerplug-$mod.xpt ; fi
  done
done

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

%files
%defattr (-,root,root)
%doc DOCS ChangeLog INSTALL LICENSE README TODO 
%{_prefix}/%{_lib}/browser-plugins/mplayerplug-in.so
%{_prefix}/%{_lib}/browser-plugins/mplayerplug-in.xpt
%{_prefix}/%{_lib}/browser-plugins/mplayerplug-in-gmp.so
%{_prefix}/%{_lib}/browser-plugins/mplayerplug-in-gmp.xpt
%{_prefix}/%{_lib}/browser-plugins/mplayerplug-in-qt.so
%{_prefix}/%{_lib}/browser-plugins/mplayerplug-in-qt.xpt
%{_prefix}/%{_lib}/browser-plugins/mplayerplug-in-rm.so
%{_prefix}/%{_lib}/browser-plugins/mplayerplug-in-rm.xpt
%{_prefix}/%{_lib}/browser-plugins/mplayerplug-in-wmp.so
%{_prefix}/%{_lib}/browser-plugins/mplayerplug-in-wmp.xpt
%_datadir/locale/*/LC_MESSAGES/mplayerplug-in.mo
%{config_dir}/%{name}.*

%changelog
* Fri Aug 12 2005  <rainer@links2linux.de> - <3.05>-<0.pm.2>
- fix for postun

* Thu Aug 11 2005  <rainer@links2linux.de> - <3.05>-<0.pm.1>
- added xpi

* Tue Sep 28 2004 Rainer Lay <rainer@links2linux.de> <2.70>-<0.pm.1>
- enabled for MozillaFirefox

* Tue Nov 18 2003  <rainer@links2linux.de> <1.0pre2>
- adjusted mozilla plugin path

* Mon Nov 17 2003 Rainer Lay <rainer@links2linux.de> 3.21-0.pm.0
- added etc files
- added german desc

* Sun Jun 08 2003 Henne Vogelsang <henne@links2linux.de>
- First think then release! fixed post script
* Sun Jun 08 2003 Henne Vogelsang <henne@links2linux.de>
- Initial Package, Version 0.80
