# # spec file for package python-yt-dlp # # Copyright (c) 2025 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 skip_python311 1 %define skip_python312 1 # './yt-dlp/yt_dlp/version.py' will report as YYYY.0[1-9].0[1-9] # but end up stripping out leading 0s ... %define ytdlp_version 2025.12.8 %define default_name python-yt_dlp %define short_name yt_dlp %define original_name yt-dlp Name: python-yt_dlp Version: 2025.12.08+git20251208.aa220d0aa Release: 0 Summary: A youtube-dl fork with additional features and patches License: Unlicense URL: https://github.com/yt-dlp/yt-dlp Source0: yt-dlp-%{version}.tar.gz Patch0: YoutubeDL-collections-space.diff BuildRequires: pandoc-cli BuildRequires: python-rpm-macros BuildRequires: %{python_module hatchling} BuildRequires: %{python_module mutagen} BuildRequires: %{python_module pip} BuildRequires: %{python_module pycryptodomex} BuildRequires: %{python_module PyInstaller} BuildRequires: %{python_module websockets} BuildRequires: fdupes BuildRequires: zip Requires: python-Brotli Requires: python-certifi Requires: python-mutagen Requires: python-pycryptodomex Requires: python-requests Requires: python-urllib3 Requires: python-websockets Requires(post): update-alternatives Requires(postun): update-alternatives Recommends: %{default_name}-shell-completion Recommends: %{default_name}-manpage BuildArch: noarch %python_subpackages %description A youtube-dl fork with additional features and patches %package -n %{name}-shell-completion Summary: Bash/Fish/Zsh completion for %{name} #Requires: python3dist(yt-dlp) = %%{ytdlp_version} Requires: python3-yt_dlp Supplements: (%{name} and (bash or fish or zsh)) BuildArch: noarch %description -n %{name}-shell-completion Provides required files for tab completion when using yt-dlp for Bash/Fish/Zsh. %package -n %{name}-manpage Summary: Manpage for %{name} #Requires: python3dist(yt-dlp) = %%{ytdlp_version} Requires: python3-yt_dlp BuildArch: noarch %description -n %{name}-manpage Provides the manpage for yt-dlp. %prep %setup -q -n yt-dlp-%{version} %patch -P 0 find . -type f -exec sed -i 's@#!%{_bindir}/env python3$@#!%{_bindir}/python3@' {} + %build %pyproject_wheel %make_build yt-dlp mkdir -p completions/bash python3 devscripts/bash-completion.py mkdir -p completions/fish python3 devscripts/fish-completion.py mkdir -p completions/zsh python3 devscripts/zsh-completion.py python3 devscripts/prepare_manpage.py yt-dlp.1.temp.md pandoc -s -f markdown-smart -t man yt-dlp.1.temp.md -o yt-dlp.1 gzip yt-dlp.1 %install %pyproject_install %python_clone -a %{buildroot}%{_bindir}/yt-dlp mkdir -vp %{buildroot}%{_datadir}/bash-completion/completions mkdir -vp %{buildroot}%{_datadir}/fish/vendor_completions.d mkdir -vp %{buildroot}%{_datadir}/zsh/site-functions mkdir -vp %{buildroot}%{_mandir}/man1 cp -v %{_builddir}/%{original_name}-%{version}/completions/bash/yt-dlp %{buildroot}%{_datadir}/bash-completion/completions/ cp -v %{_builddir}/%{original_name}-%{version}/completions/fish/yt-dlp.fish %{buildroot}%{_datadir}/fish/vendor_completions.d/ cp -v %{_builddir}/%{original_name}-%{version}/completions/zsh/_yt-dlp %{buildroot}%{_datadir}/zsh/site-functions/ cp -v %{_builddir}/%{original_name}-%{version}/yt-dlp.1.gz %{buildroot}%{_mandir}/man1/%{original_name}.1.gz ### Remove shebang from files which won't be directly executed. %python_expand sed -i '1d' %{buildroot}%{$python_sitelib}/yt_dlp/__main__.py ##### %python_expand %fdupes %{buildroot}%{$python_sitelib} %post %python_install_alternative yt-dlp %postun %python_uninstall_alternative yt-dlp %files %{python_files} %doc Changelog.md README.md %license LICENSE %python_alternative %{_bindir}/yt-dlp %{python_sitelib}/%{short_name} %{python_sitelib}/%{short_name}-%{ytdlp_version}*-info %files -n %{name}-shell-completion %dir %{_datadir}/bash-completion/completions/ %{_datadir}/bash-completion/completions/%{original_name} %dir %{_datadir}/fish %dir %{_datadir}/fish/vendor_completions.d %{_datadir}/fish/vendor_completions.d/%{original_name}.fish %dir %{_datadir}/zsh %dir %{_datadir}/zsh/site-functions %{_datadir}/zsh/site-functions/_%{original_name} %files -n %{name}-manpage %{_mandir}/man1/yt-dlp.1.gz %changelog