diff --git a/sources b/sources index f8ddcdf..6a0997b 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (youtube-dl-2018.03.10.tar.gz) = eca882a1b39ae5e5a5b20462a2c4baf9717584463f5e4bfe12ddda85b495bd792cd85bd14d3e37fc512562d6b2c219d6c35a91bacfdc7751bf2e98e5b4e9442b -SHA512 (youtube-dl-2018.03.10.tar.gz.sig) = 8c6b9861a9623bf9756434634389f362979d817270cfbe5d0a3800290af982b34637f740e6030a2e97a96c2c49390caebe7a0429785aca3e792985250168c694 +SHA512 (youtube-dl-2018.03.26.1.tar.gz) = 1c183bfa86b7317f260bb077df41eb17d9d1ce4707a6473529ec6cfbd90d519a4621589d6b3db51ba7445348f3064204b31a2af31ef5128384d4b825dbfcfbf5 +SHA512 (youtube-dl-2018.03.26.1.tar.gz.sig) = 9b89b5ff5804c302df12b975ec8b798c76da9cbd97cec1c834509760ea9e283fbd2207bf3ff39788bcb32d0a6df6ce3261c123a265aee3f6075bc2e2ccd3e3e8 diff --git a/youtube-dl.spec b/youtube-dl.spec index 2e8dfdb..d777ed2 100644 --- a/youtube-dl.spec +++ b/youtube-dl.spec @@ -1,4 +1,10 @@ -%if 0%{?rhel} && 0%{?rhel} <= 6 +%if 0%{?rhel} && 0%{?rhel} < 7 +%bcond_with python3 +%else +%bcond_without python3 +%endif + +%if ! %{with python3} %{!?__python2: %global __python2 /usr/bin/python2} %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} @@ -6,7 +12,7 @@ %endif Name: youtube-dl -Version: 2018.03.10 +Version: 2018.03.26.1 Release: 1%{?dist} Summary: A small command-line program to download online videos License: Unlicense @@ -20,8 +26,8 @@ Source1: https://github.com/rg3/youtube-dl/releases/download/%{version}/y # "7D33 D762 FD6C 3513 0481 347F DB4B 54CB A482 6A18" > youtube-dl-gpgkeys.gpg Source2: youtube-dl-gpgkeys.gpg Source3: %{name}.conf -%if 0%{?fedora} -BuildRequires: python3-devel +%if %{with python3} +BuildRequires: python%{python3_pkgversion}-devel %else BuildRequires: python2-devel %endif @@ -53,7 +59,7 @@ sed -i '/README.txt/d' setup.py find youtube_dl -type f -exec sed -i -e '1{/^\#!\/usr\/bin\/env python$/d;};' {} + %build -%if 0%{?fedora} +%if %{with python3} %py3_build %else %py2_build @@ -61,7 +67,7 @@ find youtube_dl -type f -exec sed -i -e '1{/^\#!\/usr\/bin\/env python$/d;};' {} %install -%if 0%{?fedora} +%if %{with python3} %py3_install %else %py2_install @@ -69,7 +75,7 @@ find youtube_dl -type f -exec sed -i -e '1{/^\#!\/usr\/bin\/env python$/d;};' {} mkdir -p %{buildroot}%{_sysconfdir} install -pm644 %{S:3} %{buildroot}%{_sysconfdir} -%if 0%{?fedora} +%if %{with python3} mkdir -p %{buildroot}%{_datadir}/bash-completion/completions install -pm644 youtube-dl.bash-completion %{buildroot}%{_datadir}/bash-completion/completions/youtube-dl %else @@ -90,7 +96,7 @@ install -pm644 youtube-dl.zsh %{buildroot}%{_datadir}/zsh/site-functions/_youtub %files %doc README.md -%if 0%{?fedora} +%if %{with python3} %{python3_sitelib}/youtube_dl/ %{python3_sitelib}/youtube_dl*.egg-info %else @@ -101,7 +107,7 @@ install -pm644 youtube-dl.zsh %{buildroot}%{_datadir}/zsh/site-functions/_youtub %{_bindir}/%{name} %{_mandir}/man1/%{name}.1* %config(noreplace) %{_sysconfdir}/%{name}.conf -%if 0%{?fedora} +%if %{with python3} %{_datadir}/bash-completion/completions/%{name} %else %{_sysconfdir}/bash_completion.d/%{name} @@ -110,6 +116,9 @@ install -pm644 youtube-dl.zsh %{buildroot}%{_datadir}/zsh/site-functions/_youtub %changelog +* Mon Mar 26 2018 Matěj Cepl - 2018.03.26.1-1 +- Use Python 3 for EPEL-7. + * Wed Mar 14 2018 Matěj Cepl - 2018.03.10-1 - Update to the latest release.