X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=youtube-dl.spec;h=331a161060fec87df3d131080cf904ce2281611c;hb=0a672f70533a52dad82acf9363be5f5c514cfabf;hp=450ff759cd443f53d36bf504f7559bf5b906d352;hpb=25f6fe35901b1f11d46334b0c31024241f7424b5;p=packages%2Fyoutube-dl.git diff --git a/youtube-dl.spec b/youtube-dl.spec index 450ff75..331a161 100644 --- a/youtube-dl.spec +++ b/youtube-dl.spec @@ -1,5 +1,9 @@ +# +# Conditional build: +%bcond_without python3 # CPython 3.x module + # full version number as seen on youtube-dl website -%define verlong 2015.11.02 +%define verlong 2020.06.16.1 # transform version so we don't have to bump epoch after four digit upgrades: # 2013.01.17.1 becomes 20130117_1 @@ -16,19 +20,28 @@ Epoch: 2 License: Public Domain Group: Applications/System Source0: http://youtube-dl.org/downloads/%{verlong}/%{name}-%{verlong}.tar.gz -# Source0-md5: 7e81ffcda74b99810cbfc739d0dd4137 +# Source0-md5: 12f8062a38286a9f06fa3c1a0a6b56cb 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/ +BuildRequires: python-modules >= 1:2.6 BuildRequires: python-setuptools +%if %{with python3} +BuildRequires: python3-modules >= 1:3.2 +BuildRequires: python3-setuptools +%endif BuildRequires: rpm-pythonprov -BuildRequires: rpmbuild(macros) >= 1.219 -Requires: python-pyxattr >= 0.5.0 +BuildRequires: rpmbuild(macros) >= 1.720 +Requires: python-setuptools +Requires: python-%{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 - %description youtube-dl is a small command-line program to download videos from YouTube.com. @@ -62,31 +75,74 @@ 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 +Group: Applications/Shells +Requires: %{name} = %{epoch}:%{version}-%{release} +Requires: zsh + +%description -n zsh-completion-%{name} +Zsh completion for youtube-dl command. + +%description -n zsh-completion-%{name} -l pl.UTF-8 +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 -%{__python} setup.py build +%py_build + +%if %{with python3} +%py3_build +%endif %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT%{_bindir} -%{__python} setup.py install \ - --skip-build \ - --optimize=2 \ - --root=$RPM_BUILD_ROOT +%if %{with python3} +%py3_install +%endif + +%py_install %py_postclean install -d $RPM_BUILD_ROOT%{_sysconfdir} cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir} -install -d $RPM_BUILD_ROOT{%{bash_compdir},%{fish_compdir}} +install -d $RPM_BUILD_ROOT{%{bash_compdir},%{fish_compdir},%{zsh_compdir}} %{__mv} $RPM_BUILD_ROOT%{_prefix}/etc/bash_completion.d/youtube-dl.bash-completion \ $RPM_BUILD_ROOT%{bash_compdir}/%{name} %{__mv} $RPM_BUILD_ROOT%{_prefix}/etc/fish/completions/youtube-dl.fish \ $RPM_BUILD_ROOT%{fish_compdir}/%{name}.fish +cp -p youtube-dl.zsh $RPM_BUILD_ROOT%{zsh_compdir}/_youtube-dl %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/youtube_dl %clean @@ -98,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) @@ -108,3 +162,19 @@ rm -rf $RPM_BUILD_ROOT %files -n fish-completion-%{name} %defattr(644,root,root,755) %{fish_compdir}/%{name}.fish + +%files -n python-%{name} +%defattr(644,root,root,755) +%{py_sitescriptdir}/youtube_dl +%{py_sitescriptdir}/youtube_dl-*-py*.egg-info + +%if %{with python3} +%files -n python3-%{name} +%defattr(644,root,root,755) +%{py3_sitescriptdir}/youtube_dl +%{py3_sitescriptdir}/youtube_dl-*-py*.egg-info +%endif + +%files -n zsh-completion-%{name} +%defattr(644,root,root,755) +%{zsh_compdir}/_youtube-dl