summaryrefslogtreecommitdiff
path: root/freetype.spec
blob: 306d07e28ab1dbceb8de64e729d565e861b821bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
%{!?_with_subpixel_rendering: %{!?_without_subpixel_rendering: %define _without_subpixel_rendering --without-subpixel_rendering}}

%{!?with_xfree86:%define with_xfree86 1}

%bcond_without harfbuzz

Name:           freetype
Version:        2.13.3
Release:        1
Summary:        FreeType is a freely available software library to render fonts
License:        (FTL OR GPL-2.0-or-later) AND BSD-3-Clause AND MIT AND MIT-Modern-Variant AND Zlib
URL:            https://www.freetype.org
Source0:        https://download.savannah.gnu.org/releases/freetype/freetype-%{version}.tar.xz
Source1:        https://download.savannah.gnu.org/releases/freetype/freetype-doc-%{version}.tar.xz
Source2:        https://download.savannah.gnu.org/releases/freetype/ft2demos-%{version}.tar.xz
Source3:        ftconfig.h
#from tests/scripts/download-test-fonts.py:https://github.com/python-pillow/Pillow/files/6622147/As.I.Lay.Dying.zip
Source4:        As.I.Lay.Dying.ttf

Patch1:         freetype-2.13.2-include-header.patch
Patch6000:      backport-freetype-2.3.0-enable-spr.patch
Patch6001:      backport-freetype-2.2.1-enable-valid.patch
Patch6002:      backport-freetype-2.10.0-internal-outline.patch
Patch6003:      backport-freetype-2.10.1-debughook.patch

BuildRequires: gcc meson >= 0.55.0
BuildRequires: pkgconfig(bzip2)
BuildRequires: pkgconfig(libbrotlidec)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(zlib)
%if %{with harfbuzz}
BuildRequires: pkgconfig(harfbuzz) >= 2.0.0
%endif

Provides:       %{name}-bytecode = %{version}-%{release}
%if %{?_with_subpixel_rendering:1}%{!?_with_subpixel_rendering:0}
Provides:       %{name}-subpixel = %{version}-%{release}
%endif

%description
FreeType is written in C, designed to be small,efficient, highly customizable, and portable while capable of producing high-quality
output (glyph images) of most vector and bitmap font formats

%package demos 
Summary: A collection of freetype demos 
Requires: %{name} = %{version}-%{release} 

%description demos 
The FreeType engine is a free and portable font rendering engine,developed to provide advanced font support for a variety of platforms and environments.The demos package includes a set of useful small utilities showing various capabilities of the FreeType library.

%package        devel
Summary:        FreeType development libraries and header files
Requires:       %{name} = %{version}-%{release}

%description    devel
The freetype-devel package includes the static libraries and header files
for the FreeType font rendering engine.Install freetype-devel if you want to develop programs which will use
FreeType.

%package_help

%prep
%autosetup -b 1 -a 2 -p1

pushd ft2demos-%{version}
tar xf %{S:0}
mv %{name}-%{version} subprojects/freetype2
popd

%build
%meson  -Dtests=enabled \
	-Dbrotli=enabled \
	-Dbzip2=enabled \
	-Dpng=enabled \
	-Dzlib=system \
%if %{with harfbuzz}
	-Dharfbuzz=enabled \
%else
	-Dharfbuzz=disabled \
%endif
%{nil}
%meson_build

pushd ft2demos-%{version}
%meson -Dfreetype2:default_library=shared \
	-Dlibrsvg=disabled \
%if %{with harfbuzz}
	-Dfreetype2:harfbuzz=enabled \
%else
	-Dfreetype2:harfbuzz=disabled \
%endif
%{nil}
%meson_build
popd

%install
%meson_install

mkdir -p %{buildroot}/%{_bindir}
mkdir -p %{buildroot}/%{_mandir}/man1

{
  for ftdemo in ftbench ftchkwd ftmemchk ftpatchk fttimer ftdump ftlint ftmemchk ftvalid ttdebug ; do
      install -m 755 ft2demos-%{version}/%{_vpath_builddir}/$ftdemo %{buildroot}/%{_bindir}
  done
  install ft2demos-%{version}/man/{ftbench.1,ftdump.1,ftlint.1,ftvalid.1,ttdebug.1} %{buildroot}/%{_mandir}/man1
}

