# Now, these features provide self-build-audacious-plugins-extra package
# 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 plugindir %{_libdir}/audacious
# Minimum audacious/audacious-plugins version in inter-package dependencies.
%global aud_ver 3.6

Summary: 	Plugins for the Audacious audio player
Summary(ja):	Audacious オーディオプレイヤー プラグイン集
Name:		audacious-plugins
Version:	3.6.1
Release:	1%{?_dist_release}

# list of license per plugin in README.licences
License: 	GPLv2+ and LGPLv2+ and GPLv3 and MIT and BSD
Group:		Applications/Multimedia
URL:		http://audacious-media-player.org/

Source0:	http://distfiles.audacious-media-player.org/audacious-plugins-%{version}-gtk3.tar.bz2
Source3:	README.licenses
# for optional packages
Source100: 	audacious-plugins-amidi.metainfo.xml
Source101: 	audacious-plugins-exotic.metainfo.xml
Source102: 	audacious-plugins-jack.metainfo.xml

BuildRoot:	%{_tmppath}/%{name}-%{version}-root
BuildRequires:	audacious-devel >= %{aud_ver}
BuildRequires:	gettext-devel
BuildRequires:  jack-audio-connection-kit-devel
BuildRequires:	libsamplerate-devel
BuildRequires:	alsa-lib-devel
BuildRequires:	pulseaudio-libs-devel
BuildRequires:	libsndfile-devel
BuildRequires:	wavpack-devel
BuildRequires:	libmodplug-devel
BuildRequires:	libogg-devel
BuildRequires:	libvorbis-devel
BuildRequires:	flac-devel
BuildRequires: 	fluidsynth-devel
BuildRequires:  libcdio-devel
BuildRequires:	libcdio-paranoia-devel
BuildRequires:	SDL-devel
BuildRequires:	lirc
BuildRequires:  libcddb-devel
BuildRequires:  libmtp-devel
BuildRequires:	libxml2-devel
BuildRequires:	libnotify-devel
BuildRequires:	curl-devel
BuildRequires:	neon-devel

#BuildRequires:	gtkglext-devel
BuildRequires:	mesa-libGL-devel
BuildRequires:	dbus-devel
BuildRequires:	dbus-glib-devel

Requires:	audacious >= %{aud_ver}
Requires(post):	  /sbin/update-alternatives
Requires(postun): /sbin/update-alternatives

Obsoletes:	audacious < 1.2.0
Obsoletes:	beepmp, beepmp-alsa
Obsoletes:	audacious-esd < 3.0
Obsoletes:	audacious-visualization < 3.0

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
License: LGPLv2+
Group: Applications/Multimedia
Requires: audacious-plugins >= %{aud_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-plugins >= %{aud_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-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-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}-gtk3

sed -i '\,^.SILENT:,d' buildsys.mk.in

%build
%configure \
    --enable-gio  \
    --enable-vorbis  \
    --enable-flacng  \
    --enable-neon  \
    --disable-aac  \
    --disable-ffaudio  \
    --disable-mp3  \
    --disable-mms  \
    --disable-filewriter_mp3 \
    --with-ffmpeg=none  \
    \
    --enable-gtk \
    --disable-qt \
    --disable-rpath 
	
make %{?_smp_mflags}

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

# rename for alternatives
pushd $RPM_BUILD_ROOT%{plugindir}/Output/
mkdir filewriter
mv filewriter.so filewriter/plus.so
popd

%find_lang %{name}

%clean
%__rm -rf %{buildroot}

%post
/sbin/update-alternatives --install \
    %{plugindir}/Output/filewriter.so \
    filewriter.so \
    %{plugindir}/Output/filewriter/plus.so 10

%postun 
if [ $1 = 0 ]; then
  /sbin/update-alternatives --remove filewriter.so %{plugindir}/Output/filewriter/plus.so
  /sbin/update-alternatives --auto filewriter.so
fi

%posttrans
# fix broken symlink if it's there
if [ ! -f %{plugindir}/Output/filewriter.so ] ; then
  /sbin/update-alternatives --auto filewriter.so
fi


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc COPYING 
%dir %{_libdir}/audacious

# container plugins
%dir %{plugindir}/Container/
%{plugindir}/Container/asx.so
%{plugindir}/Container/asx3.so
%{plugindir}/Container/audpl.so
%{plugindir}/Container/m3u.so
%{plugindir}/Container/pls.so
%{plugindir}/Container/xspf.so

# effect plugins
%dir %{plugindir}/Effect/
%{plugindir}/Effect/compressor.so
%{plugindir}/Effect/crossfade.so
%{plugindir}/Effect/crystalizer.so
%{plugindir}/Effect/echo.so
%{plugindir}/Effect/ladspa.so
%{plugindir}/Effect/mixer.so
%{plugindir}/Effect/resample.so
%{plugindir}/Effect/silence-removal.so
%{plugindir}/Effect/speed-pitch.so
%{plugindir}/Effect/stereo.so
%{plugindir}/Effect/voice_removal.so

# general plugins
%dir %{plugindir}/General/
%{plugindir}/General/alarm.so
%{plugindir}/General/albumart.so
%{plugindir}/General/aosd.so
%{plugindir}/General/cd-menu-items.so
%{plugindir}/General/delete-files.so
%{plugindir}/General/gnomeshortcuts.so
%{plugindir}/General/gtkui.so
%{plugindir}/General/hotkey.so
%{plugindir}/General/lirc.so
%{plugindir}/General/lyricwiki.so
%{plugindir}/General/mpris2.so
%{plugindir}/General/notify.so
%{plugindir}/General/playlist-manager.so
%{plugindir}/General/scrobbler.so
%{plugindir}/General/search-tool.so
%{plugindir}/General/skins.so
%{plugindir}/General/song_change.so

# input plugins
%dir %{plugindir}/Input/
%{plugindir}/Input/amidi-plug.so
%{plugindir}/Input/cdaudio-ng.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
%exclude %{plugindir}/Input/psf2.so
%{plugindir}/Input/sndfile.so
%{plugindir}/Input/tonegen.so
%{plugindir}/Input/vorbis.so
%{plugindir}/Input/vtx.so
%{plugindir}/Input/wavpack.so
%exclude %{plugindir}/Input/xsf.so

# output plugins
%dir %{plugindir}/Output/
%{plugindir}/Output/alsa.so
#{plugindir}/Output/filewriter.so
%{plugindir}/Output/filewriter/plus.so
#{plugindir}/Output/icecast.so
%{plugindir}/Output/oss4.so
%{plugindir}/Output/pulse_audio.so
%{plugindir}/Output/sdlout.so

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

# visualization plugins
%dir %{plugindir}/Visualization/
%{plugindir}/Visualization/blur_scope.so
%{plugindir}/Visualization/cairo-spectrum.so
%{plugindir}/Visualization/gl-spectrum.so

# skins
%dir %{_datadir}/audacious/Skins/
%{_datadir}/audacious/Skins/*


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

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

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

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

%changelog
* Fri Apr  3 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 3.6.1-1
- new upstream release
- dropt esd and visualization subpackage

* Sat Jun  5 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 2.3-2
- rebuilt with libprojectm-2.0.1
- added BR: libshout-devel
- renamed filewriter.so for alternatives (audacious-lame)

* Sat May 29 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 2.3-1
- new upstream release
- remove BR: arts-devel
- added BR: libcdio-devel, libcddb-devel

* 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
