File fdk-aac.spec of Package fdk-aac

#
# spec file for package fdk-aac (with DAB+ patches from the Opendigitalradio project)
#
# Copyright (c) 2017, Martin Hauke <mardnh@gmx.de>
#
# 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 sover 2
Name:           fdk-aac
Version:        2.0.2~+2~git20210824.573e93e
Release:        0
Summary:        A patched version of fdk-aac with DAB+ support
License:        FDK License
Group:          System/Libraries
Url:            https://github.com/Opendigitalradio/fdk-aac
#Git-Clone:     https://github.com/Opendigitalradio/fdk-aac.git
Source0:        %{name}-%{version}.tar.xz
Source1:        baselibs.conf
BuildRequires:  gcc-c++
BuildRequires:  libtool
BuildRequires:  pkgconfig
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
A patched version of the standalone library of the Fraunhofer FDK AAC code.
https://github.com/Opendigitalradio/fdk-aac


%package -n libfdk-aac%{sover}
Summary:        A patched version of fdk-aac with DAB+ support
Group:          System/Libraries

%description -n libfdk-aac%{sover}
A patched version of the standalone library of the Fraunhofer FDK AAC code.
https://github.com/Opendigitalradio/fdk-aac


%package -n libfdk-aac-devel
Summary:        Development headers for Fraunhofer FDK AAC (with DAB+ patches)
Group:          Development/Libraries/C and C++
Requires:       libfdk-aac%{sover} = %{version}

%description -n libfdk-aac-devel
This package provides development headers for Fraunhofer FDK AAC code
With DAB+ patches from the Opendigitalradio project.

%prep
%setup -q
FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y')
sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/g" lib*/src/{*.cpp,*version*}
FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M:%%S')
sed -i "s/__TIME__/\"$FAKE_BUILDTIME\"/g" lib*/src/{*.cpp,*version*}

%build
NOCONFIGURE=1 ./autogen.sh
_CFLAGS='%{optflags} %{?gcc_lto}'
_CXXFLAGS='%{optflags} %{?gcc_lto} %{?cxx11abi}'
_LDFLAGS='-Wl,--as-needed -Wl,--strip-all %{?gcc_lto}'
%configure \
 --disable-static \
 \
 --enable-example \
 CFLAGS="$_CFLAGS" \
 CXXFLAGS="$_CXXFLAGS" \
 LDFLAGS="$_LDFLAGS"
%{__make} %{?_smp_mflags}

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

%post -n libfdk-aac%{sover}  -p /sbin/ldconfig
%postun -n libfdk-aac%{sover} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%{_bindir}/aac-enc

%files -n libfdk-aac%{sover}
%defattr(-,root,root)
%doc ChangeLog NOTICE
%{_libdir}/libfdk-aac.so.*

%files -n libfdk-aac-devel
%defattr(-,root,root)
%doc NOTICE OWNERS
%doc documentation/*
%{_includedir}/fdk-aac
%{_libdir}/libfdk-aac.so
%{_libdir}/pkgconfig/fdk-aac.pc

%changelog
openSUSE Build Service is sponsored by