File zita-resampler.spec of Package zita-resampler
# spec file for package zita-resampler
%define soversion 1
%define libname lib%{name}%{soversion}
Summary: Fast, high-quality sample rate conversion library
Name: zita-resampler
Version: 1.6.2
Release: 1
License: GPL-3.0+
Group: Productivity/Multimedia/Sound/Utilities
URL: http://kokkinizita.linuxaudio.org/linuxaudio/zita-resampler/resampler.html
Source0: http://kokkinizita.linuxaudio.org/linuxaudio/downloads/zita-resampler-%{version}.tar.bz2
BuildRequires: gcc-c++
BuildRequires: libsndfile-devel
%description
Zita-resampler is a C++ library for resampling audio signals. It is
designed to be used within a real-time processing context, to be fast,
and to provide high-quality sample rate conversion.
The library operates on signals represented in single-precision
floating point format. For multichannel operation both the input and
output signals are assumed to be stored as interleaved samples.
The API allows a trade-off between quality and CPU load. For the
latter a range of approximately 1:6 is available. Even at the highest
quality setting zita-resampler will be faster than most similar
libraries, e.g. libsamplerate.
Author: Fons Adriaensen
%package -n %{libname}
Summary: Fast, high-quality sample rate conversion library
Group: System/Libraries
%description -n %{libname}
This package contains the shared libraries for %{name}.
%package devel
Summary: Development libraries and headers for %{name}
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}-%{release}
%description devel
This package contains the headers and development libraries for %{name}.
%prep
%setup -q
# To make sure to have the correct Fedora specific flags:
sed -i -e 's|-O2|%{optflags} -I../source|' -e 's|ldconfig||' -e 's|-march=native||' source/Makefile
sed -i -e 's|-O3|%{optflags} -I../source|' -e 's|-march=native||' apps/Makefile
%build
export LDFLAGS="-L../source"
make %{?_smp_mflags} -C source
# In order to build apps, we need to create the symlink
# Note that this is originally done at "make install" stage
ln -sf libzita-resampler.so.%{version} source/libzita-resampler.so
make VERSION=%{version} CXXFLAGS+="-I../source -DVERSION=\"$(VERSION)\"" %{?_smp_mflags} -C apps
%install
rm -rf %{buildroot}
make PREFIX=%{buildroot}%{_prefix} LIBDIR=%{buildroot}%{_libdir} -C source install
make MANDIR=%{buildroot}%{_mandir}/man1 PREFIX=%{buildroot}%{_prefix} LIBDIR=%{buildroot}%{_libdir} -C apps install
/sbin/ldconfig -n %{buildroot}/%{_libdir}
chmod 755 %{buildroot}/%{_libdir}/lib%{name}.so.%{version}
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING
%{_bindir}/*
%{_mandir}/man1/*
%files -n %{libname}
%defattr(-,root,root,-)
%{_libdir}/lib%{name}.so.*
%files devel
%defattr(-,root,root,-)
%doc docs/*
%{_includedir}/%{name}
%{_libdir}/lib%{name}.so
%changelog