]> git.pld-linux.org Git - packages/python-pafy.git/blame - python-pafy.spec
rebuild with python 3.10
[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 13Version: 0.5.4
b08e5a82 14Release: 6
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
07686dbe 25BuildRequires: python-youtube-dl
59b2b248
ER
26%endif
27%if %{with python3}
28BuildRequires: python3-modules
29BuildRequires: python3-setuptools
07686dbe 30BuildRequires: python3-youtube-dl
59b2b248
ER
31%endif
32Requires: python-modules
e1a0d8e9 33Requires: python-youtube-dl
59b2b248
ER
34BuildArch: noarch
35BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37%description
38Features:
39
40- Retreive metadata such as viewcount, duration, rating, author,
41 thumbnail, keywords
42- Download video or audio at requested resolution / bitrate / format /
43 filesize
44- Command line tool (ytdl) for downloading directly from the command
45 line
46- Retrieve the URL to stream the video in a player such as vlc or
47 mplayer
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)
56
57%description -l pl.UTF-8
58
59%package -n python3-%{module}
60Summary: -
61Summary(pl.UTF-8): -
62Group: Libraries/Python
63Requires: python3-modules
e1a0d8e9 64Requires: python3-youtube-dl
59b2b248
ER
65
66%description -n python3-%{module}
67
68%description -n python3-%{module} -l pl.UTF-8
69
70%package apidocs
71Summary: %{module} API documentation
72Summary(pl.UTF-8): Dokumentacja API %{module}
73Group: Documentation
74
75%description apidocs
76API documentation for %{module}.
77
78%description apidocs -l pl.UTF-8
79Dokumentacja API %{module}.
80
81%prep
82%setup -q -n %{pypi_name}-%{version}
83
84rm -r %{egg_name}.egg-info
85
86%build
87%if %{with python2}
88%py_build %{?with_tests:test}
89%endif
90
91%if %{with python3}
92%py3_build %{?with_tests:test}
93%endif
94
95%if %{with doc}
96cd docs
97%{__make} -j1 html
98rm -rf _build/html/_sources
99%endif
100
101%install
102rm -rf $RPM_BUILD_ROOT
103%if %{with python2}
104%py_install
105%py_postclean
106
107mv $RPM_BUILD_ROOT%{_bindir}/ytdl{,2}
108%endif
109
110%if %{with python3}
111%py3_install
112mv $RPM_BUILD_ROOT%{_bindir}/ytdl{,3}
113%endif
114
115%clean
116rm -rf $RPM_BUILD_ROOT
117
118%if %{with python2}
119%files
120%defattr(644,root,root,755)
121%doc README.rst
122%attr(755,root,root) %{_bindir}/ytdl2
123%{py_sitescriptdir}/%{module}
124%{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
125%endif
126
127%if %{with python3}
128%files -n python3-%{module}
129%defattr(644,root,root,755)
130%doc README.rst
131%attr(755,root,root) %{_bindir}/ytdl3
132%{py3_sitescriptdir}/%{module}
133%{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
134%endif
135
136%if %{with doc}
137%files apidocs
138%defattr(644,root,root,755)
139%doc docs/_build/html/*
140%endif
This page took 0.070643 seconds and 4 git commands to generate.