# to enable features, rpmbuild with '--with feature'
%define with_aac	%{?_with_aac:1}%{!?_with_aac:0}
%define with_wma	%{?_with_wma:1}%{!?_with_wma:0}
%define with_lame	%{?_with_lame:1}%{!?_with_lame:0}

%define _audacious_ver		2.1-1%{?_dist_release}
%define _gtk2_ver		2.8.0
%define _glib2_ver		2.10.0
# to build OSD plugin, pango >= 1.14.7, cairo >= 1.2.6 are required
%define _pango_ver		1.8.0
%define _esound_ver		0.2
%define _libvorbis_ver		1.0
%define _libogg_ver		1.0
%define _libsndfile_ver		0.19
%define _flac_ver		1.2.0
%define _arts_ver		0.9.5
%define _alsa_ver		1.0
%define _libmb_ver		2.0.0
%define _curl_ver		7.9.7
%define _libxml2_ver		2.0.0
%define _sdl_ver		1.2.5
%define _libmtp_ver		0.3.5

#%%define extraver alpha5

%define plugindir %{_libdir}/audacious

Summary:	Audacious Media Player plugins
Summary(ja):	Audacious メディアプレイヤー プラグイン集
Name:		audacious-plugins
Version:	2.1
Release:	1%{?_dist_release}
# LGPLv2+: adplug, bio2jack, rocklight
# MIT: crystalizer, dockalbumart
# BSD: lastfm
License:	GPLv2 and GPLv2+ and LGPLv2+ and MIT and BSD
Group:		Applications/Multimedia
URL:		http://audacious-media-player.org/
Source:		http://distfiles.atheme.org/audacious-plugins-%{version}%{?extraver:-%extraver}.tgz
#Source1:	audacious-plugins-1.3.0-ja.po
#Source2:	audacious-plugins-1.3.0-POTFILES.in
Patch10:	audacious-plugins-1.5.1-libmtp-0.3.5-API.patch
BuildRoot:	%{_tmppath}/%{name}-%{version}-root

BuildRequires:	audacious-devel >= %{_audacious_ver}
BuildRequires:	glib2-devel >= %{_glib2_ver}, gtk2-devel >= %{_gtk2_ver}
BuildRequires:	pango-devel >= %{_pango_ver}
BuildRequires:	esound-devel >= %{_esound_ver}
#BuildRequires:	libmad-devel
BuildRequires:	libvorbis-devel >= %{_libvorbis_ver}
BuildRequires:	libogg-devel >= %{_libogg_ver}
BuildRequires:	libsndfile-devel >= %{_libsndfile_ver}
BuildRequires:	flac-devel >= %{_flac_ver}
BuildRequires:	arts-devel >= %{_arts_ver}
BuildRequires:	alsa-lib-devel >= %{_alsa_ver}
BuildRequires:	libmusicbrainz-devel >= %{_libmb_ver}
BuildRequires:	curl-devel >= %{_curl_ver}
BuildRequires:	libxml2-devel >= %{_libxml2_ver}
BuildRequires:	SDL-devel >= %{_sdl_ver}
BuildRequires:	libprojectm-devel
BuildRequires:	libsamplerate-devel
BuildRequires:	mesa-libGLU-devel
BuildRequires:	neon-devel
BuildRequires:	lirc
BuildRequires:	pulseaudio-libs-devel
BuildRequires:  libmtp-devel >= %{_libmtp_ver}
BuildRequires:  jack-audio-connection-kit-devel
BuildRequires:  bluez-libs-devel

Requires:	audacious >= %{_audacious_ver}
Requires:	glib2 >= %{_glib2_ver}, gtk2 >= %{_gtk2_ver}
Requires:	pango >= %{_pango_ver}
#Requires:	libmad
Requires:	libvorbis >= %{_libvorbis_ver}
Requires:	libogg >= %{_libogg_ver}
Requires:	libsndfile >= %{_libsndfile_ver}
Requires:	alsa-lib >= %{_alsa_ver}
Requires:	libxml2 >= %{_libxml2_ver}

