3 %bcond_without avif # AVIF support via libavif
4 %bcond_without fontconfig # fontconfig support
5 %bcond_without heif # HEIF support via libheif
6 %bcond_with libimagequant # LIQ quantization method support (breaks transparency in TrueColor->palette conversion)
7 %bcond_without raqm # RAQM complex text layout support
8 %bcond_with sse # SSE math on ix86
9 %bcond_without xpm # XPM support (requires X11 libs)
10 %bcond_without tests # "make check"
12 %ifarch pentium3 pentium4
15 Summary: Library for PNG, JPEG creation
16 Summary(es.UTF-8): Biblioteca para manipulación de imágenes
17 Summary(pl.UTF-8): Biblioteka do tworzenia grafiki w formacie PNG, JPEG
18 Summary(pt_BR.UTF-8): Biblioteca para manipulação de imagens
24 #Source0Download: https://github.com/libgd/libgd/releases
25 Source0: https://github.com/libgd/libgd/releases/download/%{name}-%{version}/lib%{name}-%{version}.tar.xz
26 # Source0-md5: 7a58b54d375eda236414201252a0ee3c
27 Patch0: %{name}-fontpath.patch
28 Patch1: %{name}-loop.patch
29 URL: https://libgd.github.io/
30 BuildRequires: autoconf >= 2.54
31 BuildRequires: automake
32 %{?with_fontconfig:BuildRequires: fontconfig-devel}
33 BuildRequires: freetype-devel >= 1:2.1.10
34 BuildRequires: gettext-tools
35 %{?with_avif:BuildRequires: libavif-devel >= 0.8.2}
36 %{?with_heif:BuildRequires: libheif-devel >= 1.7.0}
37 %{?with_libimagequant:BuildRequires: libimagequant-devel}
38 BuildRequires: libjpeg-devel
39 BuildRequires: libpng-devel >= 2:1.4.0
40 %{?with_raqm:BuildRequires: libraqm-devel}
41 BuildRequires: libtiff-devel >= 4
42 BuildRequires: libtool >= 2:2
43 BuildRequires: libwebp-devel
44 BuildRequires: pkgconfig
45 BuildRequires: sed >= 4
46 BuildRequires: tar >= 1:1.22
47 %{?with_xpm:BuildRequires: xorg-lib-libXpm-devel}
49 BuildRequires: zlib-devel
50 Requires: freetype >= 1:2.1.10
51 %{?with_avif:Requires: libavif >= 0.8.2}
52 %{?with_heif:Requires: libheif >= 1.7.0}
53 Provides: gd(gif) = %{version}-%{release}
54 # versioned by php version rotate_from_php code comes from
55 Provides: gd(imagerotate) = 5.2.0
56 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59 gd is the image manipulating library. It was created to allow graphs,
60 charts and the like to be generated on the fly for use on the World
61 wide Web, but is useful for any application in which custom images are
62 useful. It is not a paint program; it is a library. gd library creates
63 PNG, JPEG, GIF and WBMP images. PNG is a more compact format, and full
64 compression is available. JPEG works well with photographic images,
65 and is still more compatible with the major Web browsers than even PNG
66 is. WBMP is intended for wireless devices (not regular web browsers).
68 %description -l es.UTF-8
69 Esta es la biblioteca gd para el manejo de imágenes. Fue creada para
70 uso en la Web, creando gráficos automáticamente. Pero es útil para
71 cualquier programa que necesite de imágenes personalizados. No es un
72 programa de dibujo; es una biblioteca.
74 %description -l pl.UTF-8
75 gd to biblioteka do obróbki obrazów. Została stworzona, aby umożliwić
76 dynamiczne generowanie wykresów i podobnych rzeczy na potrzeby WWW,
77 ale może być przydatna także dla każdej aplikacji tworzącej własne
78 obrazy. Biblioteka ta pozwala na tworzenie plików graficznych w
79 formatach PNG, JPEG, GIF i WBMP. PNG jest zwartym formatem z
80 bezstratną kompresją. JPEG dobrze nadaje się do obrazów
81 fotograficznych i jest obsługiwany nawet przez więcej przeglądarek WWW
82 niż PNG. WBMP jest przeznaczony dla urządzeń bezprzewodowych (a nie
83 zwykłych przeglądarek WWW).
85 %description -l pt_BR.UTF-8
86 Esta é a biblioteca gd para manipulação de imagens. Ela foi criada
87 para uso na Web, gerando gráficos automaticamente. Mas é útil para
88 qualquer programa que precise de imagens personalizados. Não é um
89 programa de desenho; é uma biblioteca.
92 Summary: Development part of the GD library
93 Summary(es.UTF-8): Archivos de inclusión y bibliotecas para desarrollar programas usando gd
94 Summary(pl.UTF-8): Część biblioteki GD przeznaczona dla developerów
95 Summary(pt_BR.UTF-8): Arquivos de inclusão e bibliotecas para desenvolver programas usando gd
96 Group: Development/Libraries
97 Requires: %{name} = %{version}-%{release}
98 Requires: fontconfig-devel
99 Requires: freetype-devel >= 1:2.1.10
100 %{?with_avif:Requires: libavif-devel >= 0.8.2}
101 %{?with_heif:Requires: libheif-devel >= 1.7.0}
102 %{?with_libimagequant:Requires: libimagequant-devel}
103 Requires: libjpeg-devel
104 Requires: libpng-devel
105 %{?with_raqm:Requires: libraqm-devel}
106 Requires: libtiff-devel >= 4
107 Requires: libwebp-devel
108 %{?with_xpm:Requires: xorg-lib-libXpm-devel}
110 Provides: gd-devel(gif) = %{version}-%{release}
111 Provides: gd-devel(imagerotate) = 5.2.0
114 This package contains the files needed for development of programs
117 %description devel -l es.UTF-8
118 Este paquete contiene los archivos de inclusión y las bibliotecas
119 necesarias para desarrollar programas usando gd.
121 %description devel -l pl.UTF-8
122 Pakiet ten zawiera pliki potrzebne do rozwoju programów korzystających
125 %description devel -l pt_BR.UTF-8
126 Este pacote contém os arquivos de inclusão e as bibliotecas
127 necessárias para desenvolver programas usando gd.
130 Summary: Static GD library
131 Summary(pl.UTF-8): Statyczna biblioteka GD
132 Summary(pt_BR.UTF-8): Bibliotecas estáticas para desenvolvimento com libgd
133 Group: Development/Libraries
134 Requires: %{name}-devel = %{version}-%{release}
135 Provides: gd-static(gif) = %{version}-%{release}
136 Provides: gd-static(imagerotate) = 5.2.0
139 This package contains static gd library.
141 %description static -l pl.UTF-8
142 Ten pakiet zawiera statyczną bibliotekę gd.
144 %description static -l pt_BR.UTF-8
145 Este pacote contem bibliotecas estáticas para desenvolvimento com
149 Summary: Utility programs that use libgd
150 Summary(es.UTF-8): Programas utilitarios libgd
151 Summary(pl.UTF-8): Narzędzia używające libgd
152 Summary(pt_BR.UTF-8): Programas utilitários libgd
153 Group: Applications/Graphics
154 Requires: %{name} = %{version}-%{release}
157 These are utility programs supplied with gd, the image manipulation
158 library. The libgd-progs package contains a group of scripts for
159 manipulating the graphics files in formats which are supported by the
162 %description progs -l pl.UTF-8
163 Ten pakiet zawiera programy używające biblioteki gd, służące do
164 obróbki plików graficznych w formatach obsługiwanych przez libgd.
166 %description progs -l pt_BR.UTF-8
167 Este pacote inclui vários utilitários para manipulação de arquivos gd
168 para uso pelos programas que usam a libgd.
171 %setup -q -n libgd-%{version}
183 CFLAGS="%{rpmcflags} -msse -mfpmath=sse"
187 %{!?with_avif:--without-avif} \
188 %{!?with_fontconfig:--without-fontconfig} \
189 %{!?with_heif:--without-heif} \
190 %{!?with_libimagequant:--without-liq} \
191 %{!?with_raqm:--without-raqm} \
192 %{!?with_xpm:--without-xpm}
197 # https://github.com/libgd/libgd/issues/359
198 XFAIL_TESTS="$XFAIL_TESTS gdimagegrayscale/basic"
200 # 387 arithmetic is inexact, https://github.com/libgd/libgd/issues/242
201 XFAIL_TESTS="$XFAIL_TESTS gdimagecopyresampled/bug00201"
205 # https://github.com/libgd/libgd/issues/613
206 XFAIL_TESTS="$XFAIL_TESTS gdimagestringft/gdimagestringft_bbox"
213 rm -rf $RPM_BUILD_ROOT
216 DESTDIR=$RPM_BUILD_ROOT
219 rm -rf $RPM_BUILD_ROOT
221 %post -p /sbin/ldconfig
222 %postun -p /sbin/ldconfig
225 %defattr(644,root,root,755)
226 %doc CONTRIBUTORS COPYING README.md
227 %attr(755,root,root) %{_libdir}/libgd.so.*.*.*
228 %attr(755,root,root) %ghost %{_libdir}/libgd.so.3
231 %defattr(644,root,root,755)
232 %attr(755,root,root) %{_libdir}/libgd.so
235 %{_pkgconfigdir}/gdlib.pc
238 %defattr(644,root,root,755)
242 %defattr(644,root,root,755)
243 %attr(755,root,root) %{_bindir}/annotate
244 %attr(755,root,root) %{_bindir}/bdftogd
245 %attr(755,root,root) %{_bindir}/gd2copypal
246 %attr(755,root,root) %{_bindir}/gd2togif
247 %attr(755,root,root) %{_bindir}/gd2topng
248 %attr(755,root,root) %{_bindir}/gdcmpgif
249 %attr(755,root,root) %{_bindir}/gdparttopng
250 %attr(755,root,root) %{_bindir}/gdtopng
251 %attr(755,root,root) %{_bindir}/giftogd2
252 %attr(755,root,root) %{_bindir}/pngtogd
253 %attr(755,root,root) %{_bindir}/pngtogd2
254 %attr(755,root,root) %{_bindir}/webpng