%define xmmsinputdir %{_libdir}/xmms/Input
#%define date	20040923

Summary: Library and frontend for decoding MPEG2/4 AAC
Summary(ja): MPEG2/4 AAC のデコード用ライブラリおよびフロントエンド
Name: faad2
Version: 2.7
Release: 4%{?_dist_release}
License: GPLv2+
Group: Applications/Multimedia
URL: http://www.audiocoding.com/
Source: %{name}-%{version}.tar.gz
#Source: faad2-%{date}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: autoconf, automake, libtool
BuildRequires: gcc-c++, zlib-devel, sysfsutils-devel
BuildRequires: id3lib-devel, gtk+-devel
%{?_with_xmms:BuildRequires: xmms-devel}

%description
FAAD 2 is a LC, MAIN and LTP profile, MPEG2 and MPEG-4 AAC decoder, completely
written from scratch.

%if %{?_with_xmms:1}%{!?_with_xmms:0}
%package -n xmms-aac
Summary: X MultiMedia System input plugin to play AAC files
Group: Applications/Multimedia
Requires: %{name} = %{version}, xmms, id3lib
Provides: xmms-%{name} = %{version}-%{release}

%description -n xmms-aac
This xmms plugin reads AAC files with and without ID3 tags (version 2.x).
AAC files are MPEG2 or MPEG4 files that can be found in MPEG4 audio files
(.mp4). MPEG4 files with AAC inside can be read by RealPlayer or Quicktime.
%endif


%package devel
Summary: Development libraries of the FAAD 2 AAC decoder
Summary(ja): FAAD 2 AAC デコーダの開発用ライブラリ
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
FAAD 2 is a LC, MAIN and LTP profile, MPEG2 and MPEG-4 AAC decoder, completely
written from scratch.

This package contains development files and documentation for libfaad.


%prep
%setup -q

### Required to make automake < 1.7 work
%{__perl} -pi -e 's|dnl AC_PROG_CXX|AC_PROG_CXX|' configure.in

%build
# This is what the README.linux file recommends
autoreconf -vif
%configure \
    --disable-static \
    %{?_with_xmms:--with-xmms} \
    --with-mpeg4ip \
    --without-drm
#    --with--mp4v2 \
%{__make} %{?_smp_mflags}


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

# Remove this wrong include
#perl -pi -e 's|#include <systems.h>||g' %{buildroot}%{_includedir}/mpeg4ip.h

## remove unuse files
rm -rf $RPM_BUILD_ROOT%{_libdir}/*.{la,a}


%clean
%{__rm} -rf %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-, root, root, 0755)
%doc AUTHORS COPYING ChangeLog NEWS README TODO
%{_bindir}/*
%{_libdir}/*.so.*

%if %{?_with_xmms:1}%{!?_with_xmms:0}
%files -n xmms-aac
%defattr(-, root, root, 0755)
%doc plugins/xmms/AUTHORS plugins/xmms/NEWS
%doc plugins/xmms/README plugins/xmms/TODO
#%exclude %{xmmsinputdir}/*.a
%exclude %{xmmsinputdir}/*.la
%{xmmsinputdir}/*.so
%endif

%files devel
%defattr(-, root, root, 0755)
%{_includedir}/*
#%{_libdir}/*.a
#%{_libdir}/*.la
%{_libdir}/*.so
#exclude %{_libdir}/*.la


%changelog
* Sat Mar 20 2010 Munehiro Yamamoto <munepi@vinelinux.org> 2.7-4
- change release to sync with self-build-faad2

* Wed Feb 17 2010 Munehiro Yamamoto <munepi@vinelinux.org> 2.7-3
- change release to sync with self-build-faad2

* Sat Jan 16 2010 Munehiro Yamamoto <munepi@vinelinux.org> 2.7-2
- changed to --without-drm in configure options

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

* Tue May 26 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 2.6.1-3
- change release to sync with self-build-faad2

* Sun Feb 08 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 2.6.1-2
- applied faad2-cve-2008-4201.patch
- added %%configure options: --disable-static
- using %{?_with_xmms}

* Sat Sep 20 2008 Shu KONNO <owa@bg.wakwak.com> 2.6.1-1vl5
- applied new versioning policy, spec in utf-8
- removed *.la

* Sun Dec 30 2007 Satoshi MACHINO <machino@vinelinux.org> 2.6.1-0vl1
- new upstream release
- dropped patch0

* Mon Dec 25 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.5-1vl1
- new upstream release based on DAG packages
  * Fri Dec 15 2006 Matthias Saou <http://freshrpms.net/> 2.5-1 - 5002+/thias
  - Update to 2.5.
  - Completely remove xmms/bmp plugin, it's a real mess anyway. Use audacious.
  - Rip out libmp4v2 too, it's best as a separate package.
  - Add libsysfs-devel build requirement, as it seems configure checks for it.
- added Japanese summary

* Wed Nov 10 2004 Satoshi MACHINO <machino@vinelinux.org> 2.0-0.%{date}vl1
- Built for VineLinux
