File yt-dlp.spec of Package yt-dlp

#
# spec file for package yt-dlp
#
# Copyright (c) 2021 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/
#
Name:           yt-dlp
Version:        2025.x.x
Release:        0
Summary:        A youtube-dl fork based on the now inactive youtube-dlc
License:        Unlicense
Group:          Productivity/Networking/Web/Utilities
URL:            https://github.com/yt-dlp/yt-dlp
Source:         %{name}-%{version}.tar.xz
BuildRequires:  make >= 4
BuildRequires:  python313-devel
BuildRequires:  zip
BuildRequires:  xz
BuildRequires:  git
Requires:       ffmpeg-7
Requires:       python313
Suggests:       python313-Brotli
Suggests:       python313-brotlicffi
Suggests:       python313-certifi
Suggests:       python313-mutagen
Suggests:       python313-pycryptodomex
Suggests:       python313-websockets
BuildArch:      noarch
Obsoletes:      youtube-dl youtube-dlp     

%description
yt-dlp is a youtube-dl fork based on the now inactive youtube-dlc.
The main focus of this project is adding new features and patches while also keeping up to date with the original project.

%package -n yt-dlp-bash-completion
Summary:        Bash completion for yt-dlp
Group:          System/Shells
Requires:       bash-completion
Supplements:    packageand(yt-dlp:bash)
Obsoletes:      youtube-dl-bash-completion <= 2021.06.06

%description -n yt-dlp-bash-completion
Bash command line completion support for yt-dlp.

%package -n yt-dlp-fish-completion
Summary:        Fish completion for yt-dlp
Group:          System/Shells
Requires:       fish
Supplements:    packageand(yt-dlp:fish)
Obsoletes:      youtube-dl-fish-completion <= 2021.06.06

%description -n yt-dlp-fish-completion
Fish command line completion support for yt-dlp.

%package -n yt-dlp-zsh-completion
Summary:        Zsh Completion for yt-dlp
Group:          System/Shells
Requires:       zsh
Supplements:    packageand(yt-dlp:zsh)

%description -n yt-dlp-zsh-completion
ZSH command line completion support for yt-dlp.

%prep
%autosetup -n %{name}-%{version}

%build
rm -f youtube-dl yt-dlp
PYTHON="%_bindir/python3.13" \
%make_build yt-dlp completions

%install
install -d -m 0755 %buildroot/%_bindir
install -m 0755 yt-dlp %buildroot/%_bindir/
ln -sv yt-dlp %buildroot/%_bindir/youtube-dl
install -d -m 0755 %buildroot/%_datadir/bash-completion/completions/
install -m 0644 completions/bash/yt-dlp %buildroot/%_datadir/bash-completion/completions/
install -d -m 0755 %buildroot/%_datadir/zsh/site-functions/
install -m 0644 completions/zsh/_yt-dlp %buildroot/%_datadir/zsh/site-functions/
install -d -m 0755 %buildroot/%_datadir/fish/completions/
install -m 0644 completions/fish/yt-dlp.fish %buildroot/%_datadir/fish/completions/

%files
%license LICENSE
%doc README.md supportedsites.md .github/ISSUE_TEMPLATE/*.yml
%_bindir/yt-dlp
%_bindir/youtube-dl

%files -n yt-dlp-bash-completion
%_datadir/bash-completion/

%files -n yt-dlp-fish-completion
%_datadir/fish/

%files -n yt-dlp-zsh-completion
%_datadir/zsh/

%changelog
openSUSE Build Service is sponsored by