yt-dlp/yt-dlp.spec
2024-01-28 20:44:11 +00:00

94 lines
2.5 KiB
RPMSpec

# gi-find-deps.sh is very slow but is not needed here, it may be installed locally
%define __typelib_path %{nil}
Summary: Small command-line program to download videos and audio from different websites
Name: yt-dlp
Version: 2023.12.30
Release: 1
License: Public Domain and GPLv2+
Group: Video
URL: https://github.com/yt-dlp/yt-dlp
# pure source from Github requires at least pandoc which is not packaged
Source0: https://github.com/yt-dlp/yt-dlp/releases/download/%{version}/yt-dlp.tar.gz?/yt-dlp-%{version}.tar.gz
Source100: yt-dlp.1
BuildRequires: ffmpeg
BuildRequires: gnupg2
BuildRequires: python38-devel
BuildRequires: python38-setuptools
BuildRequires: python38-brotlicffi
BuildRequires: python38-urllib3 >= 1.26.17
BuildRequires: zip
Requires: python38-%{name} = %{EVRD}
Recommends: ffmpeg
# youtube-dl is not developed anymore, it is a fork of it
Obsoletes: youtube-dl < 2021.10.10
Provides: youtube-dl = %{EVRD}
BuildArch: noarch
%description
Small command-line program to download videos and audio from
different websites.
Fork of youtube-dl.
%files
%doc README.* LICENSE
%{_bindir}/%{name}
%{_bindir}/youtube-dl
%{_datadir}/zsh/site-functions/_%{name}
%{_mandir}/man1/%{name}.1*
%{_datadir}/bash-completion/completions/%{name}
%{_datadir}/fish/vendor_completions.d/%{name}.fish
#-----------------------------------------------------------------------------
%package -n python38-%{name}
Summary: Python 3 bindings for %{name}
Group: Development/Python
BuildArch: noarch
%description -n python38-%{name}
This package contains the Python 3 bindings for %{name}
(fork of youtube-dl)
%files -n python38-%{name}
%doc README.* LICENSE
%{python38_sitelib}/yt_dlp
%{python38_sitelib}/yt_dlp-*-py%{py38_ver}.egg-info
#-----------------------------------------------------------------------------
%prep
%setup -qn %{name}
%build
# include completions
make completion-bash completion-zsh completion-fish
%py38_build
%install
%py38_install
# force the binary to use python 3 environment by default
sed -i -e 's,#!/usr/bin/env python,#!%{__python3},' %{buildroot}%{_bindir}/%{name}
# installed as %%doc into standard location
rm -fvr %{buildroot}%{_datadir}/doc
# compat symlink (e.g. mpv can use youtube-dl, but it is not developed anymore)
( cd %{buildroot}%{_bindir} && ln -s %{name} youtube-dl )
# fix permits
pushd %{buildroot}%{_bindir}
chmod a+rx yt-dlp youtube-dl
popd
# external man since we don't have pandoc
install -m644 %{SOURCE100} %{buildroot}%{_mandir}/man1/