]> git.pld-linux.org Git - packages/python-pafy.git/blame - python-pafy.spec
require python package with youtube-dl
[packages/python-pafy.git] / python-pafy.spec
CommitLineData
59b2b248
ER
1#
2# Conditional build:
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
7
8%define module pafy
9%define egg_name pafy
10%define pypi_name pafy
11Summary: Retrieve YouTube content and metadata
12Name: python-%{pypi_name}
69f071dc
JP
13Version: 0.5.4
14Release: 1
59b2b248
ER
15License: LGPLv3
16Group: Libraries/Python
17Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
69f071dc 18# Source0-md5: 092930504c7e4fcea30b7446fa1878c7
59b2b248
ER
19URL: http://np1.github.io/pafy/
20BuildRequires: rpm-pythonprov
21BuildRequires: rpmbuild(macros) >= 1.714
22%if %{with python2}
23BuildRequires: python-modules
24BuildRequires: python-setuptools
25%endif
26%if %{with python3}
27BuildRequires: python3-modules
28BuildRequires: python3-setuptools
29%endif
30Requires: python-modules
e1a0d8e9 31Requires: python-youtube-dl
59b2b248
ER
32BuildArch: noarch
33BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35%description
36Features:
37
38- Retreive metadata such as viewcount, duration, rating, author,
39 thumbnail, keywords
40- Download video or audio at requested resolution / bitrate / format /
41 filesize
42- Command line tool (ytdl) for downloading directly from the command
43 line
44- Retrieve the URL to stream the video in a player such as vlc or
45 mplayer
46- Works with age-restricted videos and non-embeddable videos
47- Small, standalone, single importable module file (pafy.py)
48- Select highest quality stream for download or streaming
49- Download video only (no audio) in m4v or webm format
50- Download audio only (no video) in ogg or m4a format
51- Retreive playlists and playlist metadata
52- Works with Python 2.6+ and 3.3+
53- Optionally depends on youtube-dl (recommended; more stable)
54
55%description -l pl.UTF-8
56
57%package -n python3-%{module}
58Summary: -
59Summary(pl.UTF-8): -
60Group: Libraries/Python
61Requires: python3-modules
e1a0d8e9 62Requires: python3-youtube-dl
59b2b248
ER
63
64%description -n python3-%{module}
65
66%description -n python3-%{module} -l pl.UTF-8
67
68%package apidocs
69Summary: %{module} API documentation
70Summary(pl.UTF-8): Dokumentacja API %{module}
71Group: Documentation
72
73%description apidocs
74API documentation for %{module}.
75
76%description apidocs -l pl.UTF-8
77Dokumentacja API %{module}.
78
79%prep
80%setup -q -n %{pypi_name}-%{version}
81
82rm -r %{egg_name}.egg-info
83
84%build
85%if %{with python2}
86%py_build %{?with_tests:test}
87%endif
88
89%if %{with python3}
90%py3_build %{?with_tests:test}
91%endif
92
93%if %{with doc}
94cd docs
95%{__make} -j1 html
96rm -rf _build/html/_sources
97%endif
98
99%install
100rm -rf $RPM_BUILD_ROOT
101%if %{with python2}
102%py_install
103%py_postclean
104
105mv $RPM_BUILD_ROOT%{_bindir}/ytdl{,2}
106%endif
107
108%if %{with python3}
109%py3_install
110mv $RPM_BUILD_ROOT%{_bindir}/ytdl{,3}
111%endif
112
113%clean
114rm -rf $RPM_BUILD_ROOT
115
116%if %{with python2}
117%files
118%defattr(644,root,root,755)
119%doc README.rst
120%attr(755,root,root) %{_bindir}/ytdl2
121%{py_sitescriptdir}/%{module}
122%{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
123%endif
124
125%if %{with python3}
126%files -n python3-%{module}
127%defattr(644,root,root,755)
128%doc README.rst
129%attr(755,root,root) %{_bindir}/ytdl3
130%{py3_sitescriptdir}/%{module}
131%{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
132%endif
133
134%if %{with doc}
135%files apidocs
136%defattr(644,root,root,755)
137%doc docs/_build/html/*
138%endif
This page took 0.050016 seconds and 4 git commands to generate.