#
# spec file for package twolame
#
# Copyright (c) 2019 SUSE LLC
# Copyright (c) 2006-2008 oc2pus
#
# 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/
#


%define sonum   0
Name:           twolame
Version:        0.4.0
Release:        1.5
Summary:        An optimised MPEG Audio Layer 2 (MP2) encoder
License:        LGPL-2.1-only
URL:            http://www.twolame.org/
Source0:        %{name}-%{version}.tar.gz
Source1:        baselibs.conf
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(sndfile) >= 1.0.0

%description
TwoLAME is an optimised MPEG Audio Layer 2 (MP2) encoder based on
tooLAME by Mike Cheng, which in turn is based upon the ISO dist10
code and portions of LAME. TwoLAME includes libtwolame, a fully
thread-safe shared library with an API very similar to LAME's.

%package -n lib%{name}%{sonum}
Summary:        Shared libraries for TwoLame

%description -n lib%{name}%{sonum}
TwoLAME is an optimised MPEG Audio Layer 2 (MP2) encoder based on
tooLAME by Mike Cheng, which in turn is based upon the ISO dist10
code and portions of LAME. TwoLAME includes libtwolame, a fully
thread-safe shared library with an API very similar to LAME's.

This package contains the shared libraries for TwoLame.

%package -n lib%{name}-devel
Summary:        Include Files and Libraries mandatory for Development
Requires:       lib%{name}%{sonum} = %{version}
Provides:       %{name}-devel = 0.3.10
Obsoletes:      %{name}-devel < 0.3.10

%description -n lib%{name}-devel
This package contains all necessary include files and libraries needed
to develop applications that require these.

%prep
%setup -q

%build
%configure --disable-static
make %{?_smp_mflags}

%install
%make_install

install -dm 755 %{buildroot}%{_docdir}
mv %{buildroot}%{_datadir}/doc/%{name} \
    %{buildroot}%{_docdir}/lib%{name}-devel
rm %{buildroot}%{_docdir}/lib%{name}-devel/COPYING

find %{buildroot} -type f -name "*.la" -delete -print

%post   -n lib%{name}%{sonum} -p /sbin/ldconfig
%postun -n lib%{name}%{sonum} -p /sbin/ldconfig

%files
%license COPYING
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1%{?ext_man}

%files -n lib%{name}%{sonum}
%{_libdir}/lib%{name}.so.%{sonum}*
%{_libdir}/lib%{name}.so.%{sonum}

%files -n lib%{name}-devel
%doc ChangeLog
%doc %{_docdir}/lib%{name}-devel
%{_includedir}/*
%{_libdir}/lib%{name}.so
%{_libdir}/pkgconfig/%{name}.pc

%changelog
* Mon Oct 28 2019 tiwai@suse.de
- Drop sourceforge download URL that doesn't work any longer...
* Sat Oct 26 2019 Luigi Baldoni <aloisio@gmx.com>
- Update to version 0.4.0
  * Added free format encoding (now up to 450 kbps)
  * Added DAB utility methods for ScF-CRC handling
  * Added `twolame_get_original()` and `twolame_set_original()`
  * Added `twolame_get_extension()` and `twolame_set_extension()`
  * Bundled .spec file in tarball for building RPM for twolame
  * Make libsndfile dependency (and therefore the frontend)
    optional
  * Fixed VBR encoding
  * Fixed setting for error protection flag
  * New check for invalid bitrate/channel encoder settings
  * New checks against failed memory allocations
  * Fixed padding policy (now adding an empty slot)
  * Fixed build when maintainer mode is disabled
  * Fixed scaling of floating point input source through
    libsndfile
  * Removed `slotinfo` global variables to fix thread safety bug
  * Switched to handling reading from STDIN using libsndfile
  * Fix for potential buffer overrun relating to `MAX_NAME_SIZE`
    in CLI tool
  * Install AUTHORS, COPYING, README, NEWS in
    `$prefix/share/doc/twolame/`
  * Zero the whole of the data structure when calling
    `twolame_init()`
  * Prefixed all global symbols with `twolame_` to prevent
    symbol conflicts
  * Fix for `twolame_get_framelength()` returning the correct
    frame size when padding is enabled
  * Fix progress counter in twolame CLI
  * Fix compilation on mingw or mxe cross compiler
  * Fix symbols visibility on Windows
  * Add `-no-undefined` for compilation on Windows
  * Added `win32-dll` option to `LT_INIT`
  * Compiler and Valgrind warning fixes
  * Various other minor fixes
- Spec cleanup
* Thu May 25 2017 zaitor@opensuse.org
- Tweak spec to align more with openSUSE standards.
- Export fno-strict-aliasing to CFLAGS, quiet a gcc warning.
- Drop flac-devel BuildRequires, not needed.
- Replace libsndfile-devel with pkgconfig(sndfile) BuildRequires
  and version it, following what configure looks for.
* Mon Mar 12 2012 toddrme2178@gmail.com
- Update to 3.13
- Cleaned up spec file formatting
- Changed license to LGPL-2.1 (see COPYING file)
- Added 32bit compatibility package (needed by
  gstreamer-0_10-plugins-ugly-orig-addon-32bit)
* Wed Jan  9 2008 toni@links2linux.de
- update to 3.12
- changed package layout according Shared Library Packaging Policy
* Wed Mar 21 2007 toni@links2linux.de
- update to 3.10
* Sun Dec 31 2006 toni@links2linux.de
- update to 3.9
* Sun Sep 17 2006 toni@links2linux.de
- build for packman
* Sat Jul 29 2006 oc2pus@arcor.de
- initial release 0.3.8