]> git.pld-linux.org Git - packages/python-pyclipper.git/blob - python-pyclipper.spec
rebuild with python 3.10
[packages/python-pyclipper.git] / python-pyclipper.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # unit tests
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
7 Summary:        Cython wrapper for Clipper library
8 Summary(pl.UTF-8):      Cythonowe obudowanie biblioteki Clipper
9 Name:           python-pyclipper
10 Version:        1.3.0.post2
11 Release:        2
12 License:        MIT
13 Group:          Libraries/Python
14 #Source0Download: https://pypi.org/simple/pyclipper/
15 Source0:        https://files.pythonhosted.org/packages/source/p/pyclipper/pyclipper-%{version}.tar.gz
16 # Source0-md5:  ac53748592d18d8c8b63b5bd65a2ab28
17 Patch0:         %{name}-tests.patch
18 URL:            https://pypi.org/project/pyclipper/
19 BuildRequires:  libstdc++-devel
20 %if %{with python2}
21 BuildRequires:  python-Cython >= 0.28
22 BuildRequires:  python-devel >= 1:2.7
23 BuildRequires:  python-setuptools
24 BuildRequires:  python-setuptools_scm >= 1.11.1
25 %if %{with tests}
26 BuildRequires:  python-pytest
27 %endif
28 %endif
29 %if %{with python3}
30 BuildRequires:  python3-Cython >= 0.28
31 BuildRequires:  python3-devel >= 1:3.4
32 BuildRequires:  python3-setuptools
33 BuildRequires:  python3-setuptools_scm >= 1.11.1
34 %if %{with tests}
35 BuildRequires:  python3-pytest
36 %endif
37 %endif
38 BuildRequires:  rpm-pythonprov
39 BuildRequires:  rpmbuild(macros) >= 1.714
40 Requires:       python-modules >= 1:2.7
41 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43 %description
44 Pyclipper is a Cython wrapper exposing public functions and classes of
45 the C++ translation of the Angus Johnson's Clipper library.
46
47 The Clipper library performs line & polygon clipping - intersection,
48 union, difference & exclusive-or, and line & polygon offsetting. The
49 library is based on Vatti's clipping algorithm.
50
51 %description -l pl.UTF-8
52 Pyclipper to cythonowe obudowanie udostępniające funkcje i klasy
53 publiczne tłumaczenia C++ biblioteki Clipper Angusa Johnsona.
54
55 Biblioteka Clipper wykonuje obcinanie linii i wielokątów (wyznaczanie
56 części wspólnej, sumy, różnicy i różnicy symetrycznej) oraz
57 obrysowywanie linii i wielokątów. Jest oparta na algorytmie obcinania
58 Vattiego.
59
60 %package -n python3-pyclipper
61 Summary:        Cython wrapper for Clipper library
62 Summary(pl.UTF-8):      Cythonowe obudowanie biblioteki Clipper
63 Group:          Libraries/Python
64 Requires:       python3-modules >= 1:3.4
65
66 %description -n python3-pyclipper
67 Pyclipper is a Cython wrapper exposing public functions and classes of
68 the C++ translation of the Angus Johnson's Clipper library.
69
70 %description -n python3-pyclipper -l pl.UTF-8
71 Pyclipper to cythonowe obudowanie udostępniające funkcje i klasy
72 publiczne tłumaczenia C++ biblioteki Clipper Angusa Johnsona.
73
74 Biblioteka Clipper wykonuje obcinanie linii i wielokątów (wyznaczanie
75 części wspólnej, sumy, różnicy i różnicy symetrycznej) oraz
76 obrysowywanie linii i wielokątów. Jest oparta na algorytmie obcinania
77 Vattiego.
78
79 %prep
80 %setup -q -n pyclipper-%{version}
81 %patch0 -p1
82
83 %build
84 %if %{with python2}
85 %py_build
86
87 %if %{with tests}
88 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
89 PYTHONPATH=$(echo $(pwd)/build-2/lib.*) \
90 %{__python} -m pytest tests
91 %endif
92 %endif
93
94 %if %{with python3}
95 %py3_build
96
97 %if %{with tests}
98 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
99 PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \
100 %{__python3} -m pytest tests
101 %endif
102 %endif
103
104 %install
105 rm -rf $RPM_BUILD_ROOT
106
107 %if %{with python2}
108 %py_install
109
110 %py_postclean
111 %endif
112
113 %if %{with python3}
114 %py3_install
115 %endif
116
117 %clean
118 rm -rf $RPM_BUILD_ROOT
119
120 %if %{with python2}
121 %files
122 %defattr(644,root,root,755)
123 %doc LICENSE README.rst
124 %dir %{py_sitedir}/pyclipper
125 %{py_sitedir}/pyclipper/*.py[co]
126 %attr(755,root,root) %{py_sitedir}/pyclipper/*.so
127 %{py_sitedir}/pyclipper-%{version}-py*.egg-info
128 %endif
129
130 %if %{with python3}
131 %files -n python3-pyclipper
132 %defattr(644,root,root,755)
133 %doc LICENSE README.rst
134 %dir %{py3_sitedir}/pyclipper
135 %{py3_sitedir}/pyclipper/*.py
136 %attr(755,root,root) %{py3_sitedir}/pyclipper/*.so
137 %{py3_sitedir}/pyclipper/__pycache__
138 %{py3_sitedir}/pyclipper-%{version}-py*.egg-info
139 %endif
This page took 0.090755 seconds and 3 git commands to generate.