%define with_my_japo 0
#% define svnrevision 513
#% define rcversion 3
#% define betaversion a1

Name:           gecko-mediaplayer
Version:        1.0.7
Release:        1%{?betaversion:.%betaversion}%{?svnrevision:.svn%svnrevision}%{?rcversion:.rc%rcversion}%{?_dist_release}
Summary:        Gnome MPlayer browser plugin
Summary(ja):    Gnome MPlayer の Web ブラウザ用プラグイン

Group:          Applications/Multimedia
License:        GPLv2+
URL:            http://kdekorte.googlepages.com/gecko-mediaplayer
Source0:        http://gecko-mediaplayer.googlecode.com/files/%{name}-%{version}%{?betaversion:%betaversion}%{?svnrevision:.svn%svnrevision}%{?rcversion:.rc%rcversion}.tar.%{?svnrevision:xz}%{!?svnrevision:gz}
Source10:       gecko-mediaplayer-snapshot.sh

## vine
%if %{with_my_japo}
Source100:      gecko-mediaplayer-1.0.6b1-ja.po
%endif

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root

BuildRequires:  gmtk-devel >= 1.0.5
BuildRequires:  dbus-glib-devel
BuildRequires:  GConf2-devel
BuildRequires:  curl-devel
BuildRequires:  gettext
BuildRequires:  libX11-devel
#BuildRequires:  gecko-devel
BuildRequires:  xulrunner-devel >= 1.9.2

#Requires:       firefox >= 3.5
#Requires:       %{_libdir}/mozilla/plugins
Requires:       gnome-mplayer >= %{version}

Requires(pre):  GConf2
Requires(post): GConf2
Requires(preun): GConf2

Obsoletes:      mplayerplug-in <= 3.55

Distribution:	Vine Linux
Vendor:		Project Vine
Packager:	munepi

%description
Gecko Media Player is a browser plugin that uses GNOME MPlayer to play media in
a browser. It should work with all browsers on Unix-ish systems(Linux, BSD,
Solaris) and use the NS4 API (Mozilla, Firefox, Opera, etc.).

%description -l ja
Gecko Media Player は Web ブラウザ上でメディアを再生するために 
GNOME MPlayer を使う Web ブラウザ用プラグインです．
Unix-ish なシステム（Linux, BSD, Solaris）上のすべてのブラウザで
動作するはずで，NS4 API（Mozilla, Firefox, Opera など）を使います．


%prep
#% setup -q %{?rcversion:-n %{name}-%{version}.rc%{rcversion}}
%setup -q %{?betaversion:-n %{name}-%{version}%betaversion}

## vine
%if %{with_my_japo}
%__install -m644 %{SOURCE100} po/ja.po
%endif

%build
%configure \
    --enable-new-libxul \
    \
    --with-libcurl \
    ;
%__make %{?_smp_mflags}


%install
%__rm -rf $RPM_BUILD_ROOT
#export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
%__make install DESTDIR=$RPM_BUILD_ROOT
%find_lang %{name}

#remove intrusive docs
%__rm -rf $RPM_BUILD_ROOT%{_docdir}/gecko-mediaplayer


# %pre
# if [ "$1" -gt 1 ]; then
#     export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
#     gconftool-2 --makefile-uninstall-rule \
#       %{_sysconfdir}/gconf/schemas/gecko-mediaplayer.schemas >/dev/null || :
#     # If the schema file has ever been renamed::
#     #gconftool-2 --makefile-uninstall-rule \
#     #  %{_sysconfdir}/gconf/schemas/[OLDNAME].schemas > /dev/null || :
# fi


# %post
# export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
# gconftool-2 --makefile-install-rule \
#   %{_sysconfdir}/gconf/schemas/gecko-mediaplayer.schemas > /dev/null || :


# %preun
# if [ "$1" -eq 0 ]; then
#     export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
#     gconftool-2 --makefile-uninstall-rule \
#       %{_sysconfdir}/gconf/schemas/gecko-mediaplayer.schemas > /dev/null || :
# fi


%clean
%__rm -rf $RPM_BUILD_ROOT


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc COPYING ChangeLog
#%{_sysconfdir}/gconf/schemas/gecko-mediaplayer.schemas
%{_libdir}/mozilla/plugins/gecko-mediaplayer-dvx.so
%{_libdir}/mozilla/plugins/gecko-mediaplayer-qt.so
%{_libdir}/mozilla/plugins/gecko-mediaplayer-rm.so
%{_libdir}/mozilla/plugins/gecko-mediaplayer-wmp.so
%{_libdir}/mozilla/plugins/gecko-mediaplayer.so


%changelog
* Thu Nov  1 2012 Munehiro Yamamoto <munepi@vinelinux.org> 1.0.7-1
- new upstream release

* Mon Apr 16 2012 Munehiro Yamamoto <munepi@vinelinux.org> 1.0.6-3
- new upstream release

* Thu Apr  5 2012 Munehiro Yamamoto <munepi@vinelinux.org> 1.0.6-2.b1
- updated ja.po

* Sat Mar 24 2012 Munehiro Yamamoto <munepi@vinelinux.org> 1.0.6-1.b1
- new upstream release