%if %{with_xfree86}
{
  for ftdemo in ftdiff ftgamma ftgrid ftmulti ftsdf ftstring ftview ; do
      install -m 755 ft2demos-%{version}/%{_vpath_builddir}/$ftdemo %{buildroot}/%{_bindir}
      install ft2demos-%{version}/man/$ftdemo.1 %{buildroot}/%{_mandir}/man1
  done
}
%endif

%define wordsize %{__isa_bits}

mv $RPM_BUILD_ROOT%{_includedir}/freetype2/freetype/config/ftconfig.h \
   $RPM_BUILD_ROOT%{_includedir}/freetype2/freetype/config/ftconfig-%{wordsize}.h
install -p -m 644 %{S:3} $RPM_BUILD_ROOT%{_includedir}/freetype2/freetype/config/ftconfig.h

%triggerpostun -- freetype < 2.0.5-3
{
  # ttmkfdir updated - as of 2.0.5-3, on upgrades we need xfs to regenerate
  # things to get the iso10646-1 encoding listed.
  for I in %{_datadir}/fonts/*/TrueType /usr/share/X11/fonts/TTF; do
      [ -d $I ] && [ -f $I/fonts.scale ] && [ -f $I/fonts.dir ] && touch $I/fonts.scale
  done
  exit 0
}

%check
mkdir -p tests/data
cp %{S:4} tests/data/
%meson_test

%files
%license LICENSE.TXT docs/FTL.TXT docs/GPLv2.TXT
%{_libdir}/libfreetype.so.*

%files demos 
%{_bindir}/ft*
%{_bindir}/ttdebug

%files devel
%{_datadir}/aclocal/freetype2.m4
%{_includedir}/freetype2/*
%{_libdir}/libfreetype.so
%{_libdir}/pkgconfig/freetype2.pc

%files help
%doc docs/design
%doc docs/glyphs
%doc docs/reference
%doc docs/tutorial
%doc docs/CHANGES docs/formats.txt docs/ft2faq.html
%doc ChangeLog README
%{_mandir}/man1/*

%changelog
* Mon Aug 12 2024 Funda Wang <fundawang@yeah.net> - 2.13.3-1
- update to 2.13.3
- build with meson

* Sun Aug 11 2024 Funda Wang <fundawang@yeah.net> - 2.13.2-2
- Cleanup spec
- Conditioned build harfbuzz support

* Thu Dec 28 2023 Paul Thomas <paulthomas100199@gmail.com> - 2.13.2-1
- update to version 2.13.2

* Wed Sep 20 2023 zhouwenpei <zhouwenpei1@h-partners.com> - 2.13.1-2
- enable check

* Fri Jul 14 2023 zhangpan <zhangpan103@h-partners.com> - 2.13.1-1
- update to 2.13.1

* Mon Apr 17 2023 zhouwenpei <zhouwenpei1@h-partners.com> - 2.12.1-2
- fix CVE-2023-2004

* Tue Nov 29 2022 zhouwenpei <zhouwenpei1@h-partners.com> - 2.12.1-1
- update to 2.12.1

* Sat May 14 2022 wangkerong <wangkerong@h-partners.com> - 2.11.0-3
- fix CVE-2022-27454,CVE-2022-27455,CVE-2022-27456

* Thu Dec 09 2021 dongyuzhen <dongyuzhen@huawei.com> - 2.11.0-2
- detach a demos package
- fix the patch name 

* Wed Dec 08 2021 dongyuzhen <dongyuzhen@huawei.com> - 2.11.0-1
- update to 2.11.0

* Tue Apr 13 2021 hanhui<hanhui15@huawei.com> - 2.10.2-3
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:add community patches

* Tue Dec 08 2020 zhanzhimin <zhanzhimin@huawei.com> - 2.10.2-2
- Type:CVE
- CVE:CVE-2020-15999
- SUG:NA
- DESC:fix CVE-2020-15999

* Mon Jul 20 2020 wangye <wangye70@huawei.com> - 2.10.2-1
- Type:enhancement
- Id:NA
- SUG:NA
- DESC:version update to 2.10.2

* Tue Jan 14 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.9.1-5
- Type:enhancement
- Id:NA
- SUG:NA
- DESC:optimization the spec

* Sat Jan 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.9.1-4
- Type:enhancement
- Id:NA
- SUG:NA
- DESC:optimization the spec

* Wed Sep 11 2019 openEuler jimmy<dukaitian@huawei.com> - 2.9.1-3
- Package init jimmy