3 %bcond_with doc # don't build doc
4 %bcond_with tests # do not perform "make test"
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
10 %define pypi_name pafy
11 Summary: Retrieve YouTube content and metadata
12 Name: python-%{pypi_name}
16 Group: Libraries/Python
17 Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
18 # Source0-md5: 092930504c7e4fcea30b7446fa1878c7
19 URL: http://np1.github.io/pafy/
20 BuildRequires: rpm-pythonprov
21 BuildRequires: rpmbuild(macros) >= 1.714
23 BuildRequires: python-modules
24 BuildRequires: python-setuptools
25 BuildRequires: python-youtube-dl
28 BuildRequires: python3-modules
29 BuildRequires: python3-setuptools
30 BuildRequires: python3-youtube-dl
32 Requires: python-modules
33 Requires: python-youtube-dl
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 - Retreive metadata such as viewcount, duration, rating, author,
42 - Download video or audio at requested resolution / bitrate / format /
44 - Command line tool (ytdl) for downloading directly from the command
46 - Retrieve the URL to stream the video in a player such as vlc or
48 - Works with age-restricted videos and non-embeddable videos
49 - Small, standalone, single importable module file (pafy.py)
50 - Select highest quality stream for download or streaming
51 - Download video only (no audio) in m4v or webm format
52 - Download audio only (no video) in ogg or m4a format
53 - Retreive playlists and playlist metadata
54 - Works with Python 2.6+ and 3.3+
55 - Optionally depends on youtube-dl (recommended; more stable)
57 %description -l pl.UTF-8
59 %package -n python3-%{module}
62 Group: Libraries/Python
63 Requires: python3-modules
64 Requires: python3-youtube-dl
66 %description -n python3-%{module}
68 %description -n python3-%{module} -l pl.UTF-8
71 Summary: %{module} API documentation
72 Summary(pl.UTF-8): Dokumentacja API %{module}
76 API documentation for %{module}.
78 %description apidocs -l pl.UTF-8
79 Dokumentacja API %{module}.
82 %setup -q -n %{pypi_name}-%{version}
84 rm -r %{egg_name}.egg-info
88 %py_build %{?with_tests:test}
92 %py3_build %{?with_tests:test}
98 rm -rf _build/html/_sources
102 rm -rf $RPM_BUILD_ROOT
107 mv $RPM_BUILD_ROOT%{_bindir}/ytdl{,2}
112 mv $RPM_BUILD_ROOT%{_bindir}/ytdl{,3}
116 rm -rf $RPM_BUILD_ROOT
120 %defattr(644,root,root,755)
122 %attr(755,root,root) %{_bindir}/ytdl2
123 %{py_sitescriptdir}/%{module}
124 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
128 %files -n python3-%{module}
129 %defattr(644,root,root,755)
131 %attr(755,root,root) %{_bindir}/ytdl3
132 %{py3_sitescriptdir}/%{module}
133 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
138 %defattr(644,root,root,755)
139 %doc docs/_build/html/*