%define srcname bmp
#%%define extraver rc2

# build ALSA output plugin
%define with_alsa 1

Summary:	Beep Media Player
Name:		beepmp
Version:	0.9.7.1
Release:	1%{?_dist_release}
License:	GPL
Group:		Applications/Multimedia
URL:		http://bmp.beep-media-player.org/
Source:		http://prdownloads.sourceforge.net/beepmp/bmp-%{version}%{?extraver:%extraver}.tar.gz
Source1:	%{name}.desktop
# based on bmp-%{version}'s ja.po
Source2:	beepmp-0.9.7.1-ja.po
Patch2:		beepmp-0.9.7-except-flac.patch
BuildRoot:	%{_tmppath}/%{name}-%{version}-root
Requires:	gtk2 >= 2.4.0, libglade2 >= 2.3.1
Requires:	esound >= 0.2, libvorbis, id3lib
BuildRequires:	gtk2-devel >= 2.4.0, libglade2-devel >= 2.3.1
BuildRequires:	esound-devel >= 0.2, libvorbis-devel, id3lib-devel

Requires(post):   ldconfig, desktop-file-utils
Requires(postun): ldconfig, desktop-file-utils

Vendor:		Project Vine
Distribution:	Vine Linux

%description
Beep Media Player (BMP) is a GTK2 port of the popular X Multimedia
System (XMMS) and more.

%description -l ja
Beep Media Player (BMP) は定番の X Multimedia System (XMMS) を GTK2 に
移植したメディアプレイヤーです。

%package devel
Summary:	BMP - Static libraries and header files.
Summary(ja):	BMP - 静的ライブラリ及びヘッダファイル
Group:		Development/Libraries
Requires:	%{name} = %{version}-%{release}, gtk2-devel

%description devel
Static libraries and header files required for compiling Beep Media Player
plugins.

%description -l ja devel
Beep Media Player のプラグインをコンパイルするのに必要な静的ライブラリ
及びヘッダファイルです。

%if %{with_alsa}
%package alsa
Summary:	BMP - ALSA output plugin
Summary(ja):	BMP - ALSA 出力プラグイン
Group:		Applications/Multimedia
Requires:	%{name} = %{version}-%{release}
Requires:	alsa-lib >= 1.0.0
BuildRequires:	alsa-lib-devel >= 1.0.0

%description alsa
Output plugin for Beep Media Player to use with the Advanced Linux Sound
Architecture (ALSA).

%description -l ja alsa
Beep Media Player で Advanced Linux Sound Architecture (ALSA) を用いて
音声を出力するためのプラグインです。
%endif

%prep
%setup -q -n %{srcname}-%{version}%{?extraver:%extraver}

%patch2 -p1 -b .ex-flac
%__cp -f %{SOURCE2} po/ja.po

%build
%configure \
%if ! %{with_alsa}
	--disable-alsa \
%endif
	--disable-gconf \
	--disable-gnome-vfs
%__make %{_smp_mflags}
( cd po ; %__make update-gmo )

%install
%__rm -rf %{buildroot}
%__make DESTDIR=%{buildroot} install
%find_lang %{srcname}

