X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=youtube-dl.spec;h=1981a4bd8f254a8f624461bda3d30d7775b9bc1e;hb=17e5e7409ce2900e4a0a8e8f7429dda66de532f9;hp=86bb6902d956e962ad57f05f73a9ba0a49982705;hpb=5be3fd30228bf6da44f68c3fc1a66b4c82241a4a;p=packages%2Fyoutube-dl.git diff --git a/youtube-dl.spec b/youtube-dl.spec index 86bb690..1981a4b 100644 --- a/youtube-dl.spec +++ b/youtube-dl.spec @@ -1,5 +1,9 @@ +# +# Conditional build: +%bcond_without python2 # CPython 2.x module + # full version number as seen on youtube-dl website -%define verlong 2016.08.13 +%define verlong 2021.02.22 # transform version so we don't have to bump epoch after four digit upgrades: # 2013.01.17.1 becomes 20130117_1 @@ -16,21 +20,28 @@ Epoch: 2 License: Public Domain Group: Applications/System Source0: http://youtube-dl.org/downloads/%{verlong}/%{name}-%{verlong}.tar.gz -# Source0-md5: cd50b7e3df1d63b86fae0b6fa5e05a2f +# Source0-md5: a9136b338055166a233a753e149095f6 Source1: %{name}.conf +# should be downloaded from: +# https://github.com/rg3/youtube-dl/pull/10291.diff +# but the author removed his repository, so the url is 404 +# git log -p --reverse pr/10291~3..pr/10291 +Patch0: 10291.diff URL: http://youtube-dl.org/ +%if %{with python2} +BuildRequires: python-modules >= 1:2.6 BuildRequires: python-setuptools +%endif +BuildRequires: python3-modules >= 1:3.2 +BuildRequires: python3-setuptools BuildRequires: rpm-pythonprov -BuildRequires: rpmbuild(macros) >= 1.713 -Requires: python-pyxattr >= 0.5.0 -Requires: python-setuptools +BuildRequires: rpmbuild(macros) >= 1.720 +Requires: python3-setuptools +Requires: python3-%{name} = %{epoch}:%{version}-%{release} +Suggests: ffmpeg BuildArch: noarch BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) -%define bash_compdir %{_datadir}/bash-completion/completions -%define fish_compdir %{_datadir}/fish/completions -%define zsh_compdir %{_datadir}/zsh/site-functions - %description youtube-dl is a small command-line program to download videos from YouTube.com. @@ -64,6 +75,30 @@ Fish completion for youtube-dl command. %description -n fish-completion-%{name} -l pl.UTF-8 Dopełnianie parametrów w fish dla polecenia youtube-dl. +%package -n python-%{name} +Summary: Python 2 video extraction utility for YouTube +Summary(pl.UTF-8): Narzędzie do wydobywania filmów z YouTube dla Pythona 2 +Group: Libraries/Python +Requires: python-pyxattr >= 0.5.0 + +%description -n python-%{name} +Python 2 video extraction utility for YouTube. + +%description -n python-%{name} -l pl.UTF-8 +Narzędzie do wydobywania filmów z YouTube dla Pythona 2. + +%package -n python3-%{name} +Summary: Python 3 video extraction utility for YouTube +Summary(pl.UTF-8): Narzędzie do wydobywania filmów z YouTube dla Pythona 3 +Group: Libraries/Python +Requires: python3-pyxattr >= 0.5.0 + +%description -n python3-%{name} +Python 3 video extraction utility for YouTube. + +%description -n python3-%{name} -l pl.UTF-8 +Narzędzie do wydobywania filmów z YouTube dla Pythona 3. + %package -n zsh-completion-%{name} Summary: Zsh completion for youtube-dl command Summary(pl.UTF-8): Dopełnianie parametrów w zsh dla polecenia youtube-dl @@ -79,15 +114,25 @@ Dopełnianie parametrów w zsh dla polecenia youtube-dl. %prep %setup -qc -mv %{name} .tmp; mv .tmp/* . +%{__mv} %{name} .tmp; %{__mv} .tmp/* . +%patch0 -p1 %build +%if %{with python2} %py_build +%endif + +%py3_build %install rm -rf $RPM_BUILD_ROOT + +%if %{with python2} %py_install %py_postclean +%endif + +%py3_install install -d $RPM_BUILD_ROOT%{_sysconfdir} cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir} @@ -109,8 +154,6 @@ rm -rf $RPM_BUILD_ROOT %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/youtube-dl.conf %attr(755,root,root) %{_bindir}/youtube-dl %{_mandir}/man1/youtube-dl.1* -%{py_sitescriptdir}/youtube_dl -%{py_sitescriptdir}/youtube_dl-*-py*.egg-info %files -n bash-completion-%{name} %defattr(644,root,root,755) @@ -120,6 +163,18 @@ rm -rf $RPM_BUILD_ROOT %defattr(644,root,root,755) %{fish_compdir}/%{name}.fish +%if %{with python2} +%files -n python-%{name} +%defattr(644,root,root,755) +%{py_sitescriptdir}/youtube_dl +%{py_sitescriptdir}/youtube_dl-*-py*.egg-info +%endif + +%files -n python3-%{name} +%defattr(644,root,root,755) +%{py3_sitescriptdir}/youtube_dl +%{py3_sitescriptdir}/youtube_dl-*-py*.egg-info + %files -n zsh-completion-%{name} %defattr(644,root,root,755) %{zsh_compdir}/_youtube-dl