mirror of
https://abf.rosa.ru/djam/yt-dlp.git
synced 2025-02-23 15:22:53 +00:00
Use py3 by default, build python buindings
This commit is contained in:
parent
2ecb676499
commit
1ff8e84a6f
1 changed files with 56 additions and 3 deletions
|
@ -1,7 +1,9 @@
|
|||
%define pypi_name youtube_dl
|
||||
|
||||
Summary: Small command-line program to download videos from YouTube
|
||||
Name: youtube-dl
|
||||
Version: 2018.06.04
|
||||
Release: 1
|
||||
Release: 2
|
||||
License: Public Domain and GPLv2+
|
||||
Group: Video
|
||||
Url: https://yt-dl.org
|
||||
|
@ -12,8 +14,11 @@ BuildRequires: ffmpeg
|
|||
BuildRequires: gnupg2
|
||||
BuildRequires: pythonegg(nose)
|
||||
BuildRequires: pythonegg(setuptools)
|
||||
BuildRequires: pkgconfig(python2)
|
||||
BuildRequires: pkgconfig(python3)
|
||||
BuildRequires: python3egg(setuptools)
|
||||
BuildArch: noarch
|
||||
Requires: python
|
||||
Requires: python3
|
||||
Suggests: ffmpeg
|
||||
|
||||
%description
|
||||
|
@ -29,14 +34,62 @@ Small command-line program to download videos from YouTube and similar sites.
|
|||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
%package -n python2-%{name}
|
||||
Summary: Python 2 bindings for %{name}
|
||||
Group: Development/Python
|
||||
BuildArch: noarch
|
||||
Provides: python-%{name}
|
||||
|
||||
%description -n python2-%{name}
|
||||
This is the Python 2 bindings for %{name}.
|
||||
|
||||
%files -n python2-%{name}
|
||||
%{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 is the Python 3 bindings for %{name}.
|
||||
|
||||
%files -n python3-%{name}
|
||||
%{py3_puresitedir}/%{pypi_name}
|
||||
%{py3_puresitedir}/%{pypi_name}-*-py%{py3_ver}.egg-info
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
%prep
|
||||
%setup -qn %{name}
|
||||
rm youtube-dl
|
||||
|
||||
cp -a . %{py3dir}
|
||||
|
||||
%build
|
||||
%make
|
||||
%py2_build
|
||||
|
||||
pushd %{py3dir}
|
||||
%py3_build
|
||||
popd
|
||||
|
||||
%install
|
||||
%py2_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
|
||||
|
|
Loading…
Add table
Reference in a new issue