]> git.pld-linux.org Git - packages/python-mimeparse.git/blob - python-mimeparse.spec
dda59b8b283adf4f0f7f3611f9b94de71b65b387
[packages/python-mimeparse.git] / python-mimeparse.spec
1 #
2 # Conditional build:
3 %bcond_without  python3 # Python3
4
5 %define         module mimeparse
6 Summary:        Python module for parsing mime-type names
7 Name:           python-%{module}
8 Version:        0.1.3
9 Release:        2
10 License:        MIT
11 Group:          Libraries/Python
12 URL:            https://mimeparse.googlecode.com/
13 Source0:        https://mimeparse.googlecode.com/files/%{module}-%{version}.tar.gz
14 # Source0-md5:  03ce207391454db37279e78ce2112365
15 BuildRequires:  python-devel
16 %{?with_python3:BuildRequires:  python3-devel}
17 BuildRequires:  rpm-pythonprov
18 BuildRequires:  rpmbuild(macros) >= 1.219
19 BuildArch:      noarch
20 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21
22 %description
23 This module provides basic functions for parsing mime-type names and
24 matching them against a list of media-ranges.
25
26 %package -n python3-%{module}
27 Summary:        Python module for parsing mime-type names
28 Group:          Libraries/Python
29
30 %description -n python3-%{module}
31 This module provides basic functions for parsing mime-type names and
32 matching them against a list of media-ranges.
33
34 %prep
35 %setup -q -n %{module}-%{version}
36
37 %build
38 %{__python} setup.py build --build-base py2
39
40 %if %{with python3}
41 %{__python3} setup.py build --build-base py3
42 %endif
43
44 %if %{with tests}
45 %{__python} mimeparse_test.py
46
47 %if %{with python3}
48 cd py3
49 %{__python3} mimeparse_test.py
50 %endif
51 %endif
52
53 %install
54 rm -rf $RPM_BUILD_ROOT
55 %{__python} setup.py build \
56         --build-base py2 \
57         install \
58         --optimize=2 \
59         --root=$RPM_BUILD_ROOT
60
61 %py_postclean
62
63 %if %{with python3}
64 %{__python3} setup.py build \
65         --build-base py3 \
66         install \
67         --optimize=2 \
68         --root=$RPM_BUILD_ROOT
69 %endif
70
71 %clean
72 rm -rf $RPM_BUILD_ROOT
73
74 %files
75 %defattr(644,root,root,755)
76 %doc README
77 %{py_sitescriptdir}/mimeparse.py[co]
78 %{py_sitescriptdir}/mimeparse-%{version}-py*.egg-info
79
80 %if %{with python3}
81 %files -n python3-%{module}
82 %defattr(644,root,root,755)
83 %doc README
84 %{py3_sitescriptdir}/__pycache__/mimeparse.*.py[co]
85 %{py3_sitescriptdir}/mimeparse-%{version}-py*.egg-info
86 %{py3_sitescriptdir}/mimeparse.py
87 %endif
This page took 0.06066 seconds and 2 git commands to generate.