]>
Commit | Line | Data |
---|---|---|
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 | |
11 | Summary: Retrieve YouTube content and metadata | |
12 | Name: python-%{pypi_name} | |
69f071dc JP |
13 | Version: 0.5.4 |
14 | Release: 1 | |
59b2b248 ER |
15 | License: LGPLv3 |
16 | Group: Libraries/Python | |
17 | Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz | |
69f071dc | 18 | # Source0-md5: 092930504c7e4fcea30b7446fa1878c7 |
59b2b248 ER |
19 | URL: http://np1.github.io/pafy/ |
20 | BuildRequires: rpm-pythonprov | |
21 | BuildRequires: rpmbuild(macros) >= 1.714 | |
22 | %if %{with python2} | |
23 | BuildRequires: python-modules | |
24 | BuildRequires: python-setuptools | |
25 | %endif | |
26 | %if %{with python3} | |
27 | BuildRequires: python3-modules | |
28 | BuildRequires: python3-setuptools | |
29 | %endif | |
30 | Requires: python-modules | |
e1a0d8e9 | 31 | Requires: python-youtube-dl |
59b2b248 ER |
32 | BuildArch: noarch |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | %description | |
36 | Features: | |
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} | |
58 | Summary: - | |
59 | Summary(pl.UTF-8): - | |
60 | Group: Libraries/Python | |
61 | Requires: python3-modules | |
e1a0d8e9 | 62 | Requires: 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 | |
69 | Summary: %{module} API documentation | |
70 | Summary(pl.UTF-8): Dokumentacja API %{module} | |
71 | Group: Documentation | |
72 | ||
73 | %description apidocs | |
74 | API documentation for %{module}. | |
75 | ||
76 | %description apidocs -l pl.UTF-8 | |
77 | Dokumentacja API %{module}. | |
78 | ||
79 | %prep | |
80 | %setup -q -n %{pypi_name}-%{version} | |
81 | ||
82 | rm -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} | |
94 | cd docs | |
95 | %{__make} -j1 html | |
96 | rm -rf _build/html/_sources | |
97 | %endif | |
98 | ||
99 | %install | |
100 | rm -rf $RPM_BUILD_ROOT | |
101 | %if %{with python2} | |
102 | %py_install | |
103 | %py_postclean | |
104 | ||
105 | mv $RPM_BUILD_ROOT%{_bindir}/ytdl{,2} | |
106 | %endif | |
107 | ||
108 | %if %{with python3} | |
109 | %py3_install | |
110 | mv $RPM_BUILD_ROOT%{_bindir}/ytdl{,3} | |
111 | %endif | |
112 | ||
113 | %clean | |
114 | rm -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 |