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: A tool to convert TrueType/OpenType fonts to XML and back
9 Summary(pl.UTF-8): Narzędzie do konwersji fontów TrueType/OpenType do/z XML-a
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 URL: https://github.com/fonttools/fonttools
21 %if %(locale -a | grep -q '^C\.utf8$'; echo $?)
22 BuildRequires: glibc-localedb-all
25 BuildRequires: python-devel >= 1:2.7
26 BuildRequires: python-setuptools
28 BuildRequires: python-enum34 >= 1.1.6
29 BuildRequires: python-fs >= 2.2.0
30 BuildRequires: python-pytest >= 3.0
31 BuildRequires: python-unicodedata2 >= 12.0.0
35 BuildRequires: python3-devel >= 1:3.4
37 BuildRequires: python3-fs >= 2.2.0
38 BuildRequires: python3-pytest >= 3.0
39 %if "%{py3_ver}" < "3.7"
40 BuildRequires: python3-unicodedata2 >= 12.0.0
44 BuildRequires: rpmbuild(macros) >= 1.714
46 BuildRequires: sphinx-pdg-2 >= 1.5.5
49 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52 TTX/FontTools is a tool for manipulating TrueType and OpenType fonts.
53 It is written in Python and has a BSD-style, open-source license. TTX
54 can dump TrueType and OpenType fonts to an XML-based text format and
57 %description -l pl.UTF-8
58 TTX/FontTools to narzędzie do operacji na fontach TrueType i OpenType.
59 Zostało napisane w Pythonie i ma otwartą licencję w stylu BSD. TTX
60 potrafi wykonywać zrzuty fontów TrueType i OpenType do formatu
61 tekstowego opartego na XML-u oraz dokonać operacji odwrotnej.
63 %package -n python-fonttools
64 Summary: Python 2 tools to manipulate font files
65 Summary(pl.UTF-8): Narzędzia do manipulacji na plikach fontów dla Pythona 2
66 Group: Libraries/Python
67 Requires: python-modules >= 1:2.7
68 Requires: python-unicodedata2 >= 12.0.0
70 %description -n python-fonttools
71 Python 2 tools to manipulate font files.
73 %description -n python-fonttools -l pl.UTF-8
74 Narzędzia do manipulacji na plikach fontów dla Pythona 2.
76 %package -n python-fonttools-apidocs
77 Summary: Documentation for Python fonttools module
78 Summary(pl.UTF-8): Dokumentacja modułu Pythona fonttools
81 %description -n python-fonttools-apidocs
82 Documentation for Python fonttools module.
84 %description -n python-fonttools-apidocs -l pl.UTF-8
85 Dokumentacja modułu Pythona fonttools.
87 %package -n python3-fonttools
88 Summary: Python 3 tools to manipulate font files
89 Summary(pl.UTF-8): Narzędzia do manipulacji na plikach fontów dla Pythona 3
90 Group: Libraries/Python
91 Requires: python3-modules >= 1:3.4
92 %if "%{py3_ver}" < "3.7"
93 Requires: python3-unicodedata2 >= 12.0.0
96 %description -n python3-fonttools
97 Python 3 tools to manipulate font files.
99 %description -n python3-fonttools -l pl.UTF-8
100 Narzędzia do manipulacji na plikach fontów dla Pythona 3.
103 %setup -q -n fonttools-%{version}
106 export LC_ALL=C.UTF-8
112 %{__python} -m pytest Tests
121 %{__python} -m pytest Tests
126 PYTHONPATH=$(pwd)/build-2/lib \
127 %{__make} -C Doc html \
128 SPHINXBUILD=sphinx-build-2
132 rm -rf $RPM_BUILD_ROOT
144 # packaged from fonttools.spec
145 %{__rm} -r $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1}
148 rm -rf $RPM_BUILD_ROOT
151 %files -n python-fonttools
152 %defattr(644,root,root,755)
153 %{py_sitescriptdir}/fontTools
154 %{py_sitescriptdir}/fonttools-%{version}-py*.egg-info
157 %files -n python-fonttools-apidocs
158 %defattr(644,root,root,755)
159 %doc Doc/build/html/{_static,designspaceLib,misc,pens,ttLib,varLib,*.html,*.js}
164 %files -n python3-fonttools
165 %defattr(644,root,root,755)
166 %{py3_sitescriptdir}/fontTools
167 %{py3_sitescriptdir}/fonttools-%{version}-py*.egg-info