]>
Commit | Line | Data |
---|---|---|
78b2ed65 ER |
1 | # TODO |
2 | # - python2 requires pathlib | |
1a55f703 JB |
3 | # |
4 | # Conditional build: | |
5 | %bcond_without doc # Sphinx HTML documentation | |
6 | %bcond_with tests # unit tests | |
7 | %bcond_without python2 # CPython 2.x module | |
8 | %bcond_without python3 # CPython 3.x module | |
9 | ||
3f9d7a28 | 10 | %define module eyeD3 |
1a55f703 JB |
11 | Summary: Python 2 module for manipulating ID3 informational tags on MP3 audio files |
12 | Summary(pl.UTF-8): Moduł Pythona 2 służący do operacji na znacznikach ID3 plików MP3 | |
3f9d7a28 | 13 | Name: python-%{module} |
1a55f703 | 14 | Version: 0.8 |
1a2b5452 | 15 | Release: 4 |
1a55f703 | 16 | License: GPL v3 |
3f9d7a28 | 17 | Group: Development/Languages/Python |
18 | Source0: http://eyed3.nicfit.net/releases/%{module}-%{version}.tar.gz | |
1a55f703 | 19 | # Source0-md5: 840626686e6b1bc6afca9eab99a0873a |
78ce4653 | 20 | Patch0: %{name}-pyc.patch |
3f9d7a28 | 21 | URL: http://eyed3.nicfit.net/ |
1a55f703 JB |
22 | %if %{with tests} && %(locale -a | grep -q '^C\.UTF-8$'; echo $?) |
23 | BuildRequires: glibc-localedb-all | |
24 | %endif | |
25 | BuildRequires: rpmbuild(macros) >= 1.714 | |
26 | %if %{with python2} | |
27 | BuildRequires: python-devel >= 1:2.7 | |
28 | BuildRequires: python-modules >= 1:2.7 | |
29 | %if %{with tests} | |
30 | BuildRequires: python-factory-boy >= 2.8.1 | |
31 | BuildRequires: python-nose >= 1.3.7 | |
32 | BuildRequires: python-pytest >= 3.0.7 | |
33 | BuildRequires: python-pytest-cov >= 2.5.1 | |
34 | BuildRequires: python-pytest-runner >= 2.11.1 | |
35 | BuildRequires: python-six >= 1.10.0 | |
36 | %endif | |
37 | %endif | |
38 | %if %{with python2} | |
39 | BuildRequires: python3-devel >= 1:3.3 | |
40 | BuildRequires: python3-modules >= 1:3.3 | |
41 | %if %{with tests} | |
42 | BuildRequires: python3-factory-boy >= 2.8.1 | |
43 | BuildRequires: python3-nose >= 1.3.7 | |
44 | BuildRequires: python3-pytest >= 3.0.7 | |
45 | BuildRequires: python3-pytest-cov >= 2.5.1 | |
46 | BuildRequires: python3-pytest-runner >= 2.11.1 | |
47 | BuildRequires: python3-six >= 1.10.0 | |
48 | %endif | |
49 | %endif | |
97eb74ae | 50 | BuildRequires: rpm-pythonprov |
1a55f703 JB |
51 | %if %{with doc} |
52 | BuildRequires: python3-sphinx_issues | |
53 | BuildRequires: python3-sphinxcontrib-bitbucket | |
54 | BuildRequires: sphinx-pdg | |
55 | %endif | |
56 | Requires: python-modules >= 1:2.7 | |
57 | Requires: python-six >= 1.10.0 | |
3f9d7a28 | 58 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
59 | ||
60 | %description | |
61 | eyeD3 is a Python module and program for processing ID3 tags. | |
9707283f | 62 | Information about MP3 files (i.e bit rate, sample frequency, play |
3f9d7a28 | 63 | time, etc.) is also provided. The formats supported are ID3 v1.0/v1.1 |
64 | and v2.3/v2.4. | |
65 | ||
8c069304 JR |
66 | %description -l pl.UTF-8 |
67 | eyeD3 to moduł języka Python oraz wykorzystujący go program, | |
68 | przetwarzający znaczniki ID3. Dostarczana jest także informacja o | |
69 | samych plikach MP3 (długość, częstotliwość próbkowania itp.). | |
70 | Obsługiwane są znaczniki ID3 w wersjach v1.0/v1.1 i v2.3/v2.4. | |
3f9d7a28 | 71 | |
1a55f703 JB |
72 | %package -n python3-%{module} |
73 | Summary: Python 3 module for manipulating ID3 informational tags on MP3 audio files | |
74 | Summary(pl.UTF-8): Moduł Pythona 3 służący do operacji na znacznikach ID3 plików MP3 | |
75 | Group: Development/Languages/Python | |
45ab01a8 | 76 | Requires: python3-grako |
1a55f703 JB |
77 | Requires: python3-modules >= 1:3.3 |
78 | Requires: python3-six >= 1.10.0 | |
79 | ||
80 | %description -n python3-%{module} | |
81 | eyeD3 is a Python module and program for processing ID3 tags. | |
82 | Information about MP3 files (i.e bit rate, sample frequency, play | |
83 | time, etc.) is also provided. The formats supported are ID3 v1.0/v1.1 | |
84 | and v2.3/v2.4. | |
85 | ||
86 | %description -n python3-%{module} -l pl.UTF-8 | |
87 | eyeD3 to moduł języka Python oraz wykorzystujący go program, | |
88 | przetwarzający znaczniki ID3. Dostarczana jest także informacja o | |
89 | samych plikach MP3 (długość, częstotliwość próbkowania itp.). | |
90 | Obsługiwane są znaczniki ID3 w wersjach v1.0/v1.1 i v2.3/v2.4. | |
91 | ||
92 | %package apidocs | |
93 | Summary: API documentation for Python eyeD3 module | |
94 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona eyeD3 | |
95 | Group: Documentation | |
96 | ||
97 | %description apidocs | |
98 | API documentation for Python eyeD3 module. | |
99 | ||
100 | %description apidocs -l pl.UTF-8 | |
101 | Dokumentacja API modułu Pythona eyeD3. | |
102 | ||
3f9d7a28 | 103 | %prep |
104 | %setup -q -n %{module}-%{version} | |
78ce4653 | 105 | %patch0 -p1 |
3f9d7a28 | 106 | |
107 | %build | |
1a55f703 JB |
108 | export LC_ALL=C.UTF-8 |
109 | ||
110 | %if %{with python2} | |
111 | %py_build %{?with_tests:test} | |
112 | %endif | |
113 | ||
114 | %if %{with python3} | |
115 | %py3_build %{?with_tests:test} | |
116 | %endif | |
117 | ||
118 | %if %{with doc} | |
119 | %{__make} -C docs html \ | |
120 | PYTHONPATH=$(pwd)/src | |
121 | %endif | |
3f9d7a28 | 122 | |
123 | %install | |
124 | rm -rf $RPM_BUILD_ROOT | |
125 | ||
1a55f703 JB |
126 | export LC_ALL=C.UTF-8 |
127 | ||
128 | %if %{with python3} | |
129 | %py3_install | |
130 | ||
131 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/eyeD3{,-py3} | |
132 | %{!?with_python2:ln -sf eyeD3-py2 $RPM_BUILD_ROOT%{_bindir}/eyeD3} | |
133 | %endif | |
3f9d7a28 | 134 | |
1a55f703 | 135 | %if %{with python2} |
f296e624 | 136 | %py_install |
3f9d7a28 | 137 | |
1a55f703 JB |
138 | %py_postclean |
139 | ||
140 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/eyeD3{,-py2} | |
141 | ln -sf eyeD3-py2 $RPM_BUILD_ROOT%{_bindir}/eyeD3 | |
142 | %endif | |
143 | ||
144 | # missing from py install | |
145 | install -d $RPM_BUILD_ROOT%{_mandir}/man1 | |
146 | cp -p docs/eyeD3.1 $RPM_BUILD_ROOT%{_mandir}/man1 | |
3f9d7a28 | 147 | |
148 | %clean | |
149 | rm -rf $RPM_BUILD_ROOT | |
150 | ||
1a55f703 | 151 | %if %{with python2} |
3f9d7a28 | 152 | %files |
153 | %defattr(644,root,root,755) | |
1a55f703 JB |
154 | %doc AUTHORS.rst HISTORY.rst README.rst |
155 | %attr(755,root,root) %{_bindir}/eyeD3-py2 | |
156 | %attr(755,root,root) %{_bindir}/eyeD3 | |
157 | %{py_sitescriptdir}/eyed3 | |
158 | %{py_sitescriptdir}/eyeD3-%{version}-py*.egg-info | |
159 | %{_mandir}/man1/eyeD3.1* | |
160 | %endif | |
161 | ||
162 | %if %{with python3} | |
163 | %files -n python3-%{module} | |
164 | %defattr(644,root,root,755) | |
165 | %doc AUTHORS.rst HISTORY.rst README.rst | |
166 | %attr(755,root,root) %{_bindir}/eyeD3-py3 | |
167 | %{py3_sitescriptdir}/eyed3 | |
168 | %{py3_sitescriptdir}/eyeD3-%{version}-py*.egg-info | |
169 | %if %{without python2} | |
170 | %attr(755,root,root) %{_bindir}/eyeD3 | |
171 | %{_mandir}/man1/eyeD3.1* | |
172 | %endif | |
173 | %endif | |
174 | ||
175 | %if %{with doc} | |
176 | %files apidocs | |
177 | %defattr(644,root,root,755) | |
178 | %doc docs/_build/html/{_modules,_static,plugins,*.html,*.js} | |
179 | %endif |