yt-dlp/yt-dlp.spec

93 lines
2.4 KiB
RPMSpec
Raw Normal View History

2021-10-16 10:55:29 +03:00
# 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
2024-01-15 13:11:39 +00:00
Version: 2023.12.30
2023-07-08 00:52:52 +03:00
Release: 1
2021-10-16 10:55:29 +03:00
License: Public Domain and GPLv2+
Group: Video
2024-01-21 23:46:30 +00:00
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
2021-10-16 10:55:29 +03:00
BuildRequires: ffmpeg
BuildRequires: gnupg2
2024-01-21 23:46:30 +00:00
BuildRequires: python38-devel
BuildRequires: python38-setuptools
2021-10-16 10:55:29 +03:00
BuildRequires: zip
2021-10-16 21:07:26 +03:00
Requires: python3-%{name} = %{EVRD}
2021-10-16 10:55:29 +03:00
Recommends: ffmpeg
2021-10-16 10:55:29 +03:00
# youtube-dl is not developed anymore, it is a fork of it
Obsoletes: youtube-dl < 2021.10.10
2021-10-16 10:55:29 +03:00
Provides: youtube-dl = %{EVRD}
BuildArch: noarch
2021-10-16 10:55:29 +03:00
%description
2024-01-21 23:46:30 +00:00
Small command-line program to download videos and audio from
different websites.
2021-10-16 10:55:29 +03:00
Fork of youtube-dl.
%files
2024-01-21 23:46:30 +00:00
%doc README.* LICENSE
2021-10-16 10:55:29 +03:00
%{_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
#-----------------------------------------------------------------------------
2024-01-21 23:46:30 +00:00
%package -n python38-%{name}
2021-10-16 10:55:29 +03:00
Summary: Python 3 bindings for %{name}
Group: Development/Python
BuildArch: noarch
2024-01-21 23:46:30 +00:00
%description -n python38-%{name}
This package contains the Python 3 bindings for %{name}
(fork of youtube-dl)
2021-10-16 10:55:29 +03:00
2024-01-21 23:46:30 +00:00
%files -n python38-%{name}
%doc README.* LICENSE
%{python38_sitelib}/yt_dlp
%{python38_sitelib}/yt_dlp-*-py%{py38_ver}.egg-info
2021-10-16 10:55:29 +03:00
#-----------------------------------------------------------------------------
%prep
2024-01-21 23:46:30 +00:00
%setup -qn %{name}
2021-10-16 10:55:29 +03:00
%build
# include completions
make completion-bash completion-zsh completion-fish
2024-01-21 23:46:30 +00:00
%py38_build
2021-10-16 10:55:29 +03:00
%install
2024-01-21 23:46:30 +00:00
%py38_install
2021-10-16 10:55:29 +03:00
# 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
2023-07-08 00:52:52 +03:00
rm -fvr %{buildroot}%{_datadir}/doc
2021-10-16 10:55:29 +03:00
# 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/