%define name		esound
%define version		0.2.34
%define release		1 
%define group		System Environment/Daemons
%define prefix          %{_prefix}
# ==============================================================================

Name:		%{name}
Version:	%{version}
Release:	%{release}
Summary:	Allows several audio streams to play on a single audio device.
Group:		%{group}
Copyright:	GPL
URL:		http://www.tux.org/~ricdude/EsounD.html
Source:		ftp://ftp.gnome.org/pub/GNOME/stable/sources/esound/%{name}-%{version}.tar.bz2
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires:    audiofile-devel >= 0.2.3

%description
EsounD, the Enlightened Sound Daemon, is a server process that mixes
several audio streams for playback by a single audio device. For
example, if you're listening to music on a CD and you receive a
sound-related event from ICQ, the two applications won't have to
jockey for the use of your sound card.

Install esound if you'd like to let sound applications share your
audio device. You'll also need to install the audiofile package.

%package devel
Summary:          Development files for EsounD applications.
Group:            Development/Libraries
Requires:         esound = %{version}
Requires:         audiofile-devel >= 0.2.3
BuildRequires:    audiofile-devel >= 0.2.3


%description devel
The esound-devel package includes the libraries, include files and
other resources needed to develop EsounD applications.

%define DEFCC cc

%prep
%setup -q

%build
# Use the default compiler for this platform - gcc otherwise
if [[ -z "$CC" ]]
then
    if test "X`type %{DEFCC} 2>/dev/null`" != 'X'; then
       export CC=%{DEFCC}
    else 
       export CC=gcc
    fi
fi
if [[ "$CC" != "gcc" ]]
then
       export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's:-fsigned-char::'`
fi
#export CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="-Wl,-brtl";
export CFLAGS="$RPM_OPT_FLAGS"

libtoolize --force --copy
aclocal
autoconf
automake -a
# Force use of our libtool...
cp /usr/bin/libtool ./libtool
CXXFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix}
make


%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{prefix}

make prefix=$RPM_BUILD_ROOT%{prefix} install 

(
  cd $RPM_BUILD_ROOT

  /usr/bin/strip .%{prefix}/bin/* || :

  for dir in bin lib
  do
    mkdir -p usr/$dir
    cd usr/$dir
    ln -sf ../..%{_prefix}/$dir/* .
    cd -
  done
)


%files
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog docs/esound.sgml docs/html docs/esound.ps
%doc INSTALL NEWS README TIPS TODO
%attr(755,root,root) %{prefix}/bin/*
%{prefix}/lib/*.a
%config(noreplace) %{prefix}/etc/*
/usr/bin/*
/usr/lib/*.a

%files devel
%defattr(-, root, root)
%{_libdir}/*.la
%{_includedir}/*
%{prefix}/share/aclocal/*
%{_libdir}/pkgconfig/*

%clean
rm -rf $RPM_BUILD_ROOT


%changelog
* Thu Apr 23 2004 David Clissold <cliss@austin.ibm.com> 0.2.34-1
- Update to version 0.2.34

* Thu Oct 23 2003 David Clissold <cliss@austin.ibm.com> 0.2.32-1
- Update to version 0.2.32

* Tue Jul 01 2003 Dan McNichol
- Update to version 0.2.29

* Thu Aug 01 2002 David Clissold <cliss@austin.ibm.com>
- 0.2.24 -- hack the esound acinclude.m4 to make it stop
- using ltconfig, which is out of sync with libtool 1.4.2

* Tue Jul 23 2002 Chris Tysor <cjtysor@us.ibm.com>
- Upgrade to 0.2.24

* Thu Oct 11 2001 Kevin Monroe <monroek@us.ibm.com>
- Upgrade to 0.2.23

* Fri Sep 14 2001 Kevin Monroe <monroek@us.ibm.com>
- Initial Release (0.2.8)
