]> git.pld-linux.org Git - packages/python-mimeparse.git/blame - python-mimeparse.spec
rebuild with python 3.10
[packages/python-mimeparse.git] / python-mimeparse.spec
CommitLineData
e02d5634
ER
1#
2# Conditional build:
d5b1a0b1
JB
3%bcond_without python2 # Python 2.x module
4%bcond_without python3 # Python 3.x module
373c09d6 5%bcond_without tests # tests run
e02d5634
ER
6
7%define module mimeparse
d5b1a0b1
JB
8Summary: Python 2.x module for parsing mime-type names
9Summary(pl.UTF-8): Moduł Pythona 2.x do analizy nazw typów MIME
e02d5634 10Name: python-%{module}
4cd6673c 11Version: 1.6.0
60c089ad 12Release: 5
e02d5634
ER
13License: MIT
14Group: Libraries/Python
bdd7b1a6 15#Source0Download: https://pypi.org/pypi/python-mimeparse/
4cd6673c
JB
16Source0: https://files.pythonhosted.org/packages/source/p/python-mimeparse/%{name}-%{version}.tar.gz
17# Source0-md5: a32ae1df93be1ddb581d1c0fa124bab4
18URL: https://github.com/dbtsai/python-mimeparse
19%if %{with python2}
20BuildRequires: python-devel >= 1:2.7
21BuildRequires: python-setuptools
22%endif
23%if %{with python3}
24BuildRequires: python3-devel >= 1:3.2
25BuildRequires: python3-setuptools
26%endif
e02d5634 27BuildRequires: rpm-pythonprov
373c09d6 28BuildRequires: rpmbuild(macros) >= 1.714
e02d5634
ER
29BuildArch: noarch
30BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32%description
33This module provides basic functions for parsing mime-type names and
34matching them against a list of media-ranges.
35
d5b1a0b1
JB
36%description -l pl.UTF-8
37Ten moduł udostępnia podstawowe funkcje do analizy nazw typów MIME
38oraz dopasowywania ich do listy zakresów mediów.
39
e02d5634 40%package -n python3-%{module}
d5b1a0b1
JB
41Summary: Python 3.x module for parsing mime-type names
42Summary(pl.UTF-8): Moduł Pythona 3.x do analizy nazw typów MIME
e02d5634
ER
43Group: Libraries/Python
44
45%description -n python3-%{module}
46This module provides basic functions for parsing mime-type names and
47matching them against a list of media-ranges.
48
d5b1a0b1
JB
49%description -n python3-%{module} -l pl.UTF-8
50Ten moduł udostępnia podstawowe funkcje do analizy nazw typów MIME
51oraz dopasowywania ich do listy zakresów mediów.
52
e02d5634 53%prep
d5b1a0b1 54%setup -q
e02d5634
ER
55
56%build
d5b1a0b1 57%if %{with python2}
373c09d6 58%py_build
e02d5634
ER
59
60%if %{with tests}
373c09d6
JB
61cd build-2
62ln -sf ../testdata.json .
63%{__python} ../mimeparse_test.py
d5b1a0b1
JB
64cd ..
65%endif
373c09d6 66%endif
e02d5634
ER
67
68%if %{with python3}
373c09d6
JB
69%py3_build
70
71%if %{with tests}
72cd build-3
73ln -sf ../testdata.json .
74%{__python3} ../mimeparse_test.py
d5b1a0b1 75cd ..
e02d5634
ER
76%endif
77%endif
78
79%install
80rm -rf $RPM_BUILD_ROOT
d5b1a0b1
JB
81
82%if %{with python2}
373c09d6 83%py_install
e02d5634
ER
84
85%py_postclean
d5b1a0b1 86%endif
e02d5634
ER
87
88%if %{with python3}
373c09d6 89%py3_install
e02d5634
ER
90%endif
91
92%clean
93rm -rf $RPM_BUILD_ROOT
94
d5b1a0b1 95%if %{with python2}
e02d5634
ER
96%files
97%defattr(644,root,root,755)
4cd6673c 98%doc LICENSE README.rst
e02d5634 99%{py_sitescriptdir}/mimeparse.py[co]
d5b1a0b1
JB
100%{py_sitescriptdir}/python_mimeparse-%{version}-py*.egg-info
101%endif
e02d5634
ER
102
103%if %{with python3}
104%files -n python3-%{module}
105%defattr(644,root,root,755)
4cd6673c 106%doc LICENSE README.rst
e02d5634 107%{py3_sitescriptdir}/mimeparse.py
d5b1a0b1
JB
108%{py3_sitescriptdir}/__pycache__/mimeparse.*.py[co]
109%{py3_sitescriptdir}/python_mimeparse-%{version}-py*.egg-info
e02d5634 110%endif
This page took 0.078371 seconds and 4 git commands to generate.