--- /dev/null
+Summary: GenReS browser scriptable plugin
+Summary(pl): GenReS - skryptowalna wtyczka do przegladarki
+Name: browser-plugin-genres
+Version: 0.9.2
+Release: 1
+License: GPL
+Group: X11/Applications/Multimedia
+Source0: http://download.savannah.nongnu.org/releases/genres/genres-%{version}.tar.bz2
+# Source0-md5: 795f62635a28caef2b75383bc6422c50
+Patch0: genres-mozilla-config.patch
+Patch1: genres-itvp.patch
+URL: https://savannah.nongnu.org/projects/genres
+BuildRequires: XFree86-devel
+BuildRequires: mozilla-firefox-devel
+Requires: perl-Gtk2
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%define _plugindir %{_libdir}/browser-plugins
+%define browsers mozilla, mozilla-firefox
+
+%description
+GenReS is a generic reconfigurable scriptable plugin for
+Mozilla/Firefox. It allows to use external programs for EMBED or
+OBJECT HTML tags. The plugin is supplied with a Perl script for
+embedding mplayer and mencoder in a browser and controlling it with
+Javascript. It allows to play audio and video files and streams and to
+record them to set of files. Manipulations with object variables in
+JavaScript are translated to a Perl program. Status messages from the
+controlled program (mplayer or mencoder) are translated back to
+Javascript object variables, and Javascript functions are called for
+notifications.
+
+Supported browsers: %{browsers}.
+
+%description -l pl
+GenReS to uniwersalny skryptowalny plugin dla Mozilli/Firefoksa.
+Umo¿liwia u¿ywanie zewnêtrznych programów do obs³ugi tagów EMBED i
+OBJECT. Plugin pe³ni rolê interfejsu miêdzy stron± www/JavaScriptem, a
+skryptem zdefiniowanym do obs³ugi danego typu mime. Dwustronna
+komunikacja miêdzy skryptem a stron± oparta jest na strumieniach
+we/wy, dziêki czemu tworzenie skryptów jest proste, mo¿na je pisaæ w
+dowolnym jêzyku. W pakiecie znajduje siê przyk³adowy, ale w pe³ni
+funkcjonalny skrypt napisany w Perlu embeduj±cy mplayera oraz
+mencodera i umo¿liwiaj±cy ich kontrolê z okna przegl±darki.
+
+%prep
+%setup -q -n genres-%{version}
+%patch0 -p1
+%patch1 -p1
+
+%build
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -D genres.so $RPM_BUILD_ROOT%{_plugindir}/genres.so
+install -D slaves/video/mplayer.sh $RPM_BUILD_ROOT%{_libdir}/genres/mplayer.sh
+install -D doc/genres.conf $RPM_BUILD_ROOT%{_sysconfdir}/genres.conf
+%{__make} DESTDIR=$RPM_BUILD_ROOT install
+rm -rf $RPM_BUILD_ROOT%{_libdir}/mozilla
+rm -rf $RPM_BUILD_ROOT%{_libdir}/mozilla-firefox
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%triggerin -- mozilla-firefox
+%nsplugin_install -d %{_libdir}/mozilla-firefox/plugins genres.so genres.so
+
+%triggerun -- mozilla-firefox
+%nsplugin_uninstall -d %{_libdir}/mozilla-firefox/plugins genres.so genres.so
+
+%triggerin -- mozilla
+%nsplugin_install -d %{_libdir}/mozilla/plugins genres.so genres.so
+
+%triggerun -- mozilla
+%nsplugin_uninstall -d %{_libdir}/mozilla/plugins genres.so genres.so
+
+%files
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_plugindir}/genres.so
+%attr(644,root,root) %{_sysconfdir}/genres.conf
+%attr(755,root,root) %{_libdir}/genres/config.pl
+%attr(755,root,root) %{_libdir}/genres/mplayer.pl
+%attr(755,root,root) %{_libdir}/genres/mplayer.sh
+%attr(755,root,root) %{_libdir}/genres/slaves
+%doc README.en.html example
--- /dev/null
+diff -ur genres-0.9.2/doc/genres.conf genres-0.9.2-ah/doc/genres.conf
+--- genres-0.9.2/doc/genres.conf 2006-05-13 21:49:44.000000000 +0200
++++ genres-0.9.2-ah/doc/genres.conf 2006-06-24 01:39:15.000000000 +0200
+@@ -1,6 +1,6 @@
+ #common configuration file for GenRes plugin
+ #put it to ~/.mozilla/genres or /etc
+
+-mozillastreams=1 # use mozilla streams (and cache), 0 - not use
++mozillastreams=0 # use mozilla streams (and cache), 0 - not use
+ debuglevel=10 # full debug output, 0 - quiet
+ background=-1 # 0 - black, 1 - white, -1 - mozilla default
+diff -ur genres-0.9.2/slaves/video/mplayer.pl genres-0.9.2-ah/slaves/video/mplayer.pl
+--- genres-0.9.2/slaves/video/mplayer.pl 2006-05-13 22:57:46.000000000 +0200
++++ genres-0.9.2-ah/slaves/video/mplayer.pl 2006-06-24 01:38:58.000000000 +0200
+@@ -30,8 +30,8 @@
+ ## Parameters from the config file ##
+ $conffile="$ENV{HOME}/.mozilla/genres/mplayer.conf";
+ %cfg=(
+- vo=>[x11, 'text', "Video output driver (see mplayer -vo help)"],
+- ao=>["esd,arts,oss,alsa", 'text', "Audio output driver (see mplayer -ao help)"],
++ vo=>["xv,x11", 'text', "Video output driver (see mplayer -vo help)"],
++ ao=>["alsa,esd,arts,oss,null", 'text', "Audio output driver (see mplayer -ao help)"],
+ not_ask=> [0, 'checkbox', "Never show file save dialog again."],
+ out_file=>['%@-%Y-%m-%d_%H-%M-%S.avi', 'file', "Write video to file(s)",
+ "%@ in the filename will be replaced to source URL\n"
+@@ -371,7 +371,8 @@
+ $sl2p=open(SL2W,$cmd2);
+ } else {
+ $OPTS.=" -ao $cfg{ao}[0]" if $cfg{ao}[0];
+- $cmd="mplayer $OPTS -vo $cfg{vo}[0] -zoom -nojoystick -slave -nomouseinput -cookies '$href'";
++ my $pls = ($href =~ /asx$/) ? "-playlist" : "";
++ $cmd="mplayer $OPTS -vo $cfg{vo}[0] -zoom -nojoystick -slave -nomouseinput -cookies $pls '$href'";
+ print "cmd=$cmd\n";
+ runslv $cmd;
+ }
--- /dev/null
+diff -ur genres-0.9.2/Makefile genres-0.9.2-patch/Makefile
+--- genres-0.9.2/Makefile 2006-04-24 22:00:20.000000000 +0200
++++ genres-0.9.2-patch/Makefile 2006-06-22 23:09:14.000000000 +0200
+@@ -39,7 +39,7 @@
+ #
+ RELEASE=$(shell awk -F '[()]' '/\(.*\)/ { print $$2; exit; }' <debian/changelog)
+ PATH:=${PATH}:/usr/local/mozilla/bin:/usr/lib/mozilla/bin:/opt/mozilla/bin
+-CFLAGS= -Wall -Os -DXP_UNIX -DMOZ_X11 -DXTHREADS ` mozilla-config --cflags xpcom` -fPIC -DRELEASE="\"${RELEASE}\""
++CFLAGS= -Wall -Os -DXP_UNIX -DMOZ_X11 -DXTHREADS -I/usr/include/mozilla-firefox/plugin -I/usr/include/nspr -I/usr/include/mozilla-firefox/java -I/usr/include/mozilla-firefox/xpcom -fPIC -DRELEASE="\"${RELEASE}\""
+ OBJ=main_thread.o observer_thread.o threadqueue.o slavesdir.o storage.o settings.o
+ INSTALL=install -Dp -g root -o root
+ LIBPREFIX=$(DESTDIR)/usr/lib
+diff -ur genres-0.9.2/threadqueue.cpp genres-0.9.2-patch/threadqueue.cpp
+--- genres-0.9.2/threadqueue.cpp 2006-03-22 22:02:09.000000000 +0100
++++ genres-0.9.2-patch/threadqueue.cpp 2006-06-22 23:13:32.000000000 +0200
+@@ -18,7 +18,7 @@
+ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ #include "nsCOMPtr.h"
+-#include "nsIServiceManagerUtils.h"
++#include "nsServiceManagerUtils.h"
+ #include "nsIEventQueueService.h"
+ #include "nsIEventQueue.h"
+ #include <stdio.h>