]>
Commit | Line | Data |
---|---|---|
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 | ||
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: fonttools | |
11 | Version: 3.24.1 | |
12 | Release: 2 | |
13 | # basic license is BSD | |
14 | # FontTools includes Adobe AGL & AGLFN, which is under 3-clauses BSD license | |
15 | License: MIT, BSD | |
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 | |
23 | %endif | |
24 | %if %{with python2} | |
25 | BuildRequires: python-devel >= 1:2.7 | |
26 | BuildRequires: python-setuptools | |
27 | %if %{with tests} | |
28 | BuildRequires: python-pytest >= 3.0 | |
29 | %endif | |
30 | %if %{with doc} | |
31 | BuildRequires: sphinx-pdg-2 | |
32 | %endif | |
33 | %endif | |
34 | %if %{with python3} | |
35 | BuildRequires: python3-devel >= 1:3.4 | |
36 | %if %{with tests} | |
37 | BuildRequires: python3-pytest >= 3.0 | |
38 | %endif | |
39 | %endif | |
40 | BuildRequires: rpmbuild(macros) >= 1.714 | |
41 | %if %{with python2} | |
42 | Requires: python-fonttools = %{version}-%{release} | |
43 | Requires: python-setuptools | |
44 | %else | |
45 | Requires: python3-fonttools = %{version}-%{release} | |
46 | Requires: python3-setuptools | |
47 | %endif | |
48 | Provides: ttx = %{version}-%{release} | |
49 | BuildArch: noarch | |
50 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
51 | ||
52 | %description | |
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 | |
56 | vice versa. | |
57 | ||
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. | |
63 | ||
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 | |
72 | ||
73 | %description -n python-fonttools | |
74 | Python 2 tools to manipulate font files. | |
75 | ||
76 | %description -n python-fonttools -l pl.UTF-8 | |
77 | Narzędzia do manipulacji na plikach fontów dla Pythona 2. | |
78 | ||
79 | %package -n python-fonttools-apidocs | |
80 | Summary: Documentation for Python fonttools module | |
81 | Summary(pl.UTF-8): Dokumentacja modułu Pythona fonttools | |
82 | Group: Documentation | |
83 | ||
84 | %description -n python-fonttools-apidocs | |
85 | Documentation for Python fonttools module. | |
86 | ||
87 | %description -n python-fonttools-apidocs -l pl.UTF-8 | |
88 | Dokumentacja modułu Pythona fonttools. | |
89 | ||
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 | |
98 | ||
99 | %description -n python3-fonttools | |
100 | Python 3 tools to manipulate font files. | |
101 | ||
102 | %description -n python3-fonttools -l pl.UTF-8 | |
103 | Narzędzia do manipulacji na plikach fontów dla Pythona 3. | |
104 | ||
105 | %prep | |
106 | %setup -q | |
107 | ||
108 | %build | |
109 | export LC_ALL=C.UTF-8 | |
110 | %if %{with python2} | |
111 | %py_build %{?with_tests:test} | |
112 | %if %{with doc} | |
113 | PYTHONPATH=$(pwd)/build-2/lib \ | |
114 | %{__make} -C Doc html \ | |
115 | SPHINXBUILD=sphinx-build-2 | |
116 | %endif | |
117 | %endif | |
118 | ||
119 | %if %{with python3} | |
120 | %py3_build %{?with_tests:test} | |
121 | %endif | |
122 | ||
123 | %install | |
124 | rm -rf $RPM_BUILD_ROOT | |
125 | ||
126 | %if %{with python3} | |
127 | %py3_install | |
128 | %endif | |
129 | ||
130 | %if %{with python2} | |
131 | %py_install | |
132 | ||
133 | %py_postclean | |
134 | %endif | |
135 | ||
136 | %clean | |
137 | rm -rf $RPM_BUILD_ROOT | |
138 | ||
139 | %files | |
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* | |
148 | ||
149 | %if %{with python2} | |
150 | %files -n python-fonttools | |
151 | %defattr(644,root,root,755) | |
152 | %{py_sitescriptdir}/fontTools | |
153 | %{py_sitescriptdir}/fonttools-%{version}-py*.egg-info | |
154 | ||
155 | %if %{with doc} | |
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} | |
159 | %endif | |
160 | %endif | |
161 | ||
162 | %if %{with python3} | |
163 | %files -n python3-fonttools | |
164 | %defattr(644,root,root,755) | |
165 | %{py3_sitescriptdir}/fontTools | |
166 | %{py3_sitescriptdir}/fonttools-%{version}-py*.egg-info | |
167 | %endif |