%define _aud_ver	3.6

Summary:	Advanced audio player
Summary(ja):	高度なオーディオプレイヤー
Name:		audacious
Version:	3.6.1
Release:	1%{?_dist_release}

License:	BSD
Group:		Applications/Multimedia
URL:		http://audacious-media-player.org/

Source0: 	http://distfiles.audacious-media-player.org/%{name}-%{version}-gtk3.tar.bz2
# validated: 2013-11-03 / screenshot commented out for now
Source1: 	audacious.appdata.xml

BuildRoot:	%{_tmppath}/%{name}-%{version}-root
BuildRequires:  desktop-file-utils
BuildRequires:	gettext
BuildRequires:  gtk3-devel 
BuildRequires:  libguess-devel

Requires:	%{name}-libs = %{version}-%{release}
Requires:	audacious-plugins >= %{_aud_ver}
Requires: 	hicolor-icon-theme

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

# Skin packages can require this from xmms and all GUI compatible players
Provides:	xmms-gui

Vendor:		Project Vine
Distribution:	Vine Linux

%description
Audacious is an advanced audio player. It is free, lightweight, currently
based on GTK+ 3, runs on Linux and many other *nix platforms and is
focused on audio quality and supporting a wide range of audio codecs.
It still features an alternative skinned user interface (based on
Winamp 2.x skins). Historically, it started as a fork of Beep Media
Player (BMP), which itself forked from XMMS.

%package libs
Summary: 	Library files for the Audacious audio player
Summary(ja): 	Audacious オーディオプレイヤーのライブラリファイル
Group: 		System Environment/Libraries

%description libs
Library files for the Audacious media player.

%package devel
Summary:	Development files for Audacious
Summary(ja):	Audacious の開発用ファイル
Group:		Development/Libraries
Requires:	%{name}-libs = %{version}-%{release}
Requires:	glib2-devel
Requires:	gtk3-devel

%description devel
Files needed when building software for the Audacious audio player.

%description -l ja devel
Audacious のプラグインを開発するために必要なヘッダファイルが含まれています。

%prep
%setup -q -n %{name}-%{version}-gtk3

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

%build
%configure \
    --disable-qt \
    --enable-gtk \
    --with-buildstamp="Vine package" \
    --disable-silent-rules \
    --disable-rpath 

make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT

make DESTDIR=$RPM_BUILD_ROOT install INSTALL="install -p"
find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';'

desktop-file-install  \
    --dir $RPM_BUILD_ROOT%{_datadir}/applications  \
    $RPM_BUILD_ROOT%{_datadir}/applications/audacious.desktop

install -D -m0644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/appdata/%{name}.appdata.xml

%find_lang %{name}

%clean
rm -rf $RPM_BUILD_ROOT

%post
%{_bindir}/update-desktop-database %{_datadir}/applications >& /dev/null ||:
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
%{_bindir}/update-desktop-database %{_datadir}/applications >& /dev/null ||:

%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :

%post libs -p /sbin/ldconfig

%postun libs -p /sbin/ldconfig

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS
%{_bindir}/audacious
%{_bindir}/audtool
#{_libdir}/audacious
%{_datadir}/audacious
%{_datadir}/appdata/%{name}.appdata.xml
%{_datadir}/applications/*.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}*.*
%{_mandir}/man[^3]/*

%files libs
%defattr(-,root,root,-)
%doc COPYING
%{_libdir}/lib*.so.*

%files devel
%defattr(-,root,root,-)
%{_includedir}/audacious
%{_includedir}/libaudcore
%{_includedir}/libaudgui
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc

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

* Tue Sep 28 2010 Shu KONNO <owa@bg.wakwak.com> 2.3-2
- rebuilt with rpm-4.8.1 for pkg-config

* Sat May 29 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 2.3-1
- new upstream release

* Thu Aug 13 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 2.1-2
- added BuildRequires: libsamplerate-devel to devel package

* Sun Aug  9 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 2.1-1
- new upstream release

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

* Sat Apr  4 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 1.5.1-4
- added BuildRequires: dbus-devel, dbus-glib-devel
- added Requires: dbus-devel, dbus-glib-devel to devel package

* Wed Mar 25 2009 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 1.5.1-3
- rebuilt again with oniguruma-5.9.1 (ppc)

* Thu Mar 19 2009 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.5.1-2vl5
- rebuilt with oniguruma-5.9.1

* Sat Dec  6 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.5.1-1vl5
- new upstream release (dropped Patch1 and Source2)

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

* Tue Sep 04 2007 KAZUKI SHIMURA <ksh753@y5.dion.ne.jp> 1.3.2-0vl3
- update desktop file (source1)

* Tue Aug 21 2007 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 1.3.2-0vl2
- add Requires: mcs-devel for audacious-devel subpackage

* Fri May 18 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 1.3.2-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
- drop '--disable-gconf' option from %%configure

* Fri Mar 09 2007 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.3.0-0vl1
- new upstream release
- update ja.po (source2)
- add BuildRequires: mcs-devel, libsamplerate-devel

* Wed Feb 21 2007 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.3.0-0vl0.0alpha5
- update to 1.3.0alpha5
- update ja.po (source2)
- drop obsolete playlist-set-utf8-name.patch (patch2)
- add new file: libaudid3tag.so

* Mon Feb 12 2007 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.3.0-0vl0.0alpha4.1
- add playlist-set-utf8-name.patch (patch2)
  to use utf-8-converted filename as playlist title

* Thu Feb 08 2007 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.3.0-0vl0.0alpha4
- update to 1.3.0alpha4
- update ja.po (source2)
- update URLs

* Wed Jan 31 2007 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.3.0-0vl0.0alpha3
- update to 1.3.0alpha3
- update ja.po (source2)
- update use-xfont.patch (patch1)
- fix typo

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

* Sat Jan 13 2007 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.3.0-0vl0.0alpha2
- update to 1.3.0alpha2
- use oniguruma regex library
  - add BuildRequires: oniguruma-devel
  - add '--with-regexlib=oniguruma' option to %%configure

* Thu Nov 30 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.2.2-0vl2
- add '--enable-chardet' option to %%configure again

* Wed Nov 29 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.2.2-0vl1
- new upstream release
- update ja.po (source2)

* 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
