File rnnoise.spec of Package rnnoise

#
# spec file for package rnnoise
#
# Copyright (c) 2020 SUSE LLC
#
# 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 libname librnnoise0

Name:           rnnoise
Version:        0.1
Release:        0
Summary:        Recurrent neural network for audio noise reduction
License:        BSD-3-Clause
URL:            https://github.com/xiph/rnnoise
Source:         %{name}-%{version}.tar.xz
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libtool
Requires:       python3-Keras

%description
RNNoise is a noise suppression library based on a recurrent neural network.

This package holds the training tools.

%package -n %{libname}
Summary:        Recurrent neural network for audio noise reduction - Shared library

%description -n %{libname}
RNNoise is a noise suppression library based on a recurrent neural network.

This package holds the shared library.

%package devel
Summary:        Recurrent neural network for audio noise reduction - Development Files
Requires:       %{libname} = %{version}

%description devel
RNNoise is a noise suppression library based on a recurrent neural network.

This package holds the development files.

%prep
%setup -q

%build
autoreconf -sfi
%configure
%make_build

perl -p -i -e 's|^#!%{_bindir}/python|#!%{_bindir}/python3|g' training/*.py

%install
%make_install
rm -rv \
  %{buildroot}%{_libdir}/librnnoise.*a \
  %{buildroot}%{_datadir}/doc/rnnoise/

install -m 0755 -D -d %{buildroot}%{_bindir}
install -m 0755 training/*.py %{buildroot}%{_bindir}

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

%files
%license COPYING
%doc AUTHORS README TRAINING-README
%{_bindir}/bin2hdf5.py
%{_bindir}/dump_rnn.py
%{_bindir}/rnn_train.py

%files -n %{libname}
%license COPYING
%{_libdir}/librnnoise.so.*

%files devel
%{_includedir}/rnnoise.h
%{_libdir}/librnnoise.so
%{_libdir}/pkgconfig/rnnoise.pc

%changelog
openSUSE Build Service is sponsored by