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-%{**}}
%define python 313
%define python_ver 3.13

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:  python%python-devel
BuildRequires:  python%python-setuptools
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildRequires:  update-desktop-files
Requires:       python%python-feedparser
Requires:       python%python-matplotlib
Requires:       python%python-matplotlib-gtk3
Requires:       python%python-playsound
Requires:       python%python-gobject
Requires:       python%python-contextvars
Requires:       python%python-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/python%python_ver"
$PYTHON setup.py build

%install
export PYTHON="%_bindir/python%python_ver"
$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/python%python_ver/site-packages/
%{_datadir}/%{name}
%{_datadir}/pixmaps/%{name}.png
%{_mandir}/man1/%{name}.1%{?ext_man}
%{_datadir}/applications/%{name}.desktop
%dir %{_datadir}/locale/ko_KR
%dir %{_datadir}/locale/ko_KR/LC_MESSAGES
%dir %{_datadir}/locale/nl_NL
%dir %{_datadir}/locale/nl_NL/LC_MESSAGES
%dir %{_datadir}/locale/zh_Hant
%dir %{_datadir}/locale/zh_Hant/LC_MESSAGES
%{_datadir}/locale/*/LC_MESSAGES/*

%changelog
openSUSE Build Service is sponsored by