]>
Commit | Line | Data |
---|---|---|
e4814ebe JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
7a669b0a | 4 | %bcond_with python3 # CPython 3.x module (version 4+ built from fonttools.spec) |
e4814ebe JB |
5 | %bcond_without doc # Sphinx documentation |
6 | %bcond_without tests # pytest tests | |
7 | ||
7c462756 JB |
8 | Summary: Python 2 tools to manipulate font files |
9 | Summary(pl.UTF-8): Narzędzia do manipulacji na plikach fontów dla Pythona 2 | |
7a669b0a | 10 | Name: python-fonttools |
af4425a8 | 11 | Version: 3.44.0 |
8980ce56 | 12 | Release: 6 |
e4814ebe JB |
13 | # basic license is BSD |
14 | # FontTools includes Adobe AGL & AGLFN, which is under 3-clauses BSD license | |
15 | License: MIT, BSD | |
77da64f4 | 16 | Group: Development/Tools |
e4814ebe | 17 | #Source0Download: https://github.com/fonttools/fonttools/releases |
7a669b0a | 18 | Source0: https://github.com/fonttools/fonttools/archive/%{version}/fonttools-%{version}.tar.gz |
af4425a8 | 19 | # Source0-md5: 3f9ff311081a0f591a09552902671d29 |
8980ce56 | 20 | Patch0: %{name}-singledispatch.patch |
e4814ebe JB |
21 | URL: https://github.com/fonttools/fonttools |
22 | %if %(locale -a | grep -q '^C\.utf8$'; echo $?) | |
23 | BuildRequires: glibc-localedb-all | |
24 | %endif | |
25 | %if %{with python2} | |
26 | BuildRequires: python-devel >= 1:2.7 | |
27 | BuildRequires: python-setuptools | |
28 | %if %{with tests} | |
af4425a8 JB |
29 | BuildRequires: python-enum34 >= 1.1.6 |
30 | BuildRequires: python-fs >= 2.2.0 | |
e4814ebe | 31 | BuildRequires: python-pytest >= 3.0 |
af4425a8 | 32 | BuildRequires: python-unicodedata2 >= 12.0.0 |
e4814ebe JB |
33 | %endif |
34 | %endif | |
35 | %if %{with python3} | |
36 | BuildRequires: python3-devel >= 1:3.4 | |
37 | %if %{with tests} | |
af4425a8 | 38 | BuildRequires: python3-fs >= 2.2.0 |
e4814ebe | 39 | BuildRequires: python3-pytest >= 3.0 |
6c07898f | 40 | %if "%{py3_ver}" < "3.7" |
af4425a8 | 41 | BuildRequires: python3-unicodedata2 >= 12.0.0 |
6c07898f | 42 | %endif |
e4814ebe JB |
43 | %endif |
44 | %endif | |
45 | BuildRequires: rpmbuild(macros) >= 1.714 | |
af4425a8 | 46 | %if %{with doc} |
7a669b0a | 47 | BuildRequires: sphinx-pdg-2 >= 1.5.5 |
af4425a8 | 48 | %endif |
7c462756 JB |
49 | Requires: python-modules >= 1:2.7 |
50 | Requires: python-unicodedata2 >= 12.0.0 | |
e4814ebe | 51 | BuildArch: noarch |
77da64f4 AM |
52 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
53 | ||
54 | %description | |
e4814ebe JB |
55 | Python 2 tools to manipulate font files. |
56 | ||
7c462756 | 57 | %description -l pl.UTF-8 |
e4814ebe JB |
58 | Narzędzia do manipulacji na plikach fontów dla Pythona 2. |
59 | ||
7c462756 | 60 | %package apidocs |
e4814ebe JB |
61 | Summary: Documentation for Python fonttools module |
62 | Summary(pl.UTF-8): Dokumentacja modułu Pythona fonttools | |
63 | Group: Documentation | |
64 | ||
7c462756 | 65 | %description apidocs |
e4814ebe JB |
66 | Documentation for Python fonttools module. |
67 | ||
7c462756 | 68 | %description apidocs -l pl.UTF-8 |
e4814ebe JB |
69 | Dokumentacja modułu Pythona fonttools. |
70 | ||
71 | %package -n python3-fonttools | |
72 | Summary: Python 3 tools to manipulate font files | |
73 | Summary(pl.UTF-8): Narzędzia do manipulacji na plikach fontów dla Pythona 3 | |
74 | Group: Libraries/Python | |
75 | Requires: python3-modules >= 1:3.4 | |
6c07898f | 76 | %if "%{py3_ver}" < "3.7" |
805b814f | 77 | Requires: python3-unicodedata2 >= 12.0.0 |
6c07898f | 78 | %endif |
e4814ebe JB |
79 | |
80 | %description -n python3-fonttools | |
81 | Python 3 tools to manipulate font files. | |
82 | ||
83 | %description -n python3-fonttools -l pl.UTF-8 | |
84 | Narzędzia do manipulacji na plikach fontów dla Pythona 3. | |
85 | ||
77da64f4 | 86 | %prep |
7a669b0a | 87 | %setup -q -n fonttools-%{version} |
8980ce56 | 88 | %patch0 -p1 |
77da64f4 | 89 | |
77da64f4 | 90 | %build |
e4814ebe JB |
91 | export LC_ALL=C.UTF-8 |
92 | %if %{with python2} | |
af4425a8 JB |
93 | %py_build |
94 | ||
95 | %if %{with tests} | |
8980ce56 | 96 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
af4425a8 JB |
97 | PYTHONPATH=Lib \ |
98 | %{__python} -m pytest Tests | |
e4814ebe JB |
99 | %endif |
100 | %endif | |
101 | ||
102 | %if %{with python3} | |
af4425a8 JB |
103 | %py3_build |
104 | ||
105 | %if %{with tests} | |
8980ce56 | 106 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
af4425a8 JB |
107 | PYTHONPATH=Lib \ |
108 | %{__python} -m pytest Tests | |
109 | %endif | |
110 | %endif | |
111 | ||
112 | %if %{with doc} | |
7a669b0a | 113 | PYTHONPATH=$(pwd)/build-2/lib \ |
af4425a8 | 114 | %{__make} -C Doc html \ |
7a669b0a | 115 | SPHINXBUILD=sphinx-build-2 |
e4814ebe | 116 | %endif |
77da64f4 AM |
117 | |
118 | %install | |
119 | rm -rf $RPM_BUILD_ROOT | |
baf8eefc | 120 | |
e4814ebe JB |
121 | %if %{with python3} |
122 | %py3_install | |
123 | %endif | |
124 | ||
125 | %if %{with python2} | |
126 | %py_install | |
77da64f4 | 127 | |
baf8eefc | 128 | %py_postclean |
e4814ebe | 129 | %endif |
77da64f4 | 130 | |
7a669b0a JB |
131 | # packaged from fonttools.spec |
132 | %{__rm} -r $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1} | |
133 | ||
77da64f4 AM |
134 | %clean |
135 | rm -rf $RPM_BUILD_ROOT | |
136 | ||
e4814ebe | 137 | %if %{with python2} |
7c462756 | 138 | %files |
e4814ebe JB |
139 | %defattr(644,root,root,755) |
140 | %{py_sitescriptdir}/fontTools | |
141 | %{py_sitescriptdir}/fonttools-%{version}-py*.egg-info | |
142 | ||
143 | %if %{with doc} | |
7c462756 | 144 | %files apidocs |
e4814ebe JB |
145 | %defattr(644,root,root,755) |
146 | %doc Doc/build/html/{_static,designspaceLib,misc,pens,ttLib,varLib,*.html,*.js} | |
147 | %endif | |
148 | %endif | |
149 | ||
150 | %if %{with python3} | |
151 | %files -n python3-fonttools | |
152 | %defattr(644,root,root,755) | |
153 | %{py3_sitescriptdir}/fontTools | |
154 | %{py3_sitescriptdir}/fonttools-%{version}-py*.egg-info | |
155 | %endif |