%define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}

Summary: Audio Sample Rate Converter library
Summary(ja): 音声サンプリングレート変換ライブラリ
Name: libsamplerate
Version: 0.2.2
Release: 1%{?_dist_release}
Group: system
Vendor: Project Vine
Distribution: Vine Linux

License: BSD
URL: https://libsndfile.github.io/libsamplerate/
Source0: https://github.com/libsndfile/libsamplerate/releases/download/%{version}/libsamplerate-%{version}.tar.xz

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: libsndfile-devel >= 1.0.6
BuildRequires: fftw3-devel
Obsoletes: libsamplerate-docs < 0.2.0
Obsoletes: libsamplerate-progs < 0.2.0

%description
Secret Rabbit Code (aka libsamplerate) is a Sample Rate Converter for
audio. One example of where such a thing would be useful is
converting audio from the CD sample rate of 44.1kHz to the 48kHz
sample rate used by DAT players.

SRC is capable of arbitrary and time varying conversions ; from
downsampling by a factor of 12 to upsampling by the same
factor. Arbitrary in this case means that the ratio of input and
output sample rates can be an irrational number. The conversion ratio
can also vary with time for speeding up and slowing down effects.

SRC provides a small set of converters to allow quality to be traded
off against computation cost. The current best converter provides a
signal-to-noise ratio of 97dB with -3dB passband extending from DC to
96% of the theoretical best bandwidth for a given pair of input and
output sample rates.


%package devel
Summary: Audio Sample Rate Converter development files
Summary(ja): 音声サンプリングレート変換ライブラリの開発用ファイル
Group: programming
Requires: %{name} = %{version}-%{release}
Requires: pkgconfig

%description devel
Secret Rabbit Code (aka libsamplerate) is a Sample Rate Converter for
audio. One example of where such a thing would be useful is
converting audio from the CD sample rate of 44.1kHz to the 48kHz
sample rate used by DAT players.

SRC is capable of arbitrary and time varying conversions ; from
downsampling by a factor of 12 to upsampling by the same
factor. Arbitrary in this case means that the ratio of input and
output sample rates can be an irrational number. The conversion ratio
can also vary with time for speeding up and slowing down effects.

SRC provides a small set of converters to allow quality to be traded
off against computation cost. The current best converter provides a
signal-to-noise ratio of 97dB with -3dB passband extending from DC to
96% of the theoretical best bandwidth for a given pair of input and
output sample rates.


# compat32
%package -n compat32-%{name}
Summary: Audio Sample Rate Converter library
Summary(ja): 音声サンプリングレート変換ライブラリ
Group: system,legacy

%description -n compat32-%{name}
Secret Rabbit Code (aka libsamplerate) is a Sample Rate Converter for
audio. One example of where such a thing would be useful is
converting audio from the CD sample rate of 44.1kHz to the 48kHz
sample rate used by DAT players.

SRC is capable of arbitrary and time varying conversions ; from
downsampling by a factor of 12 to upsampling by the same
factor. Arbitrary in this case means that the ratio of input and
output sample rates can be an irrational number. The conversion ratio
can also vary with time for speeding up and slowing down effects.

SRC provides a small set of converters to allow quality to be traded
off against computation cost. The current best converter provides a
signal-to-noise ratio of 97dB with -3dB passband extending from DC to
96% of the theoretical best bandwidth for a given pair of input and
output sample rates.


%package -n compat32-%{name}-devel
Summary: Audio Sample Rate Converter development files
Summary(ja): 音声サンプリングレート変換ライブラリの開発用ファイル
Group: programming,legacy
Requires: compat32-%{name} = %{version}-%{release}
Requires: %{name}-devel = %{version}-%{release}

%description -n compat32-%{name}-devel
Secret Rabbit Code (aka libsamplerate) is a Sample Rate Converter for
audio. One example of where such a thing would be useful is
converting audio from the CD sample rate of 44.1kHz to the 48kHz
sample rate used by DAT players.

SRC is capable of arbitrary and time varying conversions ; from
downsampling by a factor of 12 to upsampling by the same
factor. Arbitrary in this case means that the ratio of input and
output sample rates can be an irrational number. The conversion ratio
can also vary with time for speeding up and slowing down effects.

SRC provides a small set of converters to allow quality to be traded
off against computation cost. The current best converter provides a
signal-to-noise ratio of 97dB with -3dB passband extending from DC to
96% of the theoretical best bandwidth for a given pair of input and
output sample rates.


%debug_package


%prep
%setup -q


%build
%configure
make


%install
make install DESTDIR=$RPM_BUILD_ROOT
rm -rf $RPM_BUILD_ROOT%{_libdir}/lib*.{a,la}


%files
%defattr(-,root,root)
%license COPYING
%doc %{_pkgdocdir}/*
%{_libdir}/*.so.*

%files devel
%defattr(-,root,root)
%{_libdir}/*.so
%{_libdir}/pkgconfig/samplerate.pc
%{_includedir}/samplerate.h

# compat32
%if %{build_compat32}
%files -n compat32-%{name}
%defattr(-,root,root)
%{_libdir}/*.so.*

%files -n compat32-%{name}-devel
%defattr(-,root,root)
%{_libdir}/*.so
%endif


%changelog
* Sat Jul 06 2024 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.2.2-1
- new upstream release.

* Fri Mar 26 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.2.1-1
- new upstream release.
- dropped ldconfig scriptlets.
- dropped *-progs and *-docs.

* Sun Aug 24 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.1.8-1
- update to 0.1.8
- create %%{name}-docs subpackage

* Sun Sep 26 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.1.7-2
- rebuild with rpm-4.8.1 for pkg-config file

* Sat Jan  9 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.1.7-1
- new upstream release

* Sun May 10 2009 NAKAMURA Kenta <kenta@vinelinux.org> 0.1.4-3
- added compat32 package for x86_64 arch support

* Tue Mar 31 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.1.4-2
- spec in utf-8
- remove static lib

* Sat Jul 12 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.1.4-1
- new upstream release
- applied new versioning policy
- removed lib*.la files from devel package

* Mon May 01 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.1.2-0vl2
- rebuilt with libsndfile for VineSeed Plus

* Wed Feb 08 2006 Atsushi SHICHI <ats7@a.email.ne.jp> 0.1.2-0vl0.1
- rebuild for VinePlus/3.0
- added BuildRequires: libsndfile-devel to progs subpackage
- fixed %%doc section

* Wed Sep 29 2004 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.1.2-0vl1
- new upstream release
- fixed %doc section
- fixed spec file encoding

* Tue Apr 13 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 0.1.0-0vl1
- initial build for Vine Linux