File tartube.spec of Package tartube

#
# spec file for package tartube
#
# Copyright (c) 2022 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/
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}

Name:           tartube
Version:        2.5.x
Release:        0
Summary:        The Easy Way To Watch And Download Videos
License:        GPL-3.0-or-later
URL:            https://github.com/axcore/tartube
Source:         %{name}-%{version}.tar.xz
BuildRequires:  python312-devel
BuildRequires:  python312-setuptools
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildRequires:  update-desktop-files
Requires:       python312-feedparser
Requires:       python312-matplotlib
Requires:       python312-matplotlib-gtk3
Requires:       python312-playsound
Requires:       python312-gobject
Requires:       python312-contextvars
Requires:       python312-requests
Requires:       yt-dlp
BuildArch:      noarch

%description
Tartube is a GUI front-end for youtube-dl, yt-dlp and other compatible video downloaders.
It is written in Python 3 / Gtk 3 and runs on MS Windows, Linux, BSD and MacOS.

%prep
%autosetup -p1

%build
export TARTUBE_PKG=1
export TARTUBE_PKG_STRICT=1
export PYTHON="%_bindir/python3.12"
$PYTHON setup.py build

%install
export PYTHON="%_bindir/python3.12"
$PYTHON setup.py install --prefix=%{_prefix} --root=%{buildroot}
mkdir -p %{buildroot}%{_datadir}/%{name}/
mkdir -p %{buildroot}%{_mandir}/man1
mkdir -p %{buildroot}%{_datadir}/pixmaps
mkdir -p  %{buildroot}%{_datadir}/applications
mv %{buildroot}/tartube %{buildroot}%{_datadir}/
install -m 0644 pack/tartube.1 %{buildroot}%{_mandir}/man1
install -m 0644 pack/tartube.png %{buildroot}%{_datadir}/pixmaps
%suse_update_desktop_file -c %{name} %{name} %{name} %{name} %{name} "AudioVideo;AudioVideoEditing;"
%fdupes %{buildroot}%{_prefix}

%files
%doc AUTHORS CHANGES README.rst
%license LICENSE icons/COPYING
%{_bindir}/%{name}
/usr/lib/python3.1*/site-packages/
%{_datadir}/%{name}
%{_datadir}/pixmaps/%{name}.png
%{_mandir}/man1/%{name}.1%{?ext_man}
%{_datadir}/applications/%{name}.desktop

%changelog
openSUSE Build Service is sponsored by