]>
Commit | Line | Data |
---|---|---|
e4814ebe JB |
1 | # |
2 | # Conditional build: | |
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 | |
7 | ||
baf8eefc JB |
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 | |
77da64f4 | 10 | Name: fonttools |
af4425a8 | 11 | Version: 3.44.0 |
b550ec70 | 12 | Release: 4 |
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 JB |
17 | #Source0Download: https://github.com/fonttools/fonttools/releases |
18 | Source0: https://github.com/fonttools/fonttools/archive/%{version}/%{name}-%{version}.tar.gz | |
af4425a8 | 19 | # Source0-md5: 3f9ff311081a0f591a09552902671d29 |
e4814ebe JB |
20 | URL: https://github.com/fonttools/fonttools |
21 | %if %(locale -a | grep -q '^C\.utf8$'; echo $?) | |
22 | BuildRequires: glibc-localedb-all | |
23 | %endif | |
24 | %if %{with python2} | |
25 | BuildRequires: python-devel >= 1:2.7 | |
26 | BuildRequires: python-setuptools | |
27 | %if %{with tests} | |
af4425a8 JB |
28 | BuildRequires: python-enum34 >= 1.1.6 |
29 | BuildRequires: python-fs >= 2.2.0 | |
e4814ebe | 30 | BuildRequires: python-pytest >= 3.0 |
af4425a8 | 31 | BuildRequires: python-unicodedata2 >= 12.0.0 |
e4814ebe JB |
32 | %endif |
33 | %endif | |
34 | %if %{with python3} | |
35 | BuildRequires: python3-devel >= 1:3.4 | |
36 | %if %{with tests} | |
af4425a8 | 37 | BuildRequires: python3-fs >= 2.2.0 |
e4814ebe | 38 | BuildRequires: python3-pytest >= 3.0 |
6c07898f | 39 | %if "%{py3_ver}" < "3.7" |
af4425a8 | 40 | BuildRequires: python3-unicodedata2 >= 12.0.0 |
6c07898f | 41 | %endif |
e4814ebe JB |
42 | %endif |
43 | %endif | |
44 | BuildRequires: rpmbuild(macros) >= 1.714 | |
af4425a8 JB |
45 | %if %{with doc} |
46 | BuildRequires: sphinx-pdg-3 >= 1.5.5 | |
47 | %endif | |
e4814ebe JB |
48 | %if %{with python2} |
49 | Requires: python-fonttools = %{version}-%{release} | |
50 | Requires: python-setuptools | |
51 | %else | |
52 | Requires: python3-fonttools = %{version}-%{release} | |
53 | Requires: python3-setuptools | |
54 | %endif | |
77da64f4 | 55 | Provides: ttx = %{version}-%{release} |
e4814ebe | 56 | BuildArch: noarch |
77da64f4 AM |
57 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
58 | ||
59 | %description | |
60 | TTX/FontTools is a tool for manipulating TrueType and OpenType fonts. | |
61 | It is written in Python and has a BSD-style, open-source license. TTX | |
62 | can dump TrueType and OpenType fonts to an XML-based text format and | |
63 | vice versa. | |
64 | ||
baf8eefc JB |
65 | %description -l pl.UTF-8 |
66 | TTX/FontTools to narzędzie do operacji na fontach TrueType i OpenType. | |
67 | Zostało napisane w Pythonie i ma otwartą licencję w stylu BSD. TTX | |
68 | potrafi wykonywać zrzuty fontów TrueType i OpenType do formatu | |
69 | tekstowego opartego na XML-u oraz dokonać operacji odwrotnej. | |
70 | ||
e4814ebe JB |
71 | %package -n python-fonttools |
72 | Summary: Python 2 tools to manipulate font files | |
73 | Summary(pl.UTF-8): Narzędzia do manipulacji na plikach fontów dla Pythona 2 | |
74 | Group: Libraries/Python | |
75 | Requires: python-modules >= 1:2.7 | |
6c07898f | 76 | Requires: python-unicodedata2 >= 11.0.0 |
e4814ebe JB |
77 | |
78 | %description -n python-fonttools | |
79 | Python 2 tools to manipulate font files. | |
80 | ||
81 | %description -n python-fonttools -l pl.UTF-8 | |
82 | Narzędzia do manipulacji na plikach fontów dla Pythona 2. | |
83 | ||
84 | %package -n python-fonttools-apidocs | |
85 | Summary: Documentation for Python fonttools module | |
86 | Summary(pl.UTF-8): Dokumentacja modułu Pythona fonttools | |
87 | Group: Documentation | |
88 | ||
89 | %description -n python-fonttools-apidocs | |
90 | Documentation for Python fonttools module. | |
91 | ||
92 | %description -n python-fonttools-apidocs -l pl.UTF-8 | |
93 | Dokumentacja modułu Pythona fonttools. | |
94 | ||
95 | %package -n python3-fonttools | |
96 | Summary: Python 3 tools to manipulate font files | |
97 | Summary(pl.UTF-8): Narzędzia do manipulacji na plikach fontów dla Pythona 3 | |
98 | Group: Libraries/Python | |
99 | Requires: python3-modules >= 1:3.4 | |
6c07898f JB |
100 | %if "%{py3_ver}" < "3.7" |
101 | Requires: python3-unicodedata2 >= 11.0.0 | |
102 | %endif | |
e4814ebe JB |
103 | |
104 | %description -n python3-fonttools | |
105 | Python 3 tools to manipulate font files. | |
106 | ||
107 | %description -n python3-fonttools -l pl.UTF-8 | |
108 | Narzędzia do manipulacji na plikach fontów dla Pythona 3. | |
109 | ||
77da64f4 AM |
110 | %prep |
111 | %setup -q | |
112 | ||
77da64f4 | 113 | %build |
e4814ebe JB |
114 | export LC_ALL=C.UTF-8 |
115 | %if %{with python2} | |
af4425a8 JB |
116 | %py_build |
117 | ||
118 | %if %{with tests} | |
119 | PYTHONPATH=Lib \ | |
120 | %{__python} -m pytest Tests | |
e4814ebe JB |
121 | %endif |
122 | %endif | |
123 | ||
124 | %if %{with python3} | |
af4425a8 JB |
125 | %py3_build |
126 | ||
127 | %if %{with tests} | |
128 | PYTHONPATH=Lib \ | |
129 | %{__python} -m pytest Tests | |
130 | %endif | |
131 | %endif | |
132 | ||
133 | %if %{with doc} | |
134 | PYTHONPATH=$(pwd)/build-3/lib \ | |
135 | %{__make} -C Doc html \ | |
136 | SPHINXBUILD=sphinx-build-3 | |
e4814ebe | 137 | %endif |
77da64f4 AM |
138 | |
139 | %install | |
140 | rm -rf $RPM_BUILD_ROOT | |
baf8eefc | 141 | |
e4814ebe JB |
142 | %if %{with python3} |
143 | %py3_install | |
144 | %endif | |
145 | ||
146 | %if %{with python2} | |
147 | %py_install | |
77da64f4 | 148 | |
baf8eefc | 149 | %py_postclean |
e4814ebe | 150 | %endif |
77da64f4 AM |
151 | |
152 | %clean | |
153 | rm -rf $RPM_BUILD_ROOT | |
154 | ||
155 | %files | |
156 | %defattr(644,root,root,755) | |
e4814ebe JB |
157 | %doc LICENSE LICENSE.external NEWS.rst README.rst |
158 | %attr(755,root,root) %{_bindir}/fonttools | |
e4814ebe JB |
159 | %attr(755,root,root) %{_bindir}/pyftmerge |
160 | %attr(755,root,root) %{_bindir}/pyftsubset | |
baf8eefc | 161 | %attr(755,root,root) %{_bindir}/ttx |
77da64f4 | 162 | %{_mandir}/man1/ttx.1* |
e4814ebe JB |
163 | |
164 | %if %{with python2} | |
165 | %files -n python-fonttools | |
166 | %defattr(644,root,root,755) | |
167 | %{py_sitescriptdir}/fontTools | |
168 | %{py_sitescriptdir}/fonttools-%{version}-py*.egg-info | |
169 | ||
170 | %if %{with doc} | |
171 | %files -n python-fonttools-apidocs | |
172 | %defattr(644,root,root,755) | |
173 | %doc Doc/build/html/{_static,designspaceLib,misc,pens,ttLib,varLib,*.html,*.js} | |
174 | %endif | |
175 | %endif | |
176 | ||
177 | %if %{with python3} | |
178 | %files -n python3-fonttools | |
179 | %defattr(644,root,root,755) | |
180 | %{py3_sitescriptdir}/fontTools | |
181 | %{py3_sitescriptdir}/fonttools-%{version}-py*.egg-info | |
182 | %endif |