%__rm -f %{buildroot}%{_libdir}/bmp/*/*.la
%__rm -f %{buildroot}%{_datadir}/applications/bmp.desktop
%__install -p -m644 %{SOURCE1} %{buildroot}%{_datadir}/applications

%__mv -f %{buildroot}%{_datadir}/pixmaps/bmp.png %{buildroot}%{_datadir}/pixmaps/beepmp.png

%post
%{_syssbindir}/ldconfig
%{_bindir}/update-desktop-database %{_datadir}/applications >& /dev/null ||:

%postun
%{_syssbindir}/ldconfig
%{_bindir}/update-desktop-database %{_datadir}/applications >& /dev/null ||:

%clean
%__rm -rf %{buildroot}

%files -f %{srcname}.lang
%defattr(-,root,root,-)
%doc AUTHORS COPYING ChangeLog NEWS README FAQ
%{_bindir}/beep-media-player
%{_datadir}/bmp
%{_datadir}/pixmaps/*
%{_datadir}/applications/%{name}.desktop
%dir %{_libdir}/bmp
%dir %{_libdir}/bmp/Input
%{_libdir}/bmp/Input/libcdaudio.so
%{_libdir}/bmp/Input/libwav.so
%{_libdir}/bmp/Input/libmpg123.so
%{_libdir}/bmp/Input/libvorbis.so
%dir %{_libdir}/bmp/Output
%{_libdir}/bmp/Output/*.so
%if %{with_alsa}
%exclude %{_libdir}/bmp/Output/libALSA.*
%endif
%{_libdir}/bmp/Visualization
%{_libdir}/lib*.so.*
%{_mandir}/man1/*

%files devel
%defattr(-,root,root,-)
%{_includedir}/bmp
%{_libdir}/lib*.so
%{_libdir}/lib*.la
#%{_libdir}/lib*.a
%{_libdir}/pkgconfig/*.pc

%if %{with_alsa}
%files alsa
%defattr(-,root,root,-)
%{_libdir}/bmp/Output/libALSA.so
%endif

%changelog
* Fri Aug 15 2008 Shu KONNO <owa@bg.wakwak.com> 0.9.7.1-1vl5
- applied new versioning policy, spec in utf-8

* Mon May 21 2007 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 0.9.7.1-0vl3
- rebuilt with new toolchain

* Sat Jan 14 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 0.9.7.1-0vl2
- fix %%files

* Wed Jan 11 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 0.9.7.1-0vl1
- upstream release
- drop obsolete patches
- update ja.po

* Thu Jun 23 2005 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 0.9.7-0vl5
- rebuild with alsa support
- remove %%{_libdir}/bmp/*/*.la

* Fri Apr 01 2005 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 0.9.7-0vl4
- add beepmp.png (source3)
- update desktop file
  - add application/ogg
  - use beepmp.png
- run update-desktop-database at post/postun
- add Requires(post/postun): ldconfig, desktop-file-utils

* Thu Feb 10 2005 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 0.9.7-0vl3
- add except-flac.patch (patch2)
      to prevent mpg123 plugin's hijacking FLAC stream
  (ref. http://bugs.xmms.org/show_bug.cgi?id=2038)

* Sat Jan 29 2005 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 0.9.7-0vl2
- use correct field name "date" in vorbis plugin (patch1)
  - thanks, MVA [VinePlus:02251]
- fix typo in ja.po

* Sun Dec 12 2004 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 0.9.7-0vl1
- upstream release
- update ja.po

* Fri Nov 12 2004 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 0.9.7-0vl0.rc2.2
- update ja.po

* Sun Nov 07 2004 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 0.9.7-0vl0.rc2.1
- update ja.po
- add playlist-drawstring-utf8.patch (patch1)

* Fri Nov 05 2004 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 0.9.7-0vl0.rc2
- initial build for Vine Linux

* Tue Jul 6 2004 Chong Kai Xiong <descender@phreaker.net> 0:0.9.7-1
- fixed file list to own package-specific directories
- remove vendor, add epoch tag, explicit requires, add unzip to requires
- force version match between plugins and main package
- use %find_lang
- don't install INSTALL

* Thu Jun 24 2004 Chong Kai Xiong <descender@phreaker.net> 0.9.7-3
- added support for GConf and GNOME VFS
- fixed file list

* Fri May 28 2004 Chong Kai Xiong <descender@phreaker.net> 0.9.7-2
- require libglade 2.0

* Sun Apr 05 2004 Chong Kai Xiong <descender@phreaker.net> 0.9.7-1
- require GTK 2.4 and ALSA 1.0

* Tue Jan 13 2004 David Lau <coder_sku@sourceforge.net> 0.9.6-3
- removes plugin .la's

* Wed Dec 24 2003 Chong Kai Xiong <descender@phreaker.net> 0.9.6-2
- first fully usable version

* Tue Nov 29 2003 Chong Kai Xiong <descender@phreaker.net> 0.9.6-1
- added support for --with switches

* Tue Nov 11 2003 Chong Kai Xiong <descender@phreaker.net> 1.0.0pre6
- initial build