Obsoletes:	audacious < 1.2.0
Obsoletes:	beepmp, beepmp-alsa

Vendor:		Project Vine
Distribution:	Vine Linux

%description
Audacious is a media player that currently uses a skinned user interface
based on Winamp 2.x skins.

This package provides essential plugins for audio input, audio output and
visualization.

%package -n audacious-jack
Summary: Audacious output plugin for JACK sound service
Group: Applications/Multimedia
Requires: audacious >= %{_audacious_ver}

%description -n audacious-jack
This package provides an Audacious output plugin that uses the
JACK sound service.

%package -n audacious-flac
Summary:	Audacious plugin to play FLAC files
Summary(ja):	FLAC ファイルを再生するための Audacious プラグイン
Group:		Applications/Multimedia
Requires:	audacious >= %{_audacious_ver}
Requires:	flac >= %{_flac_ver}
Obsoletes:	beepmp-flac

%description -n audacious-flac
This package contains a input plugin that enables playback of FLAC files
in Audacious.

%description -l ja -n audacious-flac
このパッケージには、Audacious で FLAC ファイル (*.flac/fla) を再生するため
の入力プラグインが含まれています。

%package -n audacious-tta
Summary:	Audacious plugin to play TTA files
Summary(ja):	TTA ファイルを再生するための Audacious プラグイン
Group:		Applications/Multimedia
Requires:	audacious >= %{_audacious_ver}
#Requires:	libid3tag

%description -n audacious-tta
This package contains a input plugin that enables playback of TTA files
in Audacious.

%description -l ja -n audacious-tta
このパッケージには、Audacious で TTA ファイル (*.tta) を再生するための
入力プラグインが含まれています。

%if %{with_aac}
%package -n audacious-aac
Summary:	Audacious plugin to play AAC files
Summary(ja):	AAC ファイルを再生するための Audacious プラグイン
Group:		Applications/Multimedia
Requires:	audacious >= %{_audacious_ver}

%description -n audacious-aac
This package contains a input plugin that enables playback of AAC files
in Audacious.

%description -l ja -n audacious-aac
このパッケージには、Audacious で AAC ファイル (*.aac) を再生するため入力
プラグインが含まれています。
%endif

%if %{with_wma}
%package -n audacious-wma
Summary:	Audacious plugin to play WMA files
Summary(ja):	WMA ファイルを再生するための Audacious プラグイン
Group:		Applications/Multimedia
Requires:	audacious >= %{_audacious_ver}

%description -n audacious-wma
This package contains a input plugin that enables playback of WMA files
in Audacious.

%description -l ja -n audacious-wma
このパッケージには、Audacious で WMA ファイル (*.wma) を再生するため入力
プラグインが含まれています。
%endif

%if %{with_lame}
%package -n audacious-lame
Summary:	Audacious plugin to encode MP3 files using LAME
Summary(ja):	LAME を利用して MP3 ファイルをエンコードするための Audacious プラグイン
Group:		Applications/Multimedia
BuildRequires:	lame-devel
Requires:	audacious >= %{_audacious_ver}
Requires:	lame

%description -n audacious-lame
This package contains a output plugin that enables encoding of MP3 files
using LAME in Audacious.

%description -l ja -n audacious-lame
このパッケージには、Audacious で LAME を利用して MP3 ファイル (*.mp3) を
エンコードするため出力プラグインが含まれています。
%endif

%package -n audacious-esd
Summary:	Audacious plugin to output audio via EsounD
Summary(ja):	Audacious EsounD オーディオ出力プラグイン
Group:		Applications/Multimedia
Requires:	audacious >= %{_audacious_ver}
Requires:	esound >= %{_esound_ver}

%description -n audacious-esd
This package contains an audio output plugin via EsounD for Audacious.

