3 %bcond_without doc # Sphinx documentation
4 %bcond_without tests # pytest tests
6 Summary: A tool to convert TrueType/OpenType fonts to XML and back
7 Summary(pl.UTF-8): Narzędzie do konwersji fontów TrueType/OpenType do/z XML-a
11 # basic license is BSD
12 # FontTools includes Adobe AGL & AGLFN, which is under 3-clauses BSD license
14 Group: Development/Tools
15 #Source0Download: https://github.com/fonttools/fonttools/releases
16 Source0: https://github.com/fonttools/fonttools/archive/%{version}/%{name}-%{version}.tar.gz
17 # Source0-md5: 2e225e2db5bb8541419a2232474dc9a4
18 URL: https://github.com/fonttools/fonttools
19 %if %(locale -a | grep -q '^C\.utf8$'; echo $?)
20 BuildRequires: glibc-localedb-all
22 BuildRequires: python3-Cython
23 BuildRequires: python3-devel >= 1:3.7
25 BuildRequires: python3-brotli >= 1.0.9
26 #BuildRequires: python3-freetype-py >= 2.3.0
27 BuildRequires: python3-fs >= 2.4.16
28 BuildRequires: python3-fs < 3
29 BuildRequires: python3-lxml >= 4
30 BuildRequires: python3-lxml < 5
31 BuildRequires: python3-lz4 >= 1.7.4.2
32 BuildRequires: python3-matplotlib
33 BuildRequires: python3-pytest >= 3.0
35 BuildRequires: python3-scipy >= 1.7.3
36 BuildRequires: python3-skia-pathops >= 0.7.2
37 BuildRequires: python3-sympy
38 #BuildRequires: python3-ufoLib2 >= 0.13.1
39 #BuildRequires: python3-uharfbuzz >= 0.30.0
40 %if "%{ver_lt '%{py3_ver}' '3.11'}" == "1"
41 BuildRequires: python3-unicodedata2 >= 14.0.0
43 BuildRequires: python3-zopfli >= 0.2.1
45 BuildRequires: rpm-build >= 4.6
46 BuildRequires: rpmbuild(macros) >= 1.750
48 # preferred versions: reportlab 3.6.3, sphinx_rtd_theme 1.0.0, Sphinx 4.3.1
49 BuildRequires: python3-ReportLab >= 3.5
50 BuildRequires: python3-sphinx_rtd_theme >= 0.4
51 BuildRequires: sphinx-pdg-3 >= 3
53 Requires: python3-fonttools = %{version}-%{release}
54 Requires: python3-setuptools
55 Provides: ttx = %{version}-%{release}
56 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59 TTX/FontTools is a tool for manipulating TrueType and OpenType fonts.
60 It is written in Python and has a BSD-style, open-source license. TTX
61 can dump TrueType and OpenType fonts to an XML-based text format and
64 %description -l pl.UTF-8
65 TTX/FontTools to narzędzie do operacji na fontach TrueType i OpenType.
66 Zostało napisane w Pythonie i ma otwartą licencję w stylu BSD. TTX
67 potrafi wykonywać zrzuty fontów TrueType i OpenType do formatu
68 tekstowego opartego na XML-u oraz dokonać operacji odwrotnej.
70 %package -n python3-fonttools
71 Summary: Python 3 tools to manipulate font files
72 Summary(pl.UTF-8): Narzędzia do manipulacji na plikach fontów dla Pythona 3
73 Group: Libraries/Python
74 Requires: python3-modules >= 1:3.7
75 %if "%{ver_lt '%{py3_ver}' '3.11'}" == "1"
76 Requires: python3-unicodedata2 >= 14.0.0
79 %description -n python3-fonttools
80 Python 3 tools to manipulate font files.
82 %description -n python3-fonttools -l pl.UTF-8
83 Narzędzia do manipulacji na plikach fontów dla Pythona 3.
85 %package -n python3-fonttools-apidocs
86 Summary: Documentation for Python fonttools module
87 Summary(pl.UTF-8): Dokumentacja modułu Pythona fonttools
91 %description -n python3-fonttools-apidocs
92 Documentation for Python fonttools module.
94 %description -n python3-fonttools-apidocs -l pl.UTF-8
95 Dokumentacja modułu Pythona fonttools.
104 PATH="$(pwd):$PATH" \
105 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
106 PYTHONPATH=$(pwd)/Lib \
107 %{__python3} -m pytest Tests
111 PYTHONPATH=$(pwd)/Lib \
112 %{__make} -C Doc html \
113 SPHINXBUILD=sphinx-build-3
117 rm -rf $RPM_BUILD_ROOT
122 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/fontTools/cu2qu/*.c
125 rm -rf $RPM_BUILD_ROOT
128 %defattr(644,root,root,755)
129 %doc LICENSE LICENSE.external NEWS.rst README.rst
130 %attr(755,root,root) %{_bindir}/fonttools
131 %attr(755,root,root) %{_bindir}/pyftmerge
132 %attr(755,root,root) %{_bindir}/pyftsubset
133 %attr(755,root,root) %{_bindir}/ttx
134 %{_mandir}/man1/ttx.1*
136 %files -n python3-fonttools
137 %defattr(644,root,root,755)
138 %dir %{py3_sitedir}/fontTools
139 %{py3_sitedir}/fontTools/*.py
140 %{py3_sitedir}/fontTools/__pycache__
141 %{py3_sitedir}/fontTools/cffLib
142 %{py3_sitedir}/fontTools/colorLib
143 %{py3_sitedir}/fontTools/config
144 %dir %{py3_sitedir}/fontTools/cu2qu
145 %attr(755,root,root) %{py3_sitedir}/fontTools/cu2qu/cu2qu.cpython-*.so
146 %{py3_sitedir}/fontTools/cu2qu/*.py
147 %{py3_sitedir}/fontTools/cu2qu/__pycache__
148 %{py3_sitedir}/fontTools/designspaceLib
149 %{py3_sitedir}/fontTools/encodings
150 %{py3_sitedir}/fontTools/feaLib
151 %{py3_sitedir}/fontTools/merge
152 %{py3_sitedir}/fontTools/misc
153 %{py3_sitedir}/fontTools/mtiLib
154 %{py3_sitedir}/fontTools/otlLib
155 %{py3_sitedir}/fontTools/pens
156 %{py3_sitedir}/fontTools/subset
157 %{py3_sitedir}/fontTools/svgLib
158 %{py3_sitedir}/fontTools/t1Lib
159 %{py3_sitedir}/fontTools/ttLib
160 %{py3_sitedir}/fontTools/ufoLib
161 %{py3_sitedir}/fontTools/unicodedata
162 %{py3_sitedir}/fontTools/varLib
163 %{py3_sitedir}/fontTools/voltLib
164 %{py3_sitedir}/fonttools-%{version}-py*.egg-info
167 %files -n python3-fonttools-apidocs
168 %defattr(644,root,root,755)
169 %doc Doc/build/html/{_images,_modules,_static,cffLib,colorLib,cu2qu,designspaceLib,encodings,feaLib,misc,otlLib,pens,subset,svgLib,ttLib,ufoLib,unicodedata,varLib,*.html,*.js}