#
# spec file for package speex
#
# 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/
#


%define upstream_version 1.2.0
%define libname libspeex1
Name:           speex
Version:        1.2
Release:        1.6
Summary:        An Open Source, Patent Free Speech Codec
License:        BSD-3-Clause
Group:          System/Libraries
Url:            http://www.speex.org/
Source0:        http://downloads.xiph.org/releases/speex/%{name}-%{upstream_version}.tar.gz
Source1:        baselibs.conf
Patch0:         speex-no-build-date.patch
BuildRequires:  pkg-config
BuildRequires:  pkgconfig(ogg)
BuildRequires:  pkgconfig(speexdsp)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Speex is a patent free audio codec designed especially for voice
(unlike Vorbis which targets general audio) signals and providing good
narrowband and wideband quality. This project aims to be complementary
to the Vorbis codec.

%package -n %{libname}
Summary:        An Open Source, Patent Free Speech Codec Library
Group:          System/Libraries
Obsoletes:      libspeex < %{version}
Provides:       libspeex = %{version}

%description -n %{libname}
Speex is a patent free audio codec designed especially for voice
(unlike Vorbis which targets general audio) signals and providing good
narrowband and wideband quality. This project aims to be complementary
to the Vorbis codec.

%package devel
Summary:        Development package for SpeeX
Group:          Development/Libraries/C and C++
Requires:       %{libname} = %{version}
Requires:       speexdsp-devel
Provides:       libspeex-devel = %{version}-%{release}
Obsoletes:      libspeex-devel < %{version}-%{release}

%description devel
This package contains the files needed to compile programs that use the
SpeeX library.

%prep
%setup -q -n %{name}-%{upstream_version}
%patch0 

%build
%configure \
	--enable-binaries \
	--disable-static 

make %{?_smp_mflags}

%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}
# remove duped documents
rm -rf %{buildroot}%{_datadir}/doc/speex*
# remove unneeded *.la files
find %{buildroot} -type f -name "*.la" -delete -print
rm -f %{buildroot}%{_libdir}/*.a

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

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

%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README TODO
%{_bindir}/speex*
%{_mandir}/man?/*

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

%files devel
%defattr(-,root,root)
%doc doc/manual.pdf
%{_includedir}/*
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*.pc
%{_datadir}/aclocal/*.m4

%changelog
* Sun Feb 19 2017 tom.mbrt@googlemail.com
- Update to stable 1.2 release
* Sat Aug 22 2015 bwiedemann@suse.com
- make speex-devel require speexdsp-devel to be backward compatible
* Wed Mar 11 2015 jengelh@inai.de
- Use the tilde versioning scheme; we are no longer bound to use
  the old hacks.
* Sat Feb 28 2015 tchvatal@suse.com
- Move libname up and set it just once, easier for later on.
* Mon Feb 23 2015 mpluskal@suse.com
- Split package to two separate packages
  * speexdsp contains libraries
  * speex contains tools
- Update to 1.2rc2
  * This release splits the speex codec library and the speex DSP
    library into separate source trees. Both projects received
    build-system improvements, bugfixes, and cleanup. The speex
    codec's VBR tuning was improved, while the speexdsp resampler
    got some NEON optimizations.
- Remove obsolete patch
  * speex-1.0.5-warning-fix.diff
* Fri Apr  5 2013 idonmez@suse.com
- Add Source URL, see https://en.opensuse.org/SourceUrls
* Thu Nov 24 2011 coolo@suse.com
- add libtool as buildrequire to avoid implicit dependency
* Fri Sep  3 2010 cristian.rodriguez@opensuse.org
- Do not include build date in binaries...
* Fri Jun 25 2010 dmueller@suse.de
- obsolete old -XXbit packages
* Thu Jan 14 2010 chris@computersalat.de
- fix build for SLE_10
  autoreconf for suse_version >= 1100
- spec
  o sort TAGS
  o macros
    rm > {__rm}
    version > {version} ....
* Thu Jan  7 2010 lnussel@suse.de
- split off libspeex1 and libspeexdsp1 according to library
  packaging policy
- include actual tarball version in package version
- don't package README's for embedded cpus
* Fri Dec 18 2009 jengelh@medozas.de
- add baselibs.conf as a source
- enable parallel building
* Wed Jan  7 2009 olh@suse.de
- obsolete old -XXbit packages (bnc#437293)
* Wed Aug  6 2008 tiwai@suse.de
- updated to version 1.2rc1:
  * support for acoustic echo cancellation with multiple mics
    and speakers.
  * add an API to decorrelate loudspeaker signals
  * fixes for a few bugs in the echo canceller, jitter buffer and
    preprocessor
* Thu Apr 10 2008 ro@suse.de
- added baselibs.conf file to build xxbit packages
  for multilib support
* Fri Jan 11 2008 tiwai@suse.de
- updated to version 1.2beta3:
  * all the non-codec components (preprocessor, echo cancellation,
    jitter buffer) have been moved to a new libspeexdsp library
  * a new jitter buffer algorithm
  * resampler improvements/fixes
  * libspeex can be built without any floating point support
* Tue Aug 14 2007 tiwai@suse.de
- fix the bug in resampler code (signed/unsigned mismatch)
- move man pages to the main package
- a bit clean up of spec file
* Thu May 24 2007 tiwai@suse.de
- updated to version 1.2beta2:
  * reduced RAM requirement
  * A new resampler module
  * improved / fixed echo canceller
  * improved preprocessor
  * early TriMedia support (incomplete)
- removed static library and *.la files
* Tue Apr 10 2007 tiwai@suse.de
- split shared library to libspeex sub package.
* Thu Oct 12 2006 tiwai@suse.de
- updated to version 1.2beta1:
  * Improvement of encoder/decoder quality
  * Enhander improvements (now on by default)
  * Input/output high-pass filters
  * Fixing minor regressions in previous 1.1.x releases
  * Reduced memory usage
  * Reduced CPU usage
* Wed Aug  9 2006 sbrabec@suse.cz
- Updated to version 1.1.12:
  * echo canceller converted to fixed-point
  * Improvements to the experimental Vorbis-based masking model
  * several bug fixes
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Tue Oct  4 2005 tiwai@suse.de
- fix the type-punning.
- add check of return value from fread().
* Tue Jun 14 2005 tiwai@suse.de
- updated to version 1.0.5.
* Thu Sep 16 2004 tiwai@suse.de
- fixed speex.m4 for the recent autoconf.
* Thu Aug  5 2004 tiwai@suse.de
- updated to version 1.0.4.
* Mon Jan 12 2004 adrian@suse.de
- add %%defattr
* Fri Jan  9 2004 tiwai@suse.de
- updated to version 1.0.3.
* Fri Jun  6 2003 tiwai@suse.de
- updated to version 1.0.1.
* Mon Jun  2 2003 ro@suse.de
- remove unpackaged files from buildroot
* Thu Mar 27 2003 tiwai@suse.de
- updated to version 1.0 final.
* Thu Jan 30 2003 tiwai@suse.de
- updated to version 1.0rc2.
* Fri Jan 17 2003 tiwai@suse.de
- updated to version 1.0rc1.
* Wed Nov 27 2002 tiwai@suse.de
- initial version: 1.0beta3