Name:		openal
Summary:	Open Audio Library
Summary(ja):	オープンオーディオライブラリ
Version:	0.0.8
Release:	1%{?_dist_release}
Epoch:		1
Source:		openal-%{version}.tar.gz

License:	LGPL
URL:		http://www.openal.org
Group:		System Environment/Libraries

BuildRoot:	%{_tmppath}/%{name}-%{version}-root
BuildRequires: alsa-lib-devel, esound-devel, arts-devel, SDL-devel, libvorbis-devel
BuildRequires: automake, autoconf
Obsoletes: libopenal0, libopenal0-devel

%description
OpenAL is a free 3D-audio library, with a programming interface similar
to that of OpenGL.

%package devel
Summary: Headers for developing programs that will use OpenAL
Group: Development/Libraries
Requires: %{name} = %{epoch}:%{version}

%description devel
This package contains the headers that programmers will need to develop
applications which will use OpenAL, a free 3D audio library.

%prep
%setup -q

%build
%configure
%__make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
mkdir -p $RPM_BUILD_ROOT%{_infodir}

install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}
cat > $RPM_BUILD_ROOT%{_sysconfdir}/openalrc <<EOF
(define devices '(alsa native))

;; uncomment this to output via the 2nd soundcard
;;(define alsa-device "plughw:2,0")
EOF

sed -i 's/^Requires:.*//g' $RPM_BUILD_ROOT%{_libdir}/pkgconfig/openal.pc

# remove uninstalled files
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,0755)
%{_sysconfdir}/openalrc
%{_libdir}/*.so.*

%files devel
%defattr(-,root,root,0755)
%{_bindir}/openal-config
%{_includedir}/AL/*.h
%{_libdir}/*.so
%{_libdir}/*.a
%{_libdir}/pkgconfig/openal.pc

%changelog
* Mon Sep 29 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1:0.0.8-1vl5
- applied new versioning policy
- spec in UTF-8

* Sat Jul 07 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 1:0.0.8-0vl1
- new upstream release
- add epoch to use upstream version numbering

* Sat Oct 22 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 1.1.20051022-0vl1
- initial build for Vine Linux
