File python-yt-dlp.spec of Package python-yt-dlp

#
# spec file for package python-wled
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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/


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define         skip_python2 1
%define         skip_python36 1
%define         skip_python38 1
Name:           python-yt-dlp
Version:        2025.12.08
%define sourceversion 2025.12.8
Release:        0
License:        SUSE-Public-Domain AND CC-BY-SA-3.0
Summary:        media downloader and library for various sites.
Group:          Development/Languages/Python
Url:            https://github.com/yt-dlp/yt-dlp
Source:         https://files.pythonhosted.org/packages/source/y/yt-dlp/yt_dlp-%{sourceversion}.tar.gz
BuildRequires:  %{python_module hatchling}
BuildRequires:  %{python_module poetry-core}
BuildRequires:  %{python_module wheel}
BuildRequires:  %{python_module pip}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
Requires:       python-mutagen
Requires:       python-pycryptodomex
Requires:       python-websockets
#Requires:       python-brotli
#Requires:       python-brotlicffi
Requires:       python-certifi
Requires(post): update-alternatives
Requires(postun):update-alternatives


BuildArch:      noarch
%python_subpackages

%description
media downloader and library for various sites.

yt-dlp is a youtube-dl fork based on the now inactive youtube-dlc.

%prep
%setup -q -n yt_dlp-%{sourceversion}
sed -i -e 's,^dynamic = .*,version = "%version",' pyproject.toml

%build
%pyproject_wheel
               
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
rm -rf %{buildroot}/usr/share/bash-completion
rm -rf %{buildroot}/usr/share/doc
rm -rf %{buildroot}/usr/share/fish
rm -rf %{buildroot}/usr/share/zsh
%python_clone -a %{buildroot}%{_bindir}/yt-dlp

%post
%python_install_alternative yt-dlp

%postun
%python_uninstall_alternative yt-dlp

%files %{python_files}
%license LICENSE
%doc README.md
%python_alternative %{_bindir}/yt-dlp
%{python_sitelib}/*
%python312_only %_mandir/man?/yt-dlp.*

%changelog
openSUSE Build Service is sponsored by