3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
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
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}/%{name}-%{version}.tar.gz
19 # Source0-md5: 4e807a6b0dd9aad6fec202e73b6db7c2
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-pytest >= 3.0
31 BuildRequires: sphinx-pdg-2
35 BuildRequires: python3-devel >= 1:3.4
37 BuildRequires: python3-pytest >= 3.0
40 BuildRequires: rpmbuild(macros) >= 1.714
42 Requires: python-fonttools = %{version}-%{release}
43 Requires: python-setuptools
45 Requires: python3-fonttools = %{version}-%{release}
46 Requires: python3-setuptools
48 Provides: ttx = %{version}-%{release}
50 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53 TTX/FontTools is a tool for manipulating TrueType and OpenType fonts.
54 It is written in Python and has a BSD-style, open-source license. TTX
55 can dump TrueType and OpenType fonts to an XML-based text format and
58 %description -l pl.UTF-8
59 TTX/FontTools to narzędzie do operacji na fontach TrueType i OpenType.
60 Zostało napisane w Pythonie i ma otwartą licencję w stylu BSD. TTX
61 potrafi wykonywać zrzuty fontów TrueType i OpenType do formatu
62 tekstowego opartego na XML-u oraz dokonać operacji odwrotnej.
64 %package -n python-fonttools
65 Summary: Python 2 tools to manipulate font files
66 Summary(pl.UTF-8): Narzędzia do manipulacji na plikach fontów dla Pythona 2
67 Group: Libraries/Python
68 Requires: python-modules >= 1:2.7
69 Requires: python-brotli >= 1.0.1
70 Requires: python-munkres >= 1.0.10
71 Requires: python-unicodedata2 >= 10.0.0
73 %description -n python-fonttools
74 Python 2 tools to manipulate font files.
76 %description -n python-fonttools -l pl.UTF-8
77 Narzędzia do manipulacji na plikach fontów dla Pythona 2.
79 %package -n python-fonttools-apidocs
80 Summary: Documentation for Python fonttools module
81 Summary(pl.UTF-8): Dokumentacja modułu Pythona fonttools
84 %description -n python-fonttools-apidocs
85 Documentation for Python fonttools module.
87 %description -n python-fonttools-apidocs -l pl.UTF-8
88 Dokumentacja modułu Pythona fonttools.
90 %package -n python3-fonttools
91 Summary: Python 3 tools to manipulate font files
92 Summary(pl.UTF-8): Narzędzia do manipulacji na plikach fontów dla Pythona 3
93 Group: Libraries/Python
94 Requires: python3-modules >= 1:3.4
95 Requires: python3-brotli >= 1.0.1
96 Requires: python3-munkres >= 1.0.10
97 Requires: python3-unicodedata2 >= 10.0.0
99 %description -n python3-fonttools
100 Python 3 tools to manipulate font files.
102 %description -n python3-fonttools -l pl.UTF-8
103 Narzędzia do manipulacji na plikach fontów dla Pythona 3.
109 export LC_ALL=C.UTF-8
111 %py_build %{?with_tests:test}
113 PYTHONPATH=$(pwd)/build-2/lib \
114 %{__make} -C Doc html \
115 SPHINXBUILD=sphinx-build-2
120 %py3_build %{?with_tests:test}
124 rm -rf $RPM_BUILD_ROOT
137 rm -rf $RPM_BUILD_ROOT
140 %defattr(644,root,root,755)
141 %doc LICENSE LICENSE.external NEWS.rst README.rst
142 %attr(755,root,root) %{_bindir}/fonttools
143 %attr(755,root,root) %{_bindir}/pyftinspect
144 %attr(755,root,root) %{_bindir}/pyftmerge
145 %attr(755,root,root) %{_bindir}/pyftsubset
146 %attr(755,root,root) %{_bindir}/ttx
147 %{_mandir}/man1/ttx.1*
150 %files -n python-fonttools
151 %defattr(644,root,root,755)
152 %{py_sitescriptdir}/fontTools
153 %{py_sitescriptdir}/fonttools-%{version}-py*.egg-info
156 %files -n python-fonttools-apidocs
157 %defattr(644,root,root,755)
158 %doc Doc/build/html/{_static,designspaceLib,misc,pens,ttLib,varLib,*.html,*.js}
163 %files -n python3-fonttools
164 %defattr(644,root,root,755)
165 %{py3_sitescriptdir}/fontTools
166 %{py3_sitescriptdir}/fonttools-%{version}-py*.egg-info