File openal-soft.spec of Package openal-soft

#
# spec file for package openal-soft
#
# Copyright (c) 2013 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/
#


Name:           openal-soft
Version:        1.15.1
Release:        0
Summary:        OpenAL Soft
License:        LGPL-2.1+ and GPL-2.0+
Group:          System/Libraries
Url:            http://kcat.strangesoft.net/openal.html
Source0:        http://kcat.strangesoft.net/openal-releases/openal-soft-%{version}.tar.bz2
#Source0:        openal-soft-%{version}.tar.bz2
Source1:        libopenalcompat.c
Source3:        baselibs.conf
# PATCH-FIX-UPSTREAM openal-no-autospawn.diff
Patch0:         openal-no-autospawn.diff
Conflicts:      openal <= 0.0.8
Provides:       openal = 0.0.9
BuildRequires:  cmake >= 2.4.4
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(libpulse)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
OpenAL is an audio library designed in the spirit of OpenGL--machine
independent, cross platform, and data format neutral with a clean,
simple C-based API.

OpenAL provides capabilities for playing audio in a virtual 3D
environment. Distance attenuation, doppler shift, and directional
sound emitters are among the features handled by the API. More
advanced effects, including air absorption, occlusion, and
environmental reverb, are available through the EFX extension. It
also facilitates streaming audio, multi-channel buffers, and audio
capture.

OpenAL Soft is an LGPL-licensed, cross-platform, software
implementation of the OpenAL API.

%package devel
Summary:        OpenAL Soft
Group:          Development/Languages/C and C++
Requires:       glibc-devel
Requires:       libopenal1 = %{version}
Provides:       openal-devel = 0.0.9
Conflicts:      openal-devel <= 0.0.8

%description devel
OpenAL is an audio library designed in the spirit of OpenGL--machine
independent, cross platform, and data format neutral with a clean,
simple C-based API.

OpenAL provides capabilities for playing audio in a virtual 3D
environment. Distance attenuation, doppler shift, and directional
sound emitters are among the features handled by the API. More
advanced effects, including air absorption, occlusion, and
environmental reverb, are available through the EFX extension. It
also facilitates streaming audio, multi-channel buffers, and audio
capture.

OpenAL Soft is an LGPL-licensed, cross-platform, software
implementation of the OpenAL API.

%package -n libopenal0
Summary:        OpenAL Soft
Group:          System/Libraries
Recommends:     openal-soft
# libopenal0-soft was last used in openSUSE 12.2
Provides:       libopenal0-soft = %{version}-%{release}
Obsoletes:      libopenal0-soft <= 1.14

%description -n libopenal0
OpenAL is an audio library designed in the spirit of OpenGL--machine
independent, cross platform, and data format neutral with a clean,
simple C-based API.

OpenAL provides capabilities for playing audio in a virtual 3D
environment. Distance attenuation, doppler shift, and directional
sound emitters are among the features handled by the API. More
advanced effects, including air absorption, occlusion, and
environmental reverb, are available through the EFX extension. It
also facilitates streaming audio, multi-channel buffers, and audio
capture.

OpenAL Soft is an LGPL-licensed, cross-platform, software
implementation of the OpenAL API.

libopenal.so.0 is just a wrapper around libopenal.so.1 for
compatibility with old software.

%package -n libopenal1
Summary:        OpenAL Soft
Group:          System/Libraries
Recommends:     openal-soft
# libopenal1-soft was last used in openSUSE 12.2
Provides:       libopenal1-soft = %{version}-%{release}
Obsoletes:      libopenal1-soft <= 1.14

%description -n libopenal1
OpenAL is an audio library designed in the spirit of OpenGL--machine
independent, cross platform, and data format neutral with a clean,
simple C-based API.

OpenAL provides capabilities for playing audio in a virtual 3D
environment. Distance attenuation, doppler shift, and directional
sound emitters are among the features handled by the API. More
advanced effects, including air absorption, occlusion, and
environmental reverb, are available through the EFX extension. It
also facilitates streaming audio, multi-channel buffers, and audio
capture.

OpenAL Soft is an LGPL-licensed, cross-platform, software
implementation of the OpenAL API.

%prep
%setup -q
%patch0 -p1

%build
cd build
export CFLAGS='%{optflags}'
export CXXFLAGS='%{optflags}'
cmake -DCMAKE_BUILD_WITH_INSTALL_RPATH=1 \
      -DCMAKE_VERBOSE_MAKEFILE=1 \
      -DCMAKE_INSTALL_PREFIX=%{_prefix} \
%if %{_lib} == lib64
      -DLIB_SUFFIX=64 \
%endif
      -DCMAKE_BUILD_TYPE=Release \
      -DALSOFT_CONFIG=ON \
      ..

make %{?_smp_mflags}
gcc -Wall %{optflags} -fPIC -DPIC -Wl,-soname,libopenal.so.0 -shared -Wl,--no-as-needed -L. -lopenal -o libopenal.so.0 %{SOURCE1}
install -D -m 644 /dev/null %{buildroot}/%{_sysconfdir}/openal/alsoft.conf

%install
cd build
make DESTDIR=%{buildroot} install
install -d %{buildroot}%{_sysconfdir}/openal
install -m644 libopenal.so.0 %{buildroot}%{_libdir}

%post -n libopenal0 -p /sbin/ldconfig

%postun -n libopenal0 -p /sbin/ldconfig

%post -n libopenal1 -p /sbin/ldconfig

%postun -n libopenal1 -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc COPYING
%dir %{_sysconfdir}/openal
%ghost %config %attr(0644,root,root) %{_sysconfdir}/openal/alsoft.conf
%{_bindir}/openal-info
%dir %{_datadir}/openal
%{_datadir}/openal/alsoftrc.sample

%files -n libopenal1
%defattr(-,root,root)
%{_libdir}/libopenal.so.1*

%files -n libopenal0
%defattr(-,root,root)
%{_libdir}/libopenal.so.0

%files devel
%defattr(-,root,root)
%{_bindir}/makehrtf
%{_libdir}/libopenal.so
%{_libdir}/pkgconfig/openal.pc
%dir %{_includedir}/AL
%{_includedir}/AL/al.h
%{_includedir}/AL/alc.h
%{_includedir}/AL/alext.h
%{_includedir}/AL/efx.h
%{_includedir}/AL/efx-creative.h
%{_includedir}/AL/efx-presets.h

%changelog