3 %bcond_without python2 # CPython 2.x module
4 %bcond_with python3 # CPython 3.x module (version 4+ built from fonttools.spec)
5 %bcond_without doc # Sphinx documentation
6 %bcond_without tests # pytest tests
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
10 Name: python-fonttools
13 # basic license is BSD
14 # FontTools includes Adobe AGL & AGLFN, which is under 3-clauses BSD license
16 Group: Development/Tools
17 #Source0Download: https://github.com/fonttools/fonttools/releases
18 Source0: https://github.com/fonttools/fonttools/archive/%{version}/fonttools-%{version}.tar.gz
19 # Source0-md5: 3f9ff311081a0f591a09552902671d29
20 Patch0: %{name}-singledispatch.patch
21 URL: https://github.com/fonttools/fonttools
22 %if %(locale -a | grep -q '^C\.utf8$'; echo $?)
23 BuildRequires: glibc-localedb-all
26 BuildRequires: python-devel >= 1:2.7
27 BuildRequires: python-setuptools
29 BuildRequires: python-enum34 >= 1.1.6
30 BuildRequires: python-fs >= 2.2.0
31 BuildRequires: python-pytest >= 3.0
32 BuildRequires: python-unicodedata2 >= 12.0.0
36 BuildRequires: python3-devel >= 1:3.4
38 BuildRequires: python3-fs >= 2.2.0
39 BuildRequires: python3-pytest >= 3.0
40 %if "%{py3_ver}" < "3.7"
41 BuildRequires: python3-unicodedata2 >= 12.0.0
45 BuildRequires: rpmbuild(macros) >= 1.714
47 BuildRequires: sphinx-pdg-2 >= 1.5.5
49 Requires: python-modules >= 1:2.7
50 Requires: python-unicodedata2 >= 12.0.0
52 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55 Python 2 tools to manipulate font files.
57 %description -l pl.UTF-8
58 Narzędzia do manipulacji na plikach fontów dla Pythona 2.
61 Summary: Documentation for Python fonttools module
62 Summary(pl.UTF-8): Dokumentacja modułu Pythona fonttools
66 Documentation for Python fonttools module.
68 %description apidocs -l pl.UTF-8
69 Dokumentacja modułu Pythona fonttools.
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
76 %if "%{py3_ver}" < "3.7"
77 Requires: python3-unicodedata2 >= 12.0.0
80 %description -n python3-fonttools
81 Python 3 tools to manipulate font files.
83 %description -n python3-fonttools -l pl.UTF-8
84 Narzędzia do manipulacji na plikach fontów dla Pythona 3.
87 %setup -q -n fonttools-%{version}
96 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
98 %{__python} -m pytest Tests
106 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
108 %{__python} -m pytest Tests
113 PYTHONPATH=$(pwd)/build-2/lib \
114 %{__make} -C Doc html \
115 SPHINXBUILD=sphinx-build-2
119 rm -rf $RPM_BUILD_ROOT
131 # packaged from fonttools.spec
132 %{__rm} -r $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1}
135 rm -rf $RPM_BUILD_ROOT
139 %defattr(644,root,root,755)
140 %{py_sitescriptdir}/fontTools
141 %{py_sitescriptdir}/fonttools-%{version}-py*.egg-info
145 %defattr(644,root,root,755)
146 %doc Doc/build/html/{_static,designspaceLib,misc,pens,ttLib,varLib,*.html,*.js}
151 %files -n python3-fonttools
152 %defattr(644,root,root,755)
153 %{py3_sitescriptdir}/fontTools
154 %{py3_sitescriptdir}/fonttools-%{version}-py*.egg-info