* Fri Dec 30 2011 Munehiro Yamamoto <munepi@vinelinux.org> 1.0.5-1
- new upstream release

* Sat Oct 15 2011 Munehiro Yamamoto <munepi@vinelinux.org> 1.0.5-1.b1.svn477
- source 1.0.5b1
- updated ja.po
- added BuildRequires: gmtk-devel >= 1.0.5

* Sun Sep 25 2011 Munehiro Yamamoto <munepi@vinelinux.org> 1.0.4-4
- rebuilt with libnotify-0.7.4

* Mon Jul 04 2011 Munehiro Yamamoto <munepi@vinelinux.org> 1.0.4-3
- new upstream release

* Fri Jun 10 2011 Munehiro Yamamoto <munepi@vinelinux.org> 1.0.4-2.b2
- source 1.0.4b2

* Mon Jun 06 2011 Munehiro Yamamoto <munepi@vinelinux.org> 1.0.4-1.b1.svn450
- source snapshot 1.0.4b1.svn450
- do not use gconf

* Fri Apr 22 2011 Munehiro Yamamoto <munepi@vinelinux.org> 1.0.3-3
- new upstream release

* Thu Apr 21 2011 Munehiro Yamamoto <munepi@vinelinux.org> 1.0.3-2.beta.svn432
- dropped Requires: firefox

* Sun Apr 17 2011 Munehiro Yamamoto <munepi@vinelinux.org> 1.0.3-1.beta.svn432
- source snapshot 1.0.3beta r432

* Sat Nov 06 2010 Munehiro Yamamoto <munepi@vinelinux.org> 1.0.0-1
- new upstream release

* Tue Oct 12 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.9.99-2.rc3
- source 0.9.99.rc3

* Fri Aug 20 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.9.99-1.rc1
- source 0.9.99.rc1

* Thu Mar 04 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.9.9.2-1
- new upstream release

* Sat Feb 06 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.9.9-2
- new upstream release

* Thu Jan 28 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.9.9-1.svn347
- source snapshot r355

* Sat Jan 23 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.9.8-3.svn347
- source snapshot r347
  - fixed compile with libxul-1.9.2 or higher (r347, r338)
  - fixed crash on Apple site (r345)
  - added video/xmng, video/x-ms-asx minetypes (r344, r335)
- added gecko-mediaplayer-snapshot.sh

* Sat Jan 23 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.9.8-2
- dropped BuildRequires: xulrunner-devel-unstable

* Sun Sep 20 2009 Munehiro Yamamoto <munepi@vinelinux.org> 0.9.8-1
- new upstream release

* Sat Aug 22 2009 Munehiro Yamamoto <munepi@vinelinux.org> 0.9.7-1
- new upstream release

* Sat Jul 04 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 0.9.6-2
- added Requires: firefox >= 3.0 
  - require %%{_libdir}/mozilla/plugins
  - dropped Requires: %%{_libdir}/mozilla/plugins

* Sat Jun 06 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 0.9.6-1
- new upstream release

* Sun Mar 15 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 0.9.5-1
- new upstream release

* Fri Feb 06 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 0.9.4-1
- initial build
  - added ja.po

* Wed Feb  4 2009 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.9.4-1
- Updated to 0.9.4, no more xpt files
- Dropped the upsteamed patch
- Updated the URL

* Thu Jan  8 2009 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.9.3-2
- Added patch fixing rpmfusion bug #290 from SVN

* Sat Jan  3 2009 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.9.3-1
- Updated to 0.9.3

* Mon Nov 24 2008 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.9.2-2
- s/gnome-mplayer-core-functionality/gnome-mplayer-binary

* Sat Nov 22 2008 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.9.2-1
- Updated to 0.9.2
- Require gnome-mplayer-core-functionality instead of gnome-mplayer

* Fri Oct 31 2008 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.9.0-1
- Updated to 0.9.0

* Mon Sep 29 2008 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.8.0-1.1
- Updated to 0.8.0

* Sun Aug 17 2008 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.7.0-1.1
- Updated to 0.7.0

* Wed Jul 30 2008 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info - 0.6.3-3
- rebuild for buildsys cflags issue

* Wed Jul 30 2008 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info - 0.6.3-2
- rebuild for buildsys cflags issue

* Sun Jul  6 2008 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.6.3-1
- Updated to 0.6.3

* Wed May 28 2008 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.6.2-1
- Updated to 0.6.2

* Thu Apr 17 2008 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.6.1-1
- Updated to 0.6.1
- Updated URL and Source0
- Dropped upstreamed patch
- Dropped the rpmfusion-specific readme

* Fri Mar  7 2008 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.6.0-3
- Added patch fixing unnecessary libxul-embedding.pc from SVN

* Fri Feb 29 2008 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.6.0-2
- Switched to gecko-devel virtual provides
- Made the mplayerplug-in obsoletion versioned
- Ditto gnome-mplayer requirement

* Wed Feb 13 2008 Julian Sikorski <belegdol[at]gmail[dot]com> - 0.6.0-1
- Initial rpmfusion release
