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