#
# spec file for package libmpcdec
#
# Copyright (c) 2015 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:           libmpcdec
Version:        1.2.6
Release:        34.10
Summary:        Musepack Audio Decoder
License:        BSD-3-Clause
Group:          System/Libraries
Url:            http://www.musepack.net/
Source0:        http://files.musepack.net/source/%{name}-%{version}.tar.bz2
Source1:        baselibs.conf
Patch0:         libmpcdec-1.2.6-nosamples.patch
Patch1:         libmpcdec-byteswap.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  gcc-c++
BuildRequires:  libtool
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Musepack is an audio compression format with a strong emphasis on high
quality. It is not lossless, but it is designed for transparency, so
that you cannot hear differences between the original WAV file and the
much smaller MPC file.

It is based on the MPEG-1 Layer-2 / MP2 algorithms, but since 1997 it
has rapidly developed and vastly improved and is now at an advanced
stage in which it contains heavily optimized and patentless code.

Musepack is not particularly optimized for low bit rates. The encoder
was designed to be transparent at the --standard setting, thus little
low bit rate tuning has gone into the codec, unlike that of AAC,
Vorbis, WMA, and others that focus more on this region.

%package -n libmpcdec5
Summary:        Musepack Audio Decoder
Group:          System/Libraries
Provides:       %{name} = %{version}
#openSUSE 10.2
Obsoletes:      %{name} < %{version}

%description -n libmpcdec5
Musepack is an audio compression format with a strong emphasis on high
quality. It is not lossless, but it is designed for transparency, so
that you cannot hear differences between the original WAV file and the
much smaller MPC file.

It is based on the MPEG-1 Layer-2 / MP2 algorithms, but since 1997 it
has rapidly developed and vastly improved and is now at an advanced
stage in which it contains heavily optimized and patentless code.

Musepack is not particularly optimized for low bit rates. The encoder
was designed to be transparent at the --standard setting, thus little
low bit rate tuning has gone into the codec, unlike that of AAC,
Vorbis, WMA, and others that focus more on this region.

%package devel
Summary:        Musepack Audio Decoder
Group:          Development/Libraries/C and C++
Requires:       glibc-devel
Requires:       libmpcdec5 = %{version}

%description devel
Musepack is an audio compression format with a strong emphasis on high
quality. It's not lossless, but it is designed for transparency, so
that you won't be able to hear differences between the original wave
file and the much smaller MPC file.

It is based on the MPEG-1 Layer-2 / MP2 algorithms, but since 1997 it
has rapidly developed and vastly improved and is now at an advanced
stage in which it contains heavily optimized and patentless code.

Musepack is not particularly optimized for low bitrates. The encoder
was designed to be transparent at the --standard setting, thus little
low bitrate tuning has gone into the codec, opposite to that of AAC,
Vorbis, WMA and others which focus more on this region.

%prep
%setup -q
%patch0
%patch1

%build
autoreconf -fiv
%configure \
  --disable-static \
  --with-pic
make %{?_smp_mflags}

%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}
#empty dependency_libs
find %{buildroot} -type f -name "*.la" -delete -print

%post -n libmpcdec5 -p /sbin/ldconfig

%postun -n libmpcdec5 -p /sbin/ldconfig

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

%files devel
%defattr (-, root, root)
%doc AUTHORS COPYING ChangeLog README
%{_libdir}/*.so
%dir %{_includedir}/mpcdec
%{_includedir}/mpcdec/*.h

%changelog
* Fri Jul 17 2015 mpluskal@suse.com
- Add baselibs.conf as source
* Tue Jul 14 2015 mpluskal@suse.com
- Update source url
- Explicitly depend on autoconf/automake
- Cleanup spec file with spec-clener
* Sat Dec 29 2012 crrodriguez@opensuse.org
- libmpcdec-byteswap.patch, use OS byteswap routines.
  (that in turns needs AC_USE_SYSTEM_EXTENSIONS)
  - build with large file support.
* Thu Apr 14 2011 toddrme2178@gmail.com
- added 32bit compatibility libraries
- package no longer obsoletes itself (fix for RPMLINT warning)
* Wed Mar 17 2010 aj@suse.de
- Add gcc-c++ as build requires to fix build.
* Tue Mar 16 2010 ro@suse.de
- disable autoreconf to fix build
* Wed Aug 15 2007 crrodriguez@suse.de
- fixes build on ia-64 only useless and unpackaged sample
  requires g++ for build (libmpcdec-1.2.6-nosamples.patch)
* Mon Aug 13 2007 crrodriguez@suse.de
- remove static libraries
- remove libtool archive with empty dependency_libs
- add missing glibc-devel dependency on -devel package
* Sun Jul 29 2007 ro@suse.de
- provide old name
* Wed Jul 25 2007 sbrabec@suse.cz
- Updated to version 1.2.6:
  * Fix possible noise at the beginning of files
  * Increase API version
  * Fix broken stream initialization on non-mpc files
  * Added fast-seeking
  * Reduced memory usage and code size
- Name package according to shared library packaging policy.
* Wed Jun 28 2006 sbrabec@suse.cz
- New SuSE package, version 1.2.2.