]> git.pld-linux.org Git - packages/python-pafy.git/blob - python-pafy.spec
rebuild with python 3.10
[packages/python-pafy.git] / python-pafy.spec
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}
13 Version:        0.5.4
14 Release:        6
15 License:        LGPLv3
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
22 %if %{with python2}
23 BuildRequires:  python-modules
24 BuildRequires:  python-setuptools
25 BuildRequires:  python-youtube-dl
26 %endif
27 %if %{with python3}
28 BuildRequires:  python3-modules
29 BuildRequires:  python3-setuptools
30 BuildRequires:  python3-youtube-dl
31 %endif
32 Requires:       python-modules
33 Requires:       python-youtube-dl
34 BuildArch:      noarch
35 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37 %description
38 Features:
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}
60 Summary:        -
61 Summary(pl.UTF-8):      -
62 Group:          Libraries/Python
63 Requires:       python3-modules
64 Requires:       python3-youtube-dl
65
66 %description -n python3-%{module}
67
68 %description -n python3-%{module} -l pl.UTF-8
69
70 %package apidocs
71 Summary:        %{module} API documentation
72 Summary(pl.UTF-8):      Dokumentacja API %{module}
73 Group:          Documentation
74
75 %description apidocs
76 API documentation for %{module}.
77
78 %description apidocs -l pl.UTF-8
79 Dokumentacja API %{module}.
80
81 %prep
82 %setup -q -n %{pypi_name}-%{version}
83
84 rm -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}
96 cd docs
97 %{__make} -j1 html
98 rm -rf _build/html/_sources
99 %endif
100
101 %install
102 rm -rf $RPM_BUILD_ROOT
103 %if %{with python2}
104 %py_install
105 %py_postclean
106
107 mv $RPM_BUILD_ROOT%{_bindir}/ytdl{,2}
108 %endif
109
110 %if %{with python3}
111 %py3_install
112 mv $RPM_BUILD_ROOT%{_bindir}/ytdl{,3}
113 %endif
114
115 %clean
116 rm -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.079686 seconds and 3 git commands to generate.