346cf7
# Disable if you don't need xmms
346cf7
%global with_xmms !0%{?rhel}
346cf7
346cf7
%if %{with_xmms}
346cf7
%define xmms_inputdir %(xmms-config --input-plugin-dir 2>/dev/null || echo %{_libdir}/xmms/General)
346cf7
%endif
346cf7
346cf7
Summary: An encoder/decoder for the Free Lossless Audio Codec
346cf7
Name: flac
346cf7
Version: 1.3.3
d49bc4
Release: 10%{?dist}
346cf7
License: BSD and GPLv2+ and GFDL
346cf7
Source0: https://downloads.xiph.org/releases/flac/flac-%{version}.tar.xz
346cf7
URL: https://www.xiph.org/flac/
346cf7
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
346cf7
BuildRequires: libogg-devel
346cf7
BuildRequires: gcc gcc-c++ automake autoconf libtool gettext-devel doxygen
346cf7
%if %{with_xmms}
346cf7
BuildRequires: xmms-devel desktop-file-utils
346cf7
Source1: xmms-flac.desktop
346cf7
%endif
346cf7
%ifarch %{ix86}
346cf7
# 2.0 supports symbol visibility
346cf7
BuildRequires: nasm >= 2.0
346cf7
%endif
346cf7
BuildRequires: make
346cf7
346cf7
Patch1: flac-cve-2020-0499.patch
d49bc4
# handle end-of-stream when encoding with verification
d49bc4
Patch2: flac-cve-2021-0561.patch
346cf7
346cf7
%description
346cf7
FLAC stands for Free Lossless Audio Codec. Grossly oversimplified, FLAC
346cf7
is similar to Ogg Vorbis, but lossless. The FLAC project consists of
346cf7
the stream format, reference encoders and decoders in library form,
346cf7
flac, a command-line program to encode and decode FLAC files, metaflac,
346cf7
a command-line metadata editor for FLAC files and input plugins for
346cf7
various music players.
346cf7
346cf7
This package contains the command-line tools and documentation.
346cf7
346cf7
%package libs
346cf7
Summary: Libraries for the Free Lossless Audio Codec
346cf7
Obsoletes: flac < 1.2.1-11
346cf7
346cf7
%description libs
346cf7
FLAC stands for Free Lossless Audio Codec. Grossly oversimplified, FLAC
346cf7
is similar to Ogg Vorbis, but lossless. The FLAC project consists of
346cf7
the stream format, reference encoders and decoders in library form,
346cf7
flac, a command-line program to encode and decode FLAC files, metaflac,
346cf7
a command-line metadata editor for FLAC files and input plugins for
346cf7
various music players.
346cf7
This package contains the FLAC libraries.
346cf7
346cf7
%package devel
346cf7
Summary: Development libraries and header files from FLAC
346cf7
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
346cf7
Requires: pkgconfig
346cf7
346cf7
%description devel
346cf7
This package contains all the files needed to develop applications that
346cf7
will use the Free Lossless Audio Codec.
346cf7
346cf7
%if %{with_xmms}
346cf7
%package -n xmms-flac
346cf7
Summary: XMMS plugin needed to play FLAC (Free Lossless Audio Codec) files
346cf7
# The entire FLAC sources are covered by multiple licenses, but the xmms plugin
346cf7
# is only GPLv2+
346cf7
License: GPLv2+
346cf7
346cf7
%description -n xmms-flac
346cf7
FLAC is a Free Lossless Audio Codec. The FLAC format supports streaming,
346cf7
seeking, and archival, and gives 25-75% compression on typical CD audio.
346cf7
This is the input plugin for XMMS to be able to read FLAC files.
346cf7
%endif
346cf7
346cf7
%prep
346cf7
%setup -q
346cf7
%patch1 -p1 -b .cve-2020-0499
d49bc4
%patch2 -p1 -b .cve-2021-0561
346cf7
346cf7
%build
346cf7
# use our libtool to avoid problems with RPATH
346cf7
./autogen.sh -V
346cf7
346cf7
# -funroll-loops makes encoding about 10% faster
346cf7
export CFLAGS="%{optflags} -funroll-loops"
346cf7
%configure \
346cf7
    --htmldir=%{_docdir}/flac/html \
346cf7
%if %{with_xmms}
346cf7
    --enable-xmms-plugin \
346cf7
%else
346cf7
    --disable-xmms-plugin \
346cf7
%endif
346cf7
    --disable-silent-rules \
346cf7
    --disable-thorough-tests
346cf7
346cf7
%make_build
346cf7
346cf7
%install
346cf7
%make_install
346cf7
346cf7
%if %{with_xmms} 
346cf7
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1}
346cf7
%endif
346cf7
346cf7
# split documentation
346cf7
mv %{buildroot}%{_docdir}/flac* ./flac-doc
346cf7
mkdir -p flac-doc-devel
346cf7
mv flac-doc{/html/api,-devel}
346cf7
rm flac-doc/FLAC.tag
346cf7
346cf7
rm %{buildroot}%{_libdir}/*.la
346cf7
%if %{with_xmms}
346cf7
rm %{buildroot}%{xmms_inputdir}/*.la
346cf7
%endif
346cf7
346cf7
%check
346cf7
make check
346cf7
346cf7
%ldconfig_scriptlets libs
346cf7
346cf7
%files
346cf7
%doc flac-doc/*
346cf7
%{_bindir}/flac
346cf7
%{_bindir}/metaflac
346cf7
%{_mandir}/man1/*
346cf7
346cf7
%files libs
346cf7
%doc AUTHORS COPYING* README
346cf7
%{_libdir}/libFLAC.so.8*
346cf7
%{_libdir}/libFLAC++.so.6*
346cf7
346cf7
%files devel
346cf7
%doc flac-doc-devel/*
346cf7
%{_includedir}/*
346cf7
%{_libdir}/*.so
346cf7
%{_libdir}/pkgconfig/*
346cf7
%{_datadir}/aclocal/*.m4
346cf7
346cf7
%if %{with_xmms}
346cf7
%files -n xmms-flac
346cf7
%license COPYING.GPL
346cf7
%{_datadir}/applications/xmms-flac.desktop
346cf7
%{xmms_inputdir}/libxmms-flac.so
346cf7
%endif
346cf7
346cf7
%changelog
d49bc4
* Thu May 05 2022 Miroslav Lichvar <mlichvar@redhat.com> 1.3.3-10
d49bc4
- handle end-of-stream when encoding with verification (CVE-2021-0561)
d49bc4
346cf7
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1.3.3-9
346cf7
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
346cf7
  Related: rhbz#1991688
346cf7
346cf7
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 1.3.3-8
346cf7
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
346cf7
346cf7
* Fri Feb 19 2021 Adam Jackson <ajax@redhat.com> - 1.3.3-7
346cf7
- Fix the previous change to actually build in RHEL
346cf7
346cf7
* Thu Feb 18 2021 Adam Jackson <ajax@redhat.com> - 1.3.3-6
346cf7
- Disable xmms in RHEL
346cf7
346cf7
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.3-5
346cf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
346cf7
346cf7
* Thu Jan 07 2021 Miroslav Lichvar <mlichvar@redhat.com> 1.3.3-4
346cf7
- fix out-of-bounds read in decoder (CVE-2020-0499)
346cf7
346cf7
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.3-3
346cf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
346cf7
346cf7
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.3-2
346cf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
346cf7
346cf7
* Tue Aug 06 2019 Miroslav Lichvar <mlichvar@redhat.com> 1.3.3-1
346cf7
- update to 1.3.3
346cf7
- include soname in file list
346cf7
346cf7
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.2-12
346cf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
346cf7
346cf7
* Thu Mar  7 2019 Tim Landscheidt <tim@tim-landscheidt.de> - 1.3.2-11
346cf7
- Remove obsolete requirements for %%post/%%postun scriptlets
346cf7
346cf7
* Tue Feb 05 2019 Miroslav Lichvar <mlichvar@redhat.com> 1.3.2-10
346cf7
- rebuild again
346cf7
- fix indentation in buildrequires
346cf7
346cf7
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.2-9
346cf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
346cf7
346cf7
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.2-8
346cf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
346cf7
346cf7
* Wed May 02 2018 Miroslav Lichvar <mlichvar@redhat.com> 1.3.2-7
346cf7
- fix memory leak in parsing of vorbis comments (CVE-2017-6888)
346cf7
- add gcc to build requirements
346cf7
346cf7
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.2-6
346cf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
346cf7
346cf7
* Sat Feb 03 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.3.2-5
346cf7
- Switch to %%ldconfig_scriptlets
346cf7
346cf7
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.2-4
346cf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
346cf7
346cf7
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.2-3
346cf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
346cf7
346cf7
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.2-2
346cf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
346cf7
346cf7
* Mon Jan 02 2017 Miroslav Lichvar <mlichvar@redhat.com> 1.3.2-1
346cf7
- update to 1.3.2
346cf7
346cf7
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.1-6
346cf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
346cf7
346cf7
* Mon Aug 10 2015 Tom Callaway <spot@fedoraproject.org> - 1.3.1-5
346cf7
- add xmms-flac plugin as a conditionalized subpackage
346cf7
346cf7
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.1-4
346cf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
346cf7
346cf7
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 1.3.1-3
346cf7
- Rebuilt for GCC 5 C++11 ABI change
346cf7
346cf7
* Sat Feb 21 2015 Till Maas <opensource@till.name> - 1.3.1-2
346cf7
- Rebuilt for Fedora 23 Change
346cf7
  https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code
346cf7
346cf7
* Thu Nov 27 2014 Miroslav Lichvar <mlichvar@redhat.com> 1.3.1-1
346cf7
- update to 1.3.1 (CVE-2014-8962, CVE-2014-9028)
346cf7
346cf7
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.0-5
346cf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
346cf7
346cf7
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.0-4
346cf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
346cf7
346cf7
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.0-3
346cf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
346cf7
346cf7
* Mon Jun 03 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.3.0-2
346cf7
- fix memory corruption in metaflac (#969259)
346cf7
- disable slower assembly code
346cf7
346cf7
* Tue May 28 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.3.0-1
346cf7
- update to 1.3.0
346cf7
346cf7
* Tue Apr 02 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.3.0-0.2.pre3
346cf7
- update to 1.3.0pre3
346cf7
346cf7
* Tue Mar 05 2013 Miroslav Lichvar <mlichvar@redhat.com> 1.3.0-0.1.pre1
346cf7
- update to 1.3.0pre1
346cf7
- make some dependencies arch-specific
346cf7
346cf7
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.1-13.20121204gita43f56
346cf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
346cf7
346cf7
* Thu Dec 06 2012 Kalev Lember <kalevlember@gmail.com> - 1.2.1-12.20121204gita43f56
346cf7
- Added self-obsoletes to help multilib upgrades
346cf7
346cf7
* Tue Dec 04 2012 Miroslav Lichvar <mlichvar@redhat.com> 1.2.1-11.20121204gita43f56
346cf7
- update to 20121204gita43f56
346cf7
- create libs subpackage
346cf7
- split documentation to base and devel subpackages
346cf7
- drop defattr macros
346cf7
- add GFDL to License tag
346cf7
346cf7
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.1-10
346cf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
346cf7
346cf7
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.1-9
346cf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
346cf7
346cf7
* Fri Dec  9 2011 Peter Robinson <pbrobinson@fedoraproject.org> - 1.2.1-8
346cf7
- Rebuild to fix FTBFS
346cf7
346cf7
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.1-7
346cf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
346cf7
346cf7
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.1-6
346cf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
346cf7
346cf7
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.1-5
346cf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
346cf7
346cf7
* Mon Mar 17 2008 Miroslav Lichvar <mlichvar@redhat.com> 1.2.1-4
346cf7
- speed up decoding
346cf7
- CFLAGS cleanup
346cf7
346cf7
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.2.1-3
346cf7
- Autorebuild for GCC 4.3
346cf7
346cf7
* Tue Jan 29 2008 Miroslav Lichvar <mlichvar@redhat.com> 1.2.1-2
346cf7
- fix building with gcc-4.3 
346cf7
- reenable some assembly optimizations
346cf7
- hide private libFLAC symbols (#285961)
346cf7
- update license tag
346cf7
- add %%check
346cf7
- remove -maltivec from CFLAGS
346cf7
346cf7
* Mon Sep 17 2007 - Bastien Nocera <bnocera@redhat.com> - 1.2.1-1
346cf7
- Update to 1.2.1
346cf7
346cf7
* Wed Sep 12 2007 - Bastien Nocera <bnocera@redhat.com> - 1.2.0-3
346cf7
- Make a few functions hidden, to try and avoid textrels
346cf7
- Disable optimisations on x86 for the same reason
346cf7
  (#285961)
346cf7
346cf7
* Tue Sep 11 2007 - Bastien Nocera <bnocera@redhat.com> - 1.2.0-2
346cf7
- Update GNU stack patch to cover all the NASM sources used
346cf7
346cf7
* Mon Sep 10 2007 - Bastien Nocera <bnocera@redhat.com> - 1.2.0-1
346cf7
- Update for 1.20 and drop obsolete patches (#285161)
346cf7
346cf7
* Fri Aug 24 2007 Adam Jackson <ajax@redhat.com> - 1.1.4-5
346cf7
- Rebuild for build ID
346cf7
346cf7
* Thu Apr 12 2007 - Bastien Nocera <bnocera@redhat.com> - 1.1.4-4
346cf7
- The byteSwap symbol shouldn't be global, reported by Joe Orton
346cf7
  <jorton@redhat.com> (#215920)
346cf7
346cf7
* Wed Feb 14 2007 - Bastien Nocera <bnocera@redhat.com> - 1.1.4-3
346cf7
- Also include the new pkgconfig files
346cf7
346cf7
* Wed Feb 14 2007 - Bastien Nocera <bnocera@redhat.com> - 1.1.4-2
346cf7
- Update link-ogg patch for 1.1.4
346cf7
346cf7
* Wed Feb 14 2007 - Bastien Nocera <bnocera@redhat.com> - 1.1.4-1
346cf7
- Update to upstream 1.1.4
346cf7
346cf7
* Tue Feb 13 2007 - Bastien Nocera <bnocera@redhat.com> - 1.1.3-2
346cf7
- A few fixes from the the Fedora merge review
346cf7
- Remove the static library
346cf7
346cf7
* Tue Feb 13 2007 - Bastien Nocera <bnocera@redhat.com> - 1.1.3-1
346cf7
- Update with work from Matthias Clasen <mclasen@redhat.com> up
346cf7
  to upstream 1.1.3 (#229462)
346cf7
- Remove xmmx-flac Obsolete, as we don't ship the xmms plugin
346cf7
346cf7
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 1.1.2-27
346cf7
- rebuild
346cf7
- Try building w/ glib2-devel
346cf7
346cf7
* Wed Jun  7 2006 Jeremy Katz <katzj@redhat.com> - 1.1.2-26
346cf7
- rebuild for -devel deps
346cf7
346cf7
* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 1.1.2-25.2.1
346cf7
- bump again for double-long bug on ppc(64)
346cf7
346cf7
* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 1.1.2-25.2
346cf7
- rebuilt for new gcc4.1 snapshot and glibc changes
346cf7
346cf7
* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
346cf7
- rebuilt
346cf7
346cf7
* Thu Apr 21 2005 Warren Togami <wtogami@redhat.com> - 1.1.2-25
346cf7
- Fix buildreqs  (#154649 thias)
346cf7
- obsolete older xmms-flac
346cf7
346cf7
* Mon Apr  4 2005 Elliot Lee <sopwith@redhat.com> - 1.1.2-24
346cf7
- Removed xmms-flac subpackage
346cf7
346cf7
* Tue Mar 29 2005 John (J5) Palmieri <johnp@redhat.com> 1.1.2-2
346cf7
- Rebuild (flac picked up a dependancy on it's older version)
346cf7
346cf7
* Mon Mar 28 2005 John (J5) Palmieri <johnp@redhat.com> 1.1.2-1
346cf7
- Update to upstream version 1.1.2
346cf7
- Replace flac-1.1.0-libtool.patch with flac-1.1.2-libtool.patch
346cf7
346cf7
* Wed Mar 02 2005 John (J5) Palmieri <johnp@redhat.com> 1.1.0-9
346cf7
- rebuild for gcc 4.0
346cf7
346cf7
* Wed Feb 23 2005 Colin Walters <walters@redhat.com> 1.1.0-8
346cf7
- New patch flac-1.1.0-gnu-stack.patch from Ulrich Drepper to mark asm
346cf7
  as not requiring an executable stack
346cf7
346cf7
* Thu Jul 15 2004 Tim Waugh <twaugh@redhat.com> 1.1.0-7
346cf7
- Fixed warnings in shipped m4 file.
346cf7
346cf7
* Mon Jun 21 2004 Colin Walters <walters@redhat.com> 1.1.0-6
346cf7
- BuildRequire glib-devel for xmms plugin
346cf7
- BuildRequire nasm
346cf7
346cf7
* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
346cf7
- rebuilt
346cf7
346cf7
* Sun Apr 04 2004 Warren Togami <wtogami@redhat.com> 1.1.0-4
346cf7
- #119551 flac-xmms -> xmms-flac to match fedora.us and freshrpms.net
346cf7
- Obsoletes flac-libs to upgrade smoothly from fedora.us
346cf7
346cf7
* Thu Mar 11 2004 Bill Nottingham <notting@redhat.com> 1.1.0-3
346cf7
- fix x86_64 linkage (#117893)
346cf7
346cf7
* Tue Mar 02 2004 Elliot Lee <sopwith@redhat.com>
346cf7
- rebuilt
346cf7
346cf7
* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
346cf7
- rebuilt
346cf7
346cf7
* Wed Aug  6 2003 Bill Nottingham <notting@redhat.com> 1.1.0-1
346cf7
- initial build