Name: youtube-dl Version: 2021.01.24.1 Release: 1%{?dist} Summary: A small command-line program to download online videos License: Unlicense URL: https://yt-dl.org Source0: https://youtube-dl.org/downloads/latest/youtube-dl-%{version}.tar.gz Source3: %{name}.conf BuildRequires: python3-devel BuildArch: noarch %description Small command-line program to download videos from YouTube and other sites. %prep %setup -qn %{name} # remove pre-built file rm youtube-dl cp -a setup.py setup.py.installpath # Remove files that are installed to the wrong path sed -i '/youtube-dl.bash-completion/d' setup.py sed -i '/youtube-dl.fish/d' setup.py sed -i '/README.txt/d' setup.py # Remove interpreter shebang from module files. find youtube_dl -type f -exec sed -i -e '1{/^\#!\/usr\/bin\/env python$/d;};' {} + %build %{__python3} setup.py build %install %{__python3} setup.py install --optimize 2 --root %{buildroot} mkdir -p %{buildroot}%{_sysconfdir} install -pm644 %{S:3} %{buildroot}%{_sysconfdir} mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d/ install -pm644 youtube-dl.bash-completion %{buildroot}%{_sysconfdir}/bash_completion.d/youtube-dl mkdir -p %{buildroot}%{_datadir}/zsh/site-functions/ install -pm644 youtube-dl.zsh %{buildroot}%{_datadir}/zsh/site-functions/_youtube-dl %files %doc README.md %{python3_sitelib}/youtube_dl/ %{python3_sitelib}/youtube_dl*.egg-info %license LICENSE %{_bindir}/%{name} %{_mandir}/man1/%{name}.1* %config(noreplace) %{_sysconfdir}/%{name}.conf %{_sysconfdir}/bash_completion.d/%{name} %{_datadir}/zsh/site-functions/_youtube-dl %changelog