File libao.spec of Package libao

#
# spec file for package libao
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define _SO_nr 4
# Check configure.ac for the plugin versioning
%define PLUGIN_VERSION 4

Name:           libao
Version:        1.1.0
Release:        8
License:        GPL-2.0+
%define my_provides /tmp/my-provides
Summary:        A Cross-Platform Audio Output Library
Url:            http://www.xiph.org/ao/
Group:          System/Libraries
Source:         %{name}-%{version}.tar.gz
# PATCH-FIX-OPENSUSE lib64.dif -- General problem, but no general fix... openSUSE specific.
Patch0:         lib64.dif
Patch1:         libao-ocloexec.patch
BuildRequires:  libesd-devel
BuildRequires:  libpulse-devel
BuildRequires:  automake
BuildRequires:  libtool
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Libao is a cross-platform audio output library.  It currently supports
ESD, OSS, Solaris, and IRIX.

%package -n libao%{_SO_nr}

License:        GPL-2.0+
Group:          System/Libraries
Summary:        A Cross-Platform Audio Output Library
Requires:       libao-plugins%{PLUGIN_VERSION}
# libao was last used in openSUSE 11.3
Provides:       libao = 1.1.0
Obsoletes:      libao < 1.1.0

%description -n libao%{_SO_nr}
Libao is a cross-platform audio output library.  It currently supports
ESD, OSS, Solaris, and IRIX.

%package plugins%{PLUGIN_VERSION}

License:        GPL-2.0+
Summary:        Main output plugins for libao
Group:          System/Libraries

%description plugins%{PLUGIN_VERSION}
This package contains the main output plugins for libao.

%package devel
License:        GPL-2.0+
Summary:        Include Files and Libraries mandatory for Development
Group:          Development/Libraries/C and C++
Requires:       glibc-devel
Requires:       libao%{_SO_nr} = %{version}

%description devel
This package contains all necessary include files and libraries needed
to develop applications that require these.


%package plugin%{PLUGIN_VERSION}-esd

Summary:        ESD output plugin for libao
Group:          System/Libraries
Supplements:    packageand(esound-daemon:libao%{_SO_nr})

%description plugin%{PLUGIN_VERSION}-esd
This package contains the ESD output plugin for libao.

%prep
%setup -q
if [ "%{_lib}" == "lib64" ]; then
%patch0
fi
%patch1
### If there is anything wrong it should be reported upstream
# remove obsolete macros
#rm -f acinclude.m4

%build
autoreconf -fiv
%configure --enable-alsa-mmap --disable-static
make %{?_smp_mflags}

%install
%makeinstall docdir=%{_docdir}/%{name}-devel
# cleanup buildroot, remove unpackaged files
rm -f %{buildroot}%{_libdir}/*.la
rm -f %{buildroot}%{_libdir}/*/*/*.la
# exclude plugins from the provide-list
cat << EOF > %{my_provides}
grep -v %{_libdir}/ao/ | %{__find_provides}
EOF
chmod 755 %{my_provides}
%define _use_internal_dependency_generator 0
%define __find_provides %{my_provides}

%post -n libao%{_SO_nr} -p /sbin/ldconfig

%postun -n libao%{_SO_nr} -p /sbin/ldconfig

%clean
[ %{buildroot} != "/" ] && rm -rf %{buildroot}
rm -f %{my_provides}

%files -n libao%{_SO_nr}
%defattr(0644,root,root,0755)
%doc AUTHORS CHANGES COPYING README TODO
%{_libdir}/libao.so.%{_SO_nr}*
%dir %{_libdir}/ao
%dir %{_libdir}/ao/plugins-%{PLUGIN_VERSION}

%files plugins%{PLUGIN_VERSION}
%defattr(0644,root,root,0755)
%{_libdir}/ao/plugins-%{PLUGIN_VERSION}/libalsa.so
%{_libdir}/ao/plugins-%{PLUGIN_VERSION}/liboss.so
%{_libdir}/ao/plugins-%{PLUGIN_VERSION}/libpulse.so

%files devel
%defattr(-,root,root)
%{_docdir}/%{name}-devel
%{_mandir}/*/*
%{_includedir}/ao
%{_libdir}/libao.so
%{_datadir}/aclocal/*.m4
%{_libdir}/pkgconfig/*.pc

%files plugin%{PLUGIN_VERSION}-esd
%defattr(0644,root,root,0755)
%{_libdir}/ao/plugins-%{PLUGIN_VERSION}/libesd.so

%changelog
openSUSE Build Service is sponsored by