# Note that this is NOT a relocatable package
%define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}

Summary: Allows several audio streams to play on a single audio device.
Summary(ja): オーディオストリームを単一デバイスから再生するサーバ
Name:      esound
Version:   0.2.38
Release:   3%{?_dist_release}
License:   GPL
Group: System Environment/Daemons
Source0:   ftp://ftp.gnome.org/pub/GNOME/sources/esound/0.2/esound-%{version}.tar.bz2
Patch0:    esound-0.2.19-noerrors.patch
URL:       http://www.tux.org/~ricdude/EsounD.html
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: alsa-lib-devel
BuildRequires: audiofile-devel
Requires: %{name}-libs = %{version}

%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.

%description -l ja
EsounD (the Enlightened Sound Daemon) は複数のオーディオストリームを
単一のオーディオデバイスから出力するためのサーバです。
例えば、CD から音楽を聞いている時に ICQ からサウンドイベントを
受け取った際、EsounD を介することによりこの2つのアプリケーションが
サウンドカードの取り合いをせずに済むようになります。


%package libs
Summary: Library to talk to the EsounD daemon
Summary(ja): EsounD 共有ライブラリ
Group: Development/Libraries
Obsoletes: %{name} < 0.2.38-2

%description libs
The esound-libs package includes the libraries required
for applications to talk to the EsounD daemon.


%package devel
Summary: Development files for EsounD applications.
Summary(ja): EsounD アプリケーション開発用ファイル
Group: Development/Libraries
Requires: %{name}-libs = %{version}
Requires: audiofile-devel
Requires: alsa-lib-devel


%description devel
The esound-devel Libraries, include files and other resources you can
use to develop EsounD applications.

Install esound-devel if you want to develop EsounD applications.

%description devel -l ja
このパッケージには EsounD アプリケーションを開発するのに必要な
ライブラリ、include ファイル、その他のリソースが含まれます。

EsounD アプリケーションを開発する場合には esound-devel パッケージを
インストールしてください。


%package -n compat32-%{name}-libs
Summary: Library to talk to the EsounD daemon
Summary(ja): EsounD 共有ライブラリ
Group: System Environment/Daemons
Requires: %{name}-libs = %{version}

%description -n compat32-%{name}-libs
The esound-libs package includes the libraries required
for applications to talk to the EsounD daemon.


%package -n compat32-%{name}-devel
Summary: Development files for EsounD applications.
Summary(ja): EsounD アプリケーション開発用ファイル
Group: Development/Libraries
Requires: %{name}-devel    = %{version}
Requires: compat32-%{name}-libs = %{version}


%description -n compat32-%{name}-devel
The esound-devel Libraries, include files and other resources you can
use to develop EsounD applications.

Install esound-devel if you want to develop EsounD applications.

%description -n compat32-%{name}-devel -l ja
このパッケージには EsounD アプリケーションを開発するのに必要な
ライブラリ、include ファイル、その他のリソースが含まれます。

EsounD アプリケーションを開発する場合には esound-devel パッケージを
インストールしてください。


%prep
%setup -q
%patch0 -p1 -b .noerrors

%build
%configure --disable-static
make


%install
rm -rf ${RPM_BUILD_ROOT}
%makeinstall

#strip ${RPM_BUILD_ROOT}%{_bindir}/* ||:
#strip ${RPM_BUILD_ROOT}%{_libdir}/*.so.* ||:

#cp -pr $RPM_BUILD_ROOT%{_docdir}/esound docs-to-install
rm -rf $RPM_BUILD_ROOT%{_docdir}/esound
rm -f $RPM_BUILD_ROOT%{_libdir}/lib*.la

%clean
rm -rf ${RPM_BUILD_ROOT}

%post libs -p /sbin/ldconfig

%postun libs -p /sbin/ldconfig

%post -n compat32-%{name}-libs -p /sbin/ldconfig

%postun -n compat32-%{name}-libs -p /sbin/ldconfig


%files
%defattr(-, root, root)
%{_bindir}/esd
%{_bindir}/esdcat
%{_bindir}/esdctl
%{_bindir}/esddsp
%{_bindir}/esdfilt
%{_bindir}/esdloop
%{_bindir}/esdmon
%{_bindir}/esdplay
%{_bindir}/esdrec
%{_bindir}/esdsample
%{_mandir}/man1/esd.1*
%{_mandir}/man1/esdcat.1*
%{_mandir}/man1/esdctl.1*
%{_mandir}/man1/esddsp.1*
%{_mandir}/man1/esdfilt.1*
%{_mandir}/man1/esdloop.1*
%{_mandir}/man1/esdmon.1*
%{_mandir}/man1/esdplay.1*
%{_mandir}/man1/esdrec.1*
%{_mandir}/man1/esdsample.1*

%files libs
%defattr(-, root, root)
%doc AUTHORS COPYING.LIB ChangeLog docs/esound.sgml docs/html 
%doc INSTALL NEWS README TIPS TODO
%config(noreplace) %{_sysconfdir}/*
%{_libdir}/lib*.so.*

%files devel
%defattr(-, root, root)
%{_bindir}/esd-config
%{_includedir}/*
%{_datadir}/aclocal/*
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*.pc
%{_mandir}/man1/esd-config.1*


%if %{build_compat32}
%files -n compat32-%{name}-libs
%defattr(-, root, root)
%{_libdir}/lib*.so.*


%files -n compat32-%{name}-devel
%defattr(-, root, root)
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*.pc
%endif


%changelog
* Mon Jul 13 2009 NAKAMURA Kenta <kenta@vinelinux.org> 0.2.38-3
- corrected Requires: tag on compat32-esound-devel
- removed static libraries

* Wed Jul 09 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 0.2.38-2
- split shared library to -libs subpackage.

* Mon May 12 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.2.38-1
- applied new versioning policy
- removed *.la file from devel package

* Sat May  5 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.2.38-0vl1
- new upstream release

* Thu Mar 15 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.2.37-0vl1
- new upstream release

* Sat Dec 23 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 0.2.36-0vl4
- add Requires: alsa-lib-devel to -devel package

* Mon May 13 2006 NAKAMURA Kenta <kenta@c.csce.kyushu-u.ac.jp> 0.2.36-0vl3
- added compat32-* packages for x86_64 architecture support

* Fri Feb 17 2006 Shu KONNO <owa@bg.wakwak.com> 0.2.36-0vl2
- added BuildRequires: audiofile-devel
- rebuilt for x86_64 architecture

* Sun Jun 19 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 0.2.36-0vl1
- new upstream release
- build with alsa

* Sat Oct 23 2004 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.2.35-0vl1
- new upstream release
- sync manpages to each package 
- added Patch0 from Fedora development 0.2.34-3

* Sun Sep 21 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 0.2.31-0vl2
- use License tag
- add .la files to devel package

* Wed Sep 03 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 0.2.31-0vl1
- new upstream release
- add manpages to filelist

* Tue Jan 07 2003 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 0.2.29-0vl4
- added missing pkgconfig file

* Sun Jan  5 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 0.2.29-0vl1
- new upstream release

* Wed Feb 20 2002 Daisuke SUZUKI <daisuke@linux.or.jp> 0.2.22-0vl3
- rebuild to remove rpmlib dependancy

* Fri May 25 2001 MATSUBAYASHI 'Shaolin' Kohji <shaolin@vinelinux.org>
- remove audio_oss patch

* Thu Dec 14 2000 Yoichi Imai <yoichi@silver-forest.com>
- 0.2.22-0vl1
- comment out strip commands
- changed /var/tmp to %{_tmppath}
 
* Thu Oct 26 2000 Jun Nishii <jun@vinelinux.org>
- 0.2.20-0vl1

* Wed Sep 06 2000 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
- 0.2.19-0vl2
- included a patch for audio_oss.c (backed to 0.2.17 style)

* Wed Sep 06 2000 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
- 0.2.19-0vl1
- udpated to 0.2.19 release
- added Japanese Summary and Description

* Sat Jun  3 2000 BIll Nottingham <notting@redhat.com> 0.2.18-2
- rebuild. Apparently the compiler ate this last time.

* Tue Apr 4 2000 Elliot Lee <sopwith@redhat.com> 0.2.18-1
- Update to 0.2.18

* Mon Aug 30 1999 Elliot Lee <sopwith@redhat.com> 0.2.13-1
- Update to 0.2.13
- Merge in changes from RHL 6.0 spec file.

* Sat Nov 21 1998 Pablo Saratxaga <srtxg@chanae.alphanet.ch>

- added %{_prefix}/share/aclocal/* to %files devel
- added spanish and french translations for rpm

* Thu Oct 1 1998 Ricdude <ericmit@ix.netcom.com>

- make autoconf do the version updating for us.

* Wed May 13 1998 Michael Fulbright <msf@redhat.com>

- First try at an RPM