%description -l ja -n audacious-esd
このパッケージには、Audacious で EsounD を用いて音声を出力するための
プラグインが含まれています。

%package -n audacious-scrobbler
Summary:	Audacious plugin to use audioscrobbler
Summary(ja):	Audacious audioscrobbler プラグイン
Group:		Applications/Multimedia
Requires:	audacious >= %{_audacious_ver}
Requires:	libmusicbrainz >= %{_libmb_ver}
Requires:	curl >= %{_curl_ver}
Obsoletes:	audioscrobbler-beepmp

%description -n audacious-scrobbler
This package contains an audioscrobbler plugin for Audacious.

%package -n audacious-visualization
Summary:	Audacious visualization plugins
Summary(ja):	Audacious 視覚化プラグイン
Group:		Applications/Multimedia
Requires:	audacious >= %{_audacious_ver}
Requires:	SDL >= %{_sdl_ver}
Requires:	libprojectm
Obsoletes:	audacious-paranormal

%description -n audacious-visualization
This package contains extra visualization plugin for Audacious.

%description -l ja -n audacious-visualization
このパッケージには、Audacious で再生した音声を視覚化する追加のプラグインが
含まれています。

%prep
%setup -q -n %{name}-%{version}%{?extraver:-%extraver}
#patch10 -p1

# update ja.po
#%__cp -f %{SOURCE1} po/ja.po
# overwrite POTFILES.in
#%__cp -f %{SOURCE2} po/POTFILES.in

%build
%configure \
	--enable-ipv6		\
	--enable-chardet	\
%if %{with_aac}
	--enable-aac		\
%else
	--disable-aac		\
%endif
%if %{with_wma}
	--enable-wma		\
%else
	--disable-wma		\
%endif
%if %{with_lame}
	--enable-lame		\
%else
	--disable-lame		\
%endif
	--disable-musepack     \
	--disable-mp3

# update audacious-plugins.pot & ja.gmo
#( cd po ;
#  %__make %{_smp_mflags} VERBOSE=1 update-po )

%__make %{_smp_mflags} VERBOSE=1

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

%find_lang %{name}

%clean
%__rm -rf %{buildroot}

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS COPYING 

# container plugins
%{plugindir}/Container/m3u.so
%{plugindir}/Container/pls.so
%{plugindir}/Container/xspf.so

# effect plugins
%{plugindir}/Effect/audiocompress.so
%{plugindir}/Effect/crystalizer.so
%{plugindir}/Effect/echo.so
%{plugindir}/Effect/ladspa.so
%{plugindir}/Effect/sndstretch.so
%{plugindir}/Effect/stereo.so
%{plugindir}/Effect/voice_removal.so

# general plugins
%{plugindir}/General/alarm.so
%{plugindir}/General/aosd.so
%{plugindir}/General/bluetooth.so
%{plugindir}/General/evdev-plug.so
%{plugindir}/General/gnomeshortcuts.so
%{plugindir}/General/gtkui.so
%{plugindir}/General/hotkey.so
%{plugindir}/General/lirc.so
%{plugindir}/General/mtp_up.so
%{plugindir}/General/skins.so
%{plugindir}/General/song_change.so
%{plugindir}/General/statusicon.so
%{plugindir}/General/streambrowser.so
%{plugindir}/General/vfstrace.so

# input plugins
%{plugindir}/Input/alac.so
%{plugindir}/Input/console.so
%{plugindir}/Input/cuesheet_ng.so
%{plugindir}/Input/demac.so
#{plugindir}/Input/madplug.so
%{plugindir}/Input/metronom.so
%{plugindir}/Input/modplug.so
%{plugindir}/Input/psf2.so
%{plugindir}/Input/sndfile.so
%{plugindir}/Input/timidity.so
%{plugindir}/Input/tonegen.so
%{plugindir}/Input/vorbis.so
%{plugindir}/Input/vtx.so
%{plugindir}/Input/xsf.so

