yt-dlp/youtube-dl.spec
2020-06-04 22:42:37 +03:00

67 lines
1.7 KiB
RPMSpec

%define pypi_name youtube_dl
Summary: Small command-line program to download videos from YouTube
Name: youtube-dl
Version: 2020.05.29
Release: 1
License: Public Domain and GPLv2+
Group: Video
Url: https://yt-dl.org
Source0: https://github.com/rg3/youtube-dl/releases/download/%{version}/%{name}-%{version}.tar.gz
BuildRequires: ffmpeg
BuildRequires: gnupg2
BuildRequires: pkgconfig(python3)
BuildRequires: python3egg(setuptools)
BuildRequires: zip
BuildArch: noarch
Requires: python3
Recommends: ffmpeg
%description
Small command-line program to download videos from YouTube and similar sites.
%files
%doc LICENSE README.txt
%{_bindir}/%{name}
%{_datadir}/zsh/site-functions/_%{name}
%{_mandir}/man1/%{name}.1*
%config(noreplace) %{_sysconfdir}/bash_completion.d/%{name}
%config(noreplace) %{_sysconfdir}/fish/completions/%{name}.fish
#-----------------------------------------------------------------------------
%package -n python3-%{name}
Summary: Python 3 bindings for %{name}
Group: Development/Python
BuildArch: noarch
%description -n python3-%{name}
This package contains the Python 3 bindings for %{name}.
%files -n python3-%{name}
%doc LICENSE README.txt
%{py3_puresitedir}/%{pypi_name}
%{py3_puresitedir}/%{pypi_name}-*-py%{py3_ver}.egg-info
#-----------------------------------------------------------------------------
%prep
%setup -qn %{name}
rm youtube-dl
%build
%py3_build
%install
%py3_install
%makeinstall \
DESTDIR=%{buildroot} \
PREFIX=%{_prefix} \
MANDIR=%{_mandir}
# force the youtube-dl binary to use python 3 environment by default
sed -i -e 's,#!/usr/bin/env python,#!/usr/bin/env python3,' %{buildroot}%{_bindir}/%{name}
rm -rf %{buildroot}%{_prefix}/etc
rm -f %{buildroot}%{_datadir}/doc/youtube_dl/README.txt