File aubio.spec of Package aubio.openSUSE_Leap_15.0_Update

#
# spec file for package aubio
#
# Copyright (c) 2018 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 http://bugs.opensuse.org/
#


Name:           aubio
%define libpkgname libaubio5
Summary:        Library for real-time audio labelling
License:        GPL-3.0-or-later
Group:          Development/Libraries/C and C++
BuildRequires:  alsa-devel
BuildRequires:  doxygen
%if 0%{?suse_version} > 1320 || (0%{?suse_version} == 1315 && 0%{?is_opensuse})
BuildRequires:  txt2man
BuildRequires:  pkgconfig(libavcodec)
BuildRequires:  pkgconfig(libavformat)
BuildRequires:  pkgconfig(libavresample)
BuildRequires:  pkgconfig(libavutil)
%endif
BuildRequires:  fftw3-devel
BuildRequires:  libjack-devel
BuildRequires:  libsamplerate-devel
BuildRequires:  libsndfile-devel
BuildRequires:  pkg-config
BuildRequires:  python-devel
Version:        0.4.6
Release:        0
Source:         http://aubio.org/pub/%{name}-%{version}.tar.bz2
Source1:        http://aubio.org/pub/%{name}-%{version}.tar.bz2.asc
Source99:       baselibs.conf
# PATCH-FIX-UPSTREAM CVE-2017-17054 bsc#1070399
Patch1:         aubio-wavread-input-validation.patch
# PATCH-FIX-UPSTREAM CVE-2017-17554 bsc#1072317
Patch2:         aubio-resampler-NULL-deref-fix.patch
# PATCH-FIX-UPSTREAM CVE-2018-14523 bsc#1102364
Patch3:         0001-src-pitch-pitchyinfft.c-fix-out-of-bound-read-when-s.patch
Patch4:         0002-src-pitch-pitchyinfft.c-comment-out-debug-output.patch
# PATCH-FIX-UPSTREAM CVE-2018-14522 bsc#1102359
Patch5:         0001-src-notes-notes.c-bail-out-if-pitch-creation-failed-.patch
Patch6:         0002-src-io-source_wavread.c-also-exit-if-samplerate-is-n.patch
# PATCH-FIX-UPSTREAM CVE-2018-19800 bsc#1137828
Patch7:         CVE-2018-19800-tempo-fix-buffer-overflow-in-method-parser.patch
# PATCH-FIX-UPSTREAM CVE-2018-19801 bsc#1137822
Patch8:         CVE-2018-19801-filterbank-validate-input-parameters.patch
# PATCH-FIX-UPSTREAM CVE-2018-19802 bsc#1137823
Patch9:         CVE-2018-19802-notes-prevent-null-pointer-dereference.patch
Url:            http://aubio.org
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%define debug_package_requires %{libpkgname} = %{version}-%{release}

%description
Aubio is a library for real time audio labelling. Its features include
segmenting a sound file before each of its attacks, performing pitch
detection, tapping the beat and producing midi streams from live audio.
The name aubio comes from 'audio' with a typo: several transcription
errors are likely to be found in the results too.

%package -n %{libpkgname}
Summary:        Library for real-time audio labelling
Group:          System/Libraries

%description -n %{libpkgname}
Aubio is a library for real time audio labelling. Its features include
segmenting a sound file before each of its attacks, performing pitch
detection, tapping the beat and producing midi streams from live audio.
The name aubio comes from 'audio' with a typo: several transcription
errors are likely to be found in the results too.

%package -n libaubio-devel
Summary:        Development package for aubio library
Group:          Development/Libraries/C and C++
Requires:       %{libpkgname} = %{version}
Requires:       glibc-devel

%description -n libaubio-devel
This package contains the files needed to compile programs that use
aubio library.

%package tools
Summary:        Example programs for aubio library
Group:          Productivity/Multimedia/Sound/Editors and Convertors

%description tools
This package includes the example programs for aubio library.

%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
sed -e "s,/lib,/%_lib," src/wscript_build > src/wscript_build.new
diff -u src/wscript_build src/wscript_build.new || :
mv src/wscript_build.new src/wscript_build

%build
./waf configure --prefix=%{_prefix} --libdir=%{_libdir}
./waf build

%install
./waf install --destdir=%{buildroot}
mkdir -p %{buildroot}%{_docdir}/%{name}
cp -pR %{buildroot}%{_datadir}/doc/libaubio-doc/html %{buildroot}%{_docdir}/%{name}
rm -rf %{buildroot}%{_datadir}/doc/libaubio-doc
rm -f %{buildroot}%{_libdir}/libaubio.a

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

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

%files -n %{libpkgname}
%defattr(-, root, root)
%{_libdir}/lib*.so.*

%files -n libaubio-devel
%defattr(-, root, root)
%doc AUTHORS ChangeLog README.md
%license COPYING
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*.pc
%{_includedir}/aubio

%files tools
%defattr(-, root, root)
%doc %{_docdir}/%{name}
%if 0%{?suse_version} > 1320 || (0%{?suse_version} == 1315 && 0%{?is_opensuse})
%{_mandir}/man1/*
%endif
%{_bindir}/*

%changelog
openSUSE Build Service is sponsored by