]>
Commit | Line | Data |
---|---|---|
b191917f JB |
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: Cubic-to-quadratic Bezier curve conversion | |
8 | Summary(pl.UTF-8): Konwersja krzywych Beziera stopnia trzeciego do drugiego | |
9 | Name: python-cu2qu | |
10 | Version: 1.6.7.post1 | |
b8592914 | 11 | Release: 2 |
b191917f JB |
12 | License: Apache v2.0 |
13 | Group: Libraries/Python | |
14 | #Source0Download: https://pypi.org/simple/cu2qu/ | |
15 | Source0: https://files.pythonhosted.org/packages/source/c/cu2qu/cu2qu-%{version}.zip | |
16 | # Source0-md5: 6858c0b17180d009765006f0b81b73d3 | |
17 | URL: https://pypi.org/project/cu2qu/ | |
18 | %if %{with python2} | |
19 | BuildRequires: python-Cython | |
20 | BuildRequires: python-modules >= 1:2.5 | |
21 | BuildRequires: python-setuptools | |
22 | BuildRequires: python-setuptools_scm | |
23 | %if %{with tests} | |
24 | BuildRequires: python-defcon >= 0.6.0 | |
25 | # fonttools[ufo] | |
26 | BuildRequires: python-fonttools >= 3.32.0 | |
27 | BuildRequires: python-fs >= 2.2 | |
28 | BuildRequires: python-pytest >= 2.8 | |
29 | %endif | |
30 | %endif | |
31 | %if %{with python3} | |
32 | BuildRequires: python3-Cython | |
33 | BuildRequires: python3-modules >= 1:3.2 | |
34 | BuildRequires: python3-setuptools | |
35 | BuildRequires: python3-setuptools_scm | |
36 | %if %{with tests} | |
37 | BuildRequires: python3-defcon >= 0.6.0 | |
38 | BuildRequires: python3-fonttools >= 3.32.0 | |
39 | BuildRequires: python3-fs >= 2.2 | |
40 | BuildRequires: python3-pytest >= 2.8 | |
41 | %endif | |
42 | %endif | |
43 | BuildRequires: rpm-pythonprov | |
44 | BuildRequires: rpmbuild(macros) >= 1.714 | |
45 | BuildRequires: unzip | |
46 | Requires: python-modules >= 1:2.5 | |
47 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
48 | ||
49 | %description | |
50 | This library provides functions which take in UFO objects (Defcon | |
51 | Fonts or Robofab RFonts) and converts any cubic curves to quadratic. | |
52 | ||
53 | %description -l pl.UTF-8 | |
54 | Ta biblioteka udostępnia funkcje przyjmujące obiekty UFO (Font z | |
55 | biblioteki Defcon albo RFont z Robofab) i konwertujące krzywe | |
56 | trzeciego stopnia do drugiego. | |
57 | ||
58 | %package -n python3-cu2qu | |
59 | Summary: Cubic-to-quadratic Bezier curve conversion | |
60 | Summary(pl.UTF-8): Konwersja krzywych Beziera stopnia trzeciego do drugiego | |
61 | Group: Libraries/Python | |
62 | Requires: python3-modules >= 1:3.2 | |
63 | ||
64 | %description -n python3-cu2qu | |
65 | This library provides functions which take in UFO objects (Defcon | |
66 | Fonts or Robofab RFonts) and converts any cubic curves to quadratic. | |
67 | ||
68 | %description -n python3-cu2qu -l pl.UTF-8 | |
69 | Ta biblioteka udostępnia funkcje przyjmujące obiekty UFO (Font z | |
70 | biblioteki Defcon albo RFont z Robofab) i konwertujące krzywe | |
71 | trzeciego stopnia do drugiego. | |
72 | ||
73 | %prep | |
74 | %setup -q -n cu2qu-%{version} | |
75 | ||
76 | %build | |
77 | %if %{with python2} | |
78 | %py_build \ | |
79 | --with-cython | |
80 | ||
81 | %if %{with tests} | |
82 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
83 | PYTHONPATH=$(pwd)/Lib \ | |
84 | %{__python} -m pytest tests | |
85 | %endif | |
86 | %endif | |
87 | ||
88 | %if %{with python3} | |
89 | %py3_build \ | |
90 | --with-cython | |
91 | ||
92 | %if %{with tests} | |
93 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
94 | PYTHONPATH=$(pwd)/Lib \ | |
95 | %{__python3} -m pytest tests | |
96 | %endif | |
97 | %endif | |
98 | ||
99 | %install | |
100 | rm -rf $RPM_BUILD_ROOT | |
101 | ||
102 | %if %{with python2} | |
103 | %py_install | |
104 | ||
105 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/cu2qu{,-2} | |
106 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/cu2qu/*.c | |
107 | ||
108 | %py_postclean | |
109 | %endif | |
110 | ||
111 | %if %{with python3} | |
112 | %py3_install | |
113 | ||
114 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/cu2qu/*.c | |
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 README.rst | |
124 | %attr(755,root,root) %{_bindir}/cu2qu-2 | |
125 | %dir %{py_sitedir}/cu2qu | |
126 | %attr(755,root,root) %{py_sitedir}/cu2qu/cu2qu.so | |
127 | %{py_sitedir}/cu2qu/*.py[co] | |
128 | %{py_sitedir}/cu2qu-%{version}-py*.egg-info | |
129 | %endif | |
130 | ||
131 | %if %{with python3} | |
132 | %files -n python3-cu2qu | |
133 | %defattr(644,root,root,755) | |
134 | %doc README.rst | |
135 | %attr(755,root,root) %{_bindir}/cu2qu | |
136 | %dir %{py3_sitedir}/cu2qu | |
137 | %attr(755,root,root) %{py3_sitedir}/cu2qu/cu2qu.cpython-*.so | |
138 | %{py3_sitedir}/cu2qu/*.py | |
139 | %{py3_sitedir}/cu2qu/__pycache__ | |
140 | %{py3_sitedir}/cu2qu-%{version}-py*.egg-info | |
141 | %endif |