#
# Conditional build:
-#
-%bcond_without alsa # without ALSA support
-%bcond_with arts # with aRts support
-%bcond_without esd # without esd support
-%bcond_without mmx # don't use MMX
-#
-%ifnarch %{ix86} %{x8664}
-%undefine with_mmx
-%endif
-%ifarch i386 i486
-%undefine with_mmx
+%bcond_without alsa # ALSA backend
+%bcond_without jack # JACK backend
+%bcond_without pipewire # PipeWire backend
+%bcond_without portaudio # PortAudio backend
+%bcond_without pulseaudio # PulseAudio backend
+%bcond_without rtkit # RTKit support
+%bcond_with sdl # SDL2 backend
+%bcond_with sse2 # force use of SSE2 instructions (x86)
+%bcond_without gui # alsoft-config GUI
+%bcond_with qt4 # Qt 4 instead of Qt 5 for GUI
+
+%ifarch pentium4 x32 %{x8664}
+%define with_sse2 1
%endif
Summary: Open Audio Library
-Summary(pl): Otwarta Biblioteka D¼wiêku
+Summary(pl.UTF-8): Otwarta Biblioteka Dźwięku
Name: OpenAL
-Version: 0.0.8
-Release: 1
-License: LGPL
+Version: 1.22.0
+Release: 2
+License: LGPL v2+
Group: Libraries
-Source0: http://www.openal.org/openal_webstf/downloads/openal-%{version}.tar.gz
-# Source0-md5: 641cf53761f35ee979f3e888614797a0
+Source0: https://openal-soft.org/openal-releases/openal-soft-%{version}.tar.bz2
+# Source0-md5: 40e5b29a241e1e320b5b16ed8f912257
+Patch0: %{name}-pc.patch
+Patch1: %{name}-nosse.patch
URL: http://www.openal.org/
-BuildRequires: SDL-devel
+%{?with_sdl:BuildRequires: SDL2-devel >= 2}
%{?with_alsa:BuildRequires: alsa-lib-devel}
-%{?with_arts:BuildRequires: artsc-devel}
-BuildRequires: autoconf >= 2.56
-BuildRequires: automake
-%{?with_esd:BuildRequires: esound-devel}
-%if %{with mmx}
-# MMX code triggers ICE in gcc 3.3.x
-BuildRequires: gcc >= 5:3.4.0
-%endif
-BuildRequires: libtool
-BuildRequires: libvorbis-devel
-%ifarch %{ix86}
-%{?with_mmx:BuildRequires: nasm}
-%endif
+BuildRequires: cmake >= 3.0.2
+%{?with_rtkit:BuildRequires: dbus-devel}
+%{?with_jack:BuildRequires: jack-audio-connection-kit-devel}
+BuildRequires: libmysofa-devel
+BuildRequires: libstdc++-devel >= 6:5
+%{?with_pipewire:BuildRequires: pipewire-devel >= 0.3}
BuildRequires: pkgconfig
-BuildRequires: smpeg-devel
-BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-
-%if %{with mmx}
-%define specflags_ia32 -mmmx
+%{?with_portaudio:BuildRequires: portaudio-devel}
+%{?with_pulseaudio:BuildRequires: pulseaudio-devel}
+BuildRequires: rpmbuild(macros) >= 1.742
+%if %{with gui}
+%if %{with qt4}
+BuildRequires: QtCore-devel >= 4.8.0
+BuildRequires: QtGui-devel >= 4.8.0
+BuildRequires: qt4-build >= 4.8.0
%else
-%define specflags_ia32 -U__MMX__
+BuildRequires: Qt5Core-devel >= 5
+BuildRequires: Qt5Gui-devel >= 5
+BuildRequires: Qt5Widgets-devel >= 5
+BuildRequires: qt5-build >= 5
+%endif
%endif
+%{?with_sse2:Requires: cpuinfo(sse2)}
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
OpenAL, the Open Audio Library, is a joint effort to create an open,
OpenGL, for games and other multimedia applications. OpenAL is already
supported by a number of hardware vendors and developers.
-%description -l pl
-OpenAL, otwarta biblioteka d¼wiêku, to po³±czony wysi³ek w celu
-stworzenia otwartego, niezale¿nego od producentów, miêdzyplatformowego
-interfejsu projektowania aplikacji w czê¶ci obs³ugi d¼wiêku.
-Biblioteka adresowana jest do twórców aplikacji i u¿ytkowników,
-którzy wybieraj± przeno¶ne standardy, jak OpenGL, w grach i
-aplikacjach multimedialnych. OpenAL posiada ju¿ wsparcie wielu
-dostarczycieli sprzêtu i programistów.
+%description -l pl.UTF-8
+OpenAL, otwarta biblioteka dźwięku, to połączony wysiłek w celu
+stworzenia otwartego, niezależnego od producentów, międzyplatformowego
+interfejsu projektowania aplikacji w części obsługi dźwięku.
+Biblioteka adresowana jest do twórców aplikacji i użytkowników,
+którzy wybierają przenośne standardy, jak OpenGL, w grach i
+aplikacjach multimedialnych. OpenAL posiada już wsparcie wielu
+dostarczycieli sprzętu i programistów.
%package devel
Summary: Headers for OpenAL
-Summary(pl): Pliki nag³ówkowe do OpenAL
+Summary(pl.UTF-8): Pliki nagłówkowe do OpenAL
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
Header files for OpenAL-based programs.
-%description devel -l pl
-Pliki nag³ówkowe potrzebne przy budowaniu programów opartych na
+%description devel -l pl.UTF-8
+Pliki nagłówkowe potrzebne przy budowaniu programów opartych na
OpenAL.
-%package static
-Summary: OpenAL static library
-Summary(pl): Statyczna biblioteka OpenAL
-Group: Development/Libraries
-Requires: %{name}-devel = %{version}-%{release}
+%package gui
+Summary: OpenAL configuration GUI
+Summary(pl.UTF-8): Graficzny interfejs do konfiguracji biblioteki OpenAL
+Group: X11/Applications/Sound
+Requires: %{name} = %{version}-%{release}
+%if %{with qt4}
+Requires: QtCore >= 4.8.0
+Requires: QtGui >= 4.8.0
+%else
+Requires: Qt5Core >= 5
+Requires: Qt5Gui >= 5
+Requires: Qt5Widgets >= 5
+%endif
-%description static
-OpenAL static library.
+%description gui
+OpenAL configuration GUI.
-%description static -l pl
-Biblioteka OpenAL do konsolidacji statycznej.
+%description gui -l pl.UTF-8
+Graficzny interfejs do konfiguracji biblioteki OpenAL.
%prep
-%setup -q -n openal-%{version}
+%setup -q -n openal-soft-%{version}
+%patch0 -p1
+%patch1 -p1
%build
-%{__libtoolize}
-%{__aclocal} -I admin/autotools/m4
-%{__autoconf}
-%{__autoheader}
-%{__automake}
-%configure \
- --%{?with_alsa:en}%{!?with_alsa:dis}able-alsa{,-dlopen} \
- --%{?with_arts:en}%{!?with_arts:dis}able-arts{,-dlopen} \
- --%{?with_esd:en}%{!?with_esd:dis}able-esd{,-dlopen} \
- --enable-sdl --enable-sdl-dlopen \
- --enable-capture \
- --enable-linux \
- --enable-null \
-%ifarch amd64 x86_64 athlon i686 i586
- --enable-optim-generic \
-%endif
- --enable-waveout \
- --enable-vorbis --enable-vorbis-dlopen \
- --enable-mp3 --enable-mp3-dlopen \
- --with-gcc="%{__cc}"
+cd build
+%cmake .. \
+ %{!?with_alsa:-DALSOFT_BACKEND_ALSA=OFF} \
+ %{!?with_jack:-DALSOFT_BACKEND_JACK=OFF} \
+ %{cmake_on_off pipewire ALSOFT_BACKEND_PIPEWIRE} \
+ %{!?with_portaudio:-DALSOFT_BACKEND_PORTAUDIO=OFF} \
+ %{!?with_pulseaudio:-DALSOFT_BACKEND_PULSEAUDIO=OFF} \
+ %{cmake_on_off rtkit ALSOFT_RTKIT} \
+ %{?with_sdl:-DALSOFT_BACKEND_SDL2=ON} \
+ %{!?with_sse2:-DALSOFT_ENABLE_SSE2_CODEGEN=OFF} \
+ -DALSOFT_EXAMPLES=OFF \
+ %{!?with_gui:-DALSOFT_NO_CONFIG_UTIL=ON} \
+ %{?with_qt4:-DALSOFT_NO_QT5=ON} \
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/openal
-%{__make} install \
+%{__make} -C build install \
DESTDIR=$RPM_BUILD_ROOT
+install -p alsoftrc.sample $RPM_BUILD_ROOT%{_sysconfdir}/openal/alsoft.conf
+
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc ChangeLog NOTES TODO
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/openal
+%attr(755,root,root) %{_bindir}/makemhr
+%attr(755,root,root) %{_bindir}/openal-info
%attr(755,root,root) %{_libdir}/libopenal.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libopenal.so.1
+%{_datadir}/openal
%files devel
%defattr(644,root,root,755)
-%doc common/specification/OpenAL1-1Spec.pdf
-%attr(755,root,root) %{_bindir}/openal-config
%attr(755,root,root) %{_libdir}/libopenal.so
-%{_libdir}/libopenal.la
%{_includedir}/AL
%{_pkgconfigdir}/openal.pc
+%{_libdir}/cmake/OpenAL
-%files static
+%if %{with gui}
+%files gui
%defattr(644,root,root,755)
-%{_libdir}/libopenal.a
+%attr(755,root,root) %{_bindir}/alsoft-config
+%endif