%global  gituser  simon-r
%global  gitname  dr14_t.meter
%global  appname  dr14_tmeter
%global  debug_package  %{nil}

Name:    dr14tmeter
Version: 1.0.16
Release: 0.7%{?dist}

Summary: Compute the dynamic range DR14 value of the given audio files
Group:   Applications/Sound
License: GPL-3.0-only
#URL:     http://dr14tmeter.sourceforge.net  # original
URL:     https://github.com/%{gituser}/%{gitname}
Source:  %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Patch1:  dr14tmeter-setup-py-fix-man-install_and_url.patch

BuildRequires:  python%{python3_pkgversion}-devel
BuildRequires:  python%{python3_pkgversion}-setuptools

Requires:  python%{python3_pkgversion}-numpy

# mp3 decode:
Requires:  lame
# oggdec:
Requires:  vorbis-tools
# stty
Requires:  coreutils
#R#equires:  faad2  # does not seem to be used in code
#R#equires:  flac  # does not seem to be used in code

Recommends:  /usr/bin/ffmpeg
Recommends:  /usr/bin/ffprobe


%description
Compute the DR14 value of the given audio files according to the algorithm
described by the Pleasurize Music Foundation.


%package     plots
Summary:     Packages to allow dr14_tmeter to show various plots
#B#uildArch: noarch

Requires:    python3-matplotlib

%description plots
Ensures the plotting library is installed to allow graphing of audio parameters.


%prep
%autosetup  -v  -n %{gitname}-%{version}
rm  man/install.sh


%build
%py3_build


%install
%py3_install

install  -p  -m0644  -D man/dr14_tmeter.1 %{buildroot}%{_mandir}/man1/%{name}.1


%files
%license  gpl-3.0.txt
%doc      README.md
%{_bindir}/%{appname}
%{python3_sitelib}/%{name}/
%{python3_sitelib}/%{appname}-%{version}*.egg-info
%{_mandir}/man1/%{name}.1*


%files plots
# installing the -plots package triggers install of required matplotlib.


%changelog


* Tue Jan 09 2024 David Timms <fedoraproject.org@dtimms> - 1.0.16-0.7
- correct name of licence file to gpl-3.0.txt.

* Tue Jan 09 2024 David Timms <fedoraproject.org@dtimms> - 1.0.16-0.6
- use new style license value.

* Tue Jan 02 2024 David Timms <fedoraproject.org@dtimms> - 1.0.16-0.5
- change requires for ffmpeg to a suitable binary, rather than specific package.

* Mon Jan 01 2024 David Timms <fedoraproject.org@dtimms> - 1.0.16-0.4
- Initial package based on simon-r and Shaun Assam spec files.