# output plugins
%{plugindir}/Output/ALSA.so
%{plugindir}/Output/OSS.so
%{plugindir}/Output/crossfade.so
%{plugindir}/Output/filewriter.so
%{plugindir}/Output/null.so
%{plugindir}/Output/pulse_audio.so

# transport plugins
%{plugindir}/Transport/gio.so
%{plugindir}/Transport/lastfm.so
%{plugindir}/Transport/neon.so

# visualization plugins
%{plugindir}/Visualization/blur_scope.so
%{plugindir}/Visualization/spectrum.so

%dir %{_datadir}/audacious
%{_datadir}/audacious/images/bookmarks.png
%{_datadir}/audacious/images/shoutcast.png
%{_datadir}/audacious/images/streambrowser-*.png
%{_datadir}/audacious/images/xiph.png

%files -n audacious-jack
%defattr(-,root,root,-)
%{plugindir}/Output/jackout.so

%files -n audacious-flac
%defattr(-,root,root,-)
%{plugindir}/Input/flacng.so

%files -n audacious-tta
%defattr(-,root,root,-)
%{plugindir}/Input/tta.so

%if %{with_aac}
%files -n audacious-aac
%defattr(-,root,root,-)
%{plugindir}/Input/aac.so
%endif

%if %{with_wma}
%files -n audacious-wma
%defattr(-,root,root,-)
%{plugindir}/Input/wma.so
%endif

%if %{with_lame}
%files -n audacious-lame
%defattr(-,root,root,-)
%{plugindir}/Output/lame.so
%endif

%files -n audacious-esd
%defattr(-,root,root,-)
%{plugindir}/Output/ESD.so

%files -n audacious-scrobbler
%defattr(-,root,root,-)
%{plugindir}/General/scrobbler.so
%{_datadir}/audacious/images/audioscrobbler*.png

%files -n audacious-visualization
%defattr(-,root,root,-)
%{plugindir}/Visualization/paranormal.so
%{plugindir}/Visualization/rocklight.so
%{plugindir}/Visualization/projectm.so
%{_datadir}/audacious/paranormal

%changelog
* Sun Aug  9 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 2.1-1
- new upstream release
- added --disable-mp3 options

* Tue Apr 28 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 1.5.1-4
- add BuildRequires: libmtp-devel >= 0.3.5
- add Patch10 to fix mtp.c for API changes on libmtp >= 0.3.0

* Sun Apr 26 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.5.1-3
- rebuilt with libmowgli-0.7.0

* Sat Mar 14 2009 NAKAMURA Kenta <kenta@vinelinux.org> 1.5.1-2
- add BuildRequires: libsamplerate-devel and mesa-libGLU-devel
- add BuildRequires: neon-devel, lirc and pulseaudio-libs-devel

* Sat Dec  6 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.5.1-1vl5
- new upstream release

* Sun Sep 14 2008 Shu KONNO <owa@bg.wakwak.com> 1.3.5-1vl5
- applied new versioning policy, spec in utf-8

* Sat Sep 22 2007 KAZUKI SHIMURA <ksh753@y5.dion.ne.jp> 1.3.5-0vl2
- add Obsoletes: beepmp, beepmp-alsa
- add Obsoletes: beepmp-flac to audacious-flac package
- add Obsoletes: audioscrobbler-beepmp to audacious-scrobbler package

* Sat Aug 18 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.3.5-0vl1
- new upstream release
- rebuilt with flac-1.2.0

* Fri May 18 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 1.3.4-0vl1
- new upstream release
- build with new environment/toolchain

* Mon Mar 12 2007 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.3.1-0vl1
- new upstream release

* Fri Mar 09 2007 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.3.0-0vl1
- new upstream release
- update ja.po (source1)
- update %%_audacious_ver
- overwrite POTFILES.in (source3)
  - 1.3.0 contains old version of POTFILES.in
- drop obsolete id3tag.h.patch (patch0)
- drop BuildRequires: libglade2-devel, taglib-devel
- add %%with_lame macro
  - enable lame plugin if rpmbuild with '--with lame'

* Thu Feb 22 2007 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.3.0-0vl0.0alpha5.1
- add BuildRequires: libmad-devel
- add id3tag.h.patch (patch0)

* Wed Feb 21 2007 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.3.0-0vl0.0alpha5
- update to 1.3.0alpha5
- update ja.po (source1)
- update %%_audacious_ver
- drop obsolete avoid-null-dereference.patch (patch0)
- drop BuildRequires: libid3tag-devel
  - NOTE: taglib is not used, but required in configure.ac
- add plugin to core package
  - libmadplug.so instead of libmpg123.so (Input)
- move plugin to visualization package
  - librocklight.so (Visualization)
- add Requires: audacious instead of %%{name} to sub packages

* Fri Feb 09 2007 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.3.0-0vl0.0alpha4.1
- add avoid-null-dereference.patch (patch0) to avoid crash

  r1316 | nenolod | 2007-02-08 03:35:13 +0900 (Thu, 08 Feb 2007) | 2 lines
  - avoid NULL dereference. closes mandriva #28603.

* Thu Feb 08 2007 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.3.0-0vl0.0alpha4
- update to 1.3.0alpha4
- update ja.po (source1)
- update %%_audacious_ver
- update URLs
- add BuildRequires: libprojectM-devel
- add plugin to visualization package
  - libprojectm.so (Visualization)

* Wed Jan 31 2007 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.3.0-0vl0.0alpha3
- update to 1.3.0alpha3
- update ja.po (source1)
- add BuildRequires: libid3tag-devel
- add plugins to core package
  - libcurl.so, libevdev-plug.so, libstatusicon.so (General)
- add new package: audacious-tta
  - libtta.so (Input)

* Sun Jan 21 2007 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.3.0-0vl0.0alpha2.1
- update ja.po (source1)

* Sat Jan 13 2007 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.3.0-0vl0.0alpha2
- update to 1.3.0alpha2
- update %%_audacious_ver
- drop '--disable-gnome-vfs' option from %%configure (no longer supported)
- add audacious-1.2.2's ja.po (source1)
  to use some translations prior to plugin separation
- add plugins to core package:
  - libstdio.so (Container)
  - libmetronom.so, libmodplug.so (Input)
  - librocklight.so (Visualization)
- rename paranormal package to visualization
  - add Obsoletes: audacious-paranormal
  - add plugin: librovascope.so
- fix typo

* Thu Nov 30 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.2.5-0vl2
- separate paranormal package
- add BuildRequires: SDL-devel

* Thu Nov 30 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.2.5-0vl1
- initial build based on audacious

* Sun Aug 27 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.1.2-0vl1
- new upstream release

* Tue Aug 01 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.1.1-0vl2
- oops, really update ja.po (source2)

* Mon Jul 31 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.1.1-0vl1
- new upstream release
- make with 'VERBOSE=1'
- drop obsolete POTFILES.in (source3)
- make update-po before make
  - 1.1.1 contains old version of audacious.pot...
- update ja.po (source2)

* Sat Jul 22 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.1.0-0vl2
- overwrite POTFILES.in (source3)
  - 1.1.0 contains old version of POTFILES.in
- update ja.po (source2)

* Sat Jul 22 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.1.0-0vl1
- new upstream release
- drop unneeded patch0 (was merged)
- add '--enable-ipv6 --enable-chardet' to %%configure option
- add BuildRequires: taglib-devel instead of id3lib-devel
- update ja.po (source2)

* Sun Jun 04 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.0.0-0vl2
- add flac-filename-utf8.patch (patch0)
      to convert filename on fileinfo box for FLAC files to UTF-8
- add use-xfont.patch (patch1)
      to disable 'Use Bitmap fonts if available' by default
- add ja.po (source2)

* Sat Jun 03 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.0.0-0vl1
- initial build
