File mingw32-opusfile.spec of Package mingw32-opusfile

#
# spec file for package mingw32-opusfile
#
# Copyright (c) 2025, Martin Hauke <mardnh@gmx.de>
#
# 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 realname opusfile
%define libname mingw32-lib%{realname}
Name:           mingw32-%{realname}
Version:        0.12
Release:        0
Summary:        A high-level API for decoding and seeking within .opus files
License:        BSD-3-Clause
Group:          System/Libraries
URL:            https://opus-codec.org/
Source:         https://downloads.xiph.org/releases/opus/%{realname}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM opusfile-CVE-2022-47021.patch boo#1207381 mgorse@suse.com -- fix a NULL pointer dereference.
Patch0:         opusfile-CVE-2022-47021.patch
BuildRequires:  mingw32-cross-gcc
BuildRequires:  mingw32-cross-cmake
BuildRequires:  mingw32-cross-pkg-config
BuildRequires:  mingw32-libopenssl-devel
BuildRequires:  mingw32-libogg-devel >= 1.3
BuildRequires:  mingw32-opus-devel >= 1.0.1
%_mingw32_package_header_debug
BuildArch:      noarch

%description
opusfile provides a high-level API for decoding and seeking within .opus files.
It includes:
* Support for all files with at least one Opus stream
  (including multichannel files or Ogg files where Opus is muxed with something else).
* Full support, including seeking, for chained files.
* A simple stereo downmixing API
  (allowing chained files to be decoded with a single output format, even if the channel count changes).
* Support for reading from a file, memory buffer, or over HTTP(S) (including seeking).
* Support for both random access and streaming data sources.

%package -n %{libname}
Summary:        A high-level API for decoding and seeking within .opus files

%description -n %{libname}
opusfile provides a high-level API for decoding and seeking within .opus files.
It includes:
* Support for all files with at least one Opus stream
  (including multichannel files or Ogg files where Opus is muxed with something else).
* Full support, including seeking, for chained files.
* A simple stereo downmixing API
  (allowing chained files to be decoded with a single output format, even if the channel count changes).
* Support for reading from a file, memory buffer, or over HTTP(S) (including seeking).
* Support for both random access and streaming data sources.

%package -n mingw32-%{realname}-devel
Summary:        Development package for %{name}
Group:          Development/Libraries/C and C++
Requires:       %{libname} = %{version}

%description -n mingw32-%{realname}-devel
Files for development with %{name}.

%_mingw32_debug_package

%prep
%setup -q -n %{realname}-%{version}
%autopatch -p1

%build
%{_mingw32_configure} \
  --disable-static \
  --disable-silent-rules
%{make_build}

%install
%{_mingw32_make_install}
rm -rf %{buildroot}%{_mingw32_datadir}/doc/opusfile/

%files -n %{libname}
%{_mingw32_bindir}/libopusfile-0.dll
%{_mingw32_bindir}/libopusurl-0.dll

%files -n mingw32-%{realname}-devel
%license COPYING
%doc README.md
%{_mingw32_includedir}/opus/opusfile.h
%{_mingw32_libdir}/libopusfile.dll.a
%{_mingw32_libdir}/libopusurl.dll.a
%{_mingw32_libdir}/pkgconfig/opusfile.pc
%{_mingw32_libdir}/pkgconfig/opusurl.pc

%changelog
openSUSE Build Service is sponsored by