%define pypi_name youtube_dl Summary: Small command-line program to download videos from YouTube Name: youtube-dl Version: 2019.03.09 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(python) BuildRequires: pkgconfig(python3) BuildRequires: python3egg(setuptools) BuildRequires: pythonegg(nose) BuildRequires: pythonegg(setuptools) BuildRequires: zip BuildArch: noarch Requires: python3 Suggests: ffmpeg %description Small command-line program to download videos from YouTube and similar sites. %files %doc LICENSE README.txt %{_bindir}/%{name} %{_mandir}/man1/%{name}.1* %{_datadir}/zsh/site-functions/_%{name} %config(noreplace) %{_sysconfdir}/bash_completion.d/%{name} %config(noreplace) %{_sysconfdir}/fish/completions/%{name}.fish #----------------------------------------------------------------------------- %package -n python-%{name} Summary: Python 2 bindings for %{name} Group: Development/Python BuildArch: noarch %description -n python-%{name} This package contains the Python 2 bindings for %{name}. %files -n python-%{name} %doc LICENSE README.txt %{py_puresitedir}/%{pypi_name} %{py_puresitedir}/%{pypi_name}-*-py%{py_ver}.egg-info #----------------------------------------------------------------------------- %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 cp -a . %{py3dir} %build %py_build pushd %{py3dir} %py3_build popd %install %py_install pushd %{py3dir} %py3_install popd %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