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