File libsndfile-progs.spec of Package libsndfile.22299

#
# spec file for package libsndfile-progs
#
# Copyright (c) 2022 SUSE LLC
#
# 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/
#


Name:           libsndfile-progs
BuildRequires:  alsa-devel
BuildRequires:  flac-devel
BuildRequires:  gcc-c++
BuildRequires:  libjack-devel
BuildRequires:  libtool
BuildRequires:  libvorbis-devel
BuildRequires:  pkgconfig
BuildRequires:  sqlite-devel
Summary:        Example Programs for libsndfile
License:        LGPL-2.1-or-later
Group:          System/Libraries
Version:        1.0.25
Release:        0
Source:         http://www.mega-nerd.com/libsndfile/files/libsndfile-%{version}.tar.gz
# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch0:         libsndfile-example-fix.diff
# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch1:         libsndfile-paf-zero-division-fix.diff
Patch2:         sndfile-ocloexec.patch
# PATCH-FIX-UPSTREAM CVE-2014-9496 bnc#911796
Patch3:         sndfile-src-sd2.c-Fix-segfault-in-SD2-RSRC-parser.patch
# PATCH-FIX-UPSTREAM CVE-2014-9496 bnc#911796
Patch4:         sndfile-src-sd2.c-Fix-two-potential-buffer-read-overflows.patch
# PATCH-FIX-UPSTREAM CVE-2014-9756 bsc#953521
Patch5:         libsndfile-src-file_io.c-Prevent-potential-divide-by-zero.patch
# PATCH-FIX-UPSTREAM CVE-2015-7805 bsc#953516
Patch6:         libsndfile-src-common.c-Fix-a-header-parsing-bug.patch
# PATCH-FIX-SUSE CVE-2015-7805 bsc#953516
Patch7:         libsndfile-fix-header-read-CVE-2015-7805.patch
# PATCH-FIX-SUSE CVE-2015-8075 bsc#953519
Patch8:         libsndfile-psf_strlcpy_crlf-fix-CVE-2015-8075.patch
# PATCH-FIX-UPSTREAM CVE-2017-7585 CVE-2017-7586 bsc#1033054 bsc#1033053
Patch101:       0001-src-id3.c-Fix-a-stack-overflow-when-parsing-a-file-w.patch
Patch102:       0002-src-id3.c-Improve-error-handling.patch
Patch103:       0003-src-flac.c-Improve-error-handling.patch
# PATCH-FIX-UPSTREAM
Patch201:       0001-FLAC-Fix-a-buffer-read-overrun.patch
Patch202:       0002-src-flac.c-Fix-a-buffer-read-overflow.patch
Patch203:       0003-src-flac.c-Fix-another-memory-leak.patch
# PATCH-FIX-UPSTREAM CVE-2017-6892 bsc#1043978
Patch210:       0010-src-aiff.c-Fix-a-buffer-read-overflow.patch
# PATCH-FIX-UPSTREAM CVE-2017-16942 bsc#1069874
Patch301:       0001-src-Don-t-fake-psf-bytewidth-values.patch
Patch302:       0002-WAV-Avoid-divide-by-zero-exception.patch
# PATCH-FIX-UPSTREAM
Patch401:       0020-src-float32-double64-.c-Fix-potential-divide-by-0.patch
Patch402:       0030-double64_init-Check-psf-sf.channels-against-upper-bo.patch
# not yet upstreamed, https://github.com/erikd/libsndfile/issues/317
Patch403:       0031-sfe_copy_data_fp-check-value-of-max-variable.patch
# not yet upstreamed
Patch404:       libsndfile-CVE-2017-17456-alaw-range-check.patch
Patch405:       libsndfile-CVE-2017-17457-ulaw-range-check.patch
Patch406:       sndfile-deinterlace-channels-check.patch
URL:            http://www.mega-nerd.com/libsndfile/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This package includes the example programs for libsndfile.

%prep
%setup -q -n libsndfile-%{version}
%patch0
%patch1 -p1
%patch2
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1
%patch201 -p1
%patch202 -p1
%patch203 -p1
%patch210 -p1
%patch301 -p1
%patch302 -p1
%patch401 -p1
%patch402 -p1
%patch403 -p1
%patch404 -p1
%patch405 -p1
%patch406 -p1

%build
%define warn_flags -W -Wall -Wstrict-prototypes -Wpointer-arith -Wno-unused-parameter
autoreconf --force --install
CFLAGS="$RPM_OPT_FLAGS %{warn_flags}"
export CFLAGS
%configure --disable-silent-rules \
	--disable-static \
        --enable-sqlite \
	--with-pic
make %{?_smp_mflags}

%install
make DESTDIR="$RPM_BUILD_ROOT" install
# remove unnecessary lib files
rm -rf $RPM_BUILD_ROOT%{_libdir}
rm -rf $RPM_BUILD_ROOT%{_includedir}
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libsndfile1-dev

%files
%defattr(-, root, root)
%{_bindir}/*
%doc %{_mandir}/man?/*

%changelog
openSUSE Build Service is sponsored by