#
# spec file for package soxr
#
# Copyright (c) 2019 SUSE LINUX 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 https://bugs.opensuse.org/
#


%define lname   libsoxr0
%define lname_lsr libsoxr-lsr0
Name:           soxr
Version:        0.1.3
Release:        3.1
Summary:        The SoX Resampler library
License:        LGPL-2.1-or-later
Url:            http://soxr.sourceforge.net/
Source:         http://downloads.sf.net/%{name}/%{name}-%{version}-Source.tar.xz#/%{name}-%{version}.tar.xz
Source1:        baselibs.conf
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  cmake >= 3.5
BuildRequires:  gcc
BuildRequires:  pkg-config

%description
The SoX Resampler library performs one-dimensional sample-rate
conversion – it may be used, for example, to resample PCM-encoded
audio.

%package -n %{lname}
Summary:        The SoX Resampler library

%description -n %{lname}
The SoX Resampler library performs one-dimensional sample-rate
conversion – it may be used, for example, to resample PCM-encoded
audio.

%package -n %{lname_lsr}
Summary:        Compatibility layer with libsamplerate

%description -n %{lname_lsr}
soxr libsamplerate API compatibility layer (to some extent).

%package devel
Summary:        Development files of soxr
Requires:       %{lname_lsr} = %{version}
Requires:       %{lname} = %{version}

%description devel
The soxr development package includes the header files,
libraries, development tools necessary for compiling and linking
application which will use libsoxr/libsoxr-lsr.

%prep
%setup -q -n %{name}-%{version}-Source

%build

%ifarch %arm
%define _lto_cflags %{nil}
%endif

%cmake \
  -DDOC_INSTALL_DIR=%{_docdir}/%{name} \
  -DCMAKE_POLICY_VERSION_MINIMUM=3.5
make %{?_smp_mflags}

%install
%cmake_install

%check
%ctest

%post -n %{lname} -p /sbin/ldconfig

%postun -n %{lname} -p /sbin/ldconfig

%post -n %{lname_lsr} -p /sbin/ldconfig

%postun -n %{lname_lsr} -p /sbin/ldconfig

%files -n %{lname}
%defattr(-,root,root)
%doc AUTHORS NEWS
%license COPYING.LGPL LICENCE
%{_libdir}/libsoxr.so.*

%files -n %{lname_lsr}
%defattr(-,root,root)
%license COPYING.LGPL LICENCE
%{_libdir}/libsoxr-lsr.so.*

%files devel
%defattr(-,root,root)
%doc %{_docdir}/%{name}/
%{_includedir}/soxr*.h
%{_libdir}/libsoxr*.so
%{_libdir}/pkgconfig/soxr*.pc

%changelog
* Sat Mar 22 2025 Shawn Dunn <sfalken@opensuse.org>
- Add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to fix FTBFS with cmake4
- Add %%check section
- Remove Group: declarations, no longer used
* Fri Nov  1 2019 Martin Liška <mliska@suse.cz>
- Disable LTO (boo#1155011) for ARM targets.
* Tue Mar 13 2018 davejplater@gmail.com
- Update to 0.1.3
- Upstream changes:
  * SIMD enhancements: SSE, AVX, Neon.
  * Improve support for clang, ARM, and cross-compilation.
  * Provide env. var. override of runtime parameters.
  * Build fix re cmake variables AVCODEC_INCLUDE_DIRS &
    AVUTIL_INCLUDE_DIRS.
  * Build options WITH_SINGLE_PRECISION, WITH_DOUBLE_PRECISION &
    WITH_SIMD have been removed; replacement options are detailed
    in INSTALL, `Resampling engines'.
* Wed Dec 16 2015 olaf@aepfle.de
- Add BuildRoot: for SLE_11
* Thu Sep 24 2015 mpluskal@suse.com
- Update to 1.1.2
  * Fix conversion failure when I/O types differ but I/O rates
    don't.
  * Fix #defines for interpolation order selection.
  * Fix ineffectual SOXR_MINIMUM_PHASE and SOXR_INTERMEDIATE_PHASE
    in soxr_quality_spec recipe.
  * Fix soxr_delay() returning a negative number after end-of-input
    has been indicated.
  * Fix crash when using soxr_process() after calling soxr_clear().
  * Be more POSIX compliant w.r.t. errno in the examples; fixes
    erroneous reporting of errors on FreeBSD.
  * Quality improvement for variable-rate.
  * Various fixes/improvements to build/tests/documentation.
* Tue Apr 28 2015 sor.alexei@meowr.ru
- Initial package.