]>
Commit | Line | Data |
---|---|---|
4cbbd4d5 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without doc # don't build doc | |
4 | %bcond_without tests # do not perform "make test" | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | %define module svgwrite | |
9 | %define egg_name svgwrite | |
10 | %define pypi_name svgwrite | |
11 | Summary: Python 2 library to create SVG drawings | |
12 | Name: python-%{pypi_name} | |
fce7743c | 13 | Version: 1.3.1 |
36a44a97 | 14 | Release: 2 |
4cbbd4d5 ER |
15 | License: MIT |
16 | Group: Libraries/Python | |
fce7743c JR |
17 | Source0: https://github.com/mozman/svgwrite/archive/v%{version}/%{module}-%{version}.tar.gz |
18 | # Source0-md5: a3d9311578538ba5acd6bb98d14cae38 | |
19 | URL: https://github.com/mozman/svgwrite | |
4cbbd4d5 ER |
20 | BuildRequires: rpm-pythonprov |
21 | BuildRequires: rpmbuild(macros) >= 1.714 | |
22 | BuildArch: noarch | |
23 | %if %{with python2} | |
24 | BuildRequires: python-modules | |
25 | BuildRequires: python-pyparsing | |
26 | BuildRequires: python-setuptools | |
27 | %endif | |
28 | %if %{with python3} | |
29 | BuildRequires: python3-modules | |
30 | BuildRequires: python3-pyparsing | |
31 | BuildRequires: python3-setuptools | |
32 | BuildRequires: python3-setuptools | |
33 | %endif | |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | %description | |
37 | Python 2 library to create SVG drawings. | |
38 | ||
39 | %package -n python3-%{pypi_name} | |
40 | Summary: Python 3 library to create SVG drawings | |
41 | Requires: python3-pyparsing | |
42 | Requires: python3-setuptools | |
43 | ||
44 | %description -n python3-%{pypi_name} | |
45 | Python 3 library to create SVG drawings. | |
46 | ||
47 | %prep | |
48 | %setup -q -n %{pypi_name}-%{version} | |
49 | ||
fce7743c JR |
50 | # test is hosed and fails on the order of attr in a tag |
51 | %{__rm} tests/test_pretty_xml.py | |
36a44a97 JR |
52 | # needs network access |
53 | %{__rm} tests/test_style.py | |
fce7743c | 54 | |
4cbbd4d5 ER |
55 | %build |
56 | %py3_build | |
57 | %py_build | |
58 | ||
59 | %if %{with tests} | |
60 | %{__python3} -m unittest discover -s tests | |
61 | %{__python} -m unittest discover -s tests | |
62 | %endif | |
63 | ||
64 | %install | |
65 | rm -rf $RPM_BUILD_ROOT | |
66 | %py3_install | |
67 | %py_install | |
68 | ||
69 | %clean | |
70 | rm -rf $RPM_BUILD_ROOT | |
71 | ||
72 | %if %{with python2} | |
73 | %files | |
74 | %defattr(644,root,root,755) | |
75 | %doc NEWS.rst README.rst LICENSE.TXT | |
76 | %{py_sitescriptdir}/%{module} | |
77 | %{py_sitescriptdir}/%{egg_name}-%{version}-py%{py_ver}.egg-info | |
78 | %endif | |
79 | ||
80 | %if %{with python3} | |
81 | %files -n python3-%{pypi_name} | |
82 | %defattr(644,root,root,755) | |
83 | %doc NEWS.rst README.rst LICENSE.TXT | |
84 | %{py3_sitescriptdir}/%{module} | |
85 | %{py3_sitescriptdir}/%{pypi_name}-%{version}-py%{py3_ver}.egg-info | |
86 | %endif |