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 Patch2: api-breakage.patch
30 URL: https://libgd.github.io/
31 BuildRequires: autoconf >= 2.54
32 BuildRequires: automake
33 %{?with_fontconfig:BuildRequires: fontconfig-devel}
34 BuildRequires: freetype-devel >= 1:2.1.10
35 BuildRequires: gettext-tools
36 %{?with_avif:BuildRequires: libavif-devel >= 0.8.2}
37 %{?with_heif:BuildRequires: libheif-devel >= 1.7.0}
38 %{?with_libimagequant:BuildRequires: libimagequant-devel}
39 BuildRequires: libjpeg-devel
40 BuildRequires: libpng-devel >= 2:1.4.0
41 %{?with_raqm:BuildRequires: libraqm-devel}
42 BuildRequires: libtiff-devel >= 4
43 BuildRequires: libtool >= 2:2
44 BuildRequires: libwebp-devel >= 0.2.0
45 BuildRequires: pkgconfig
46 BuildRequires: sed >= 4
47 BuildRequires: tar >= 1:1.22
48 %{?with_xpm:BuildRequires: xorg-lib-libXpm-devel}
50 BuildRequires: zlib-devel
51 Requires: freetype >= 1:2.1.10
52 %{?with_avif:Requires: libavif >= 0.8.2}
53 %{?with_heif:Requires: libheif >= 1.7.0}
54 Provides: gd(gif) = %{version}-%{release}
55 # versioned by php version rotate_from_php code comes from
56 Provides: gd(imagerotate) = 5.2.0
57 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60 gd is the image manipulating library. It was created to allow graphs,
61 charts and the like to be generated on the fly for use on the World
62 wide Web, but is useful for any application in which custom images are
63 useful. It is not a paint program; it is a library. gd library creates
64 PNG, JPEG, GIF and WBMP images. PNG is a more compact format, and full
65 compression is available. JPEG works well with photographic images,
66 and is still more compatible with the major Web browsers than even PNG
67 is. WBMP is intended for wireless devices (not regular web browsers).
69 %description -l es.UTF-8
70 Esta es la biblioteca gd para el manejo de imágenes. Fue creada para
71 uso en la Web, creando gráficos automáticamente. Pero es útil para
72 cualquier programa que necesite de imágenes personalizados. No es un
73 programa de dibujo; es una biblioteca.
75 %description -l pl.UTF-8
76 gd to biblioteka do obróbki obrazów. Została stworzona, aby umożliwić
77 dynamiczne generowanie wykresów i podobnych rzeczy na potrzeby WWW,
78 ale może być przydatna także dla każdej aplikacji tworzącej własne
79 obrazy. Biblioteka ta pozwala na tworzenie plików graficznych w
80 formatach PNG, JPEG, GIF i WBMP. PNG jest zwartym formatem z
81 bezstratną kompresją. JPEG dobrze nadaje się do obrazów
82 fotograficznych i jest obsługiwany nawet przez więcej przeglądarek WWW
83 niż PNG. WBMP jest przeznaczony dla urządzeń bezprzewodowych (a nie
84 zwykłych przeglądarek WWW).
86 %description -l pt_BR.UTF-8
87 Esta é a biblioteca gd para manipulação de imagens. Ela foi criada
88 para uso na Web, gerando gráficos automaticamente. Mas é útil para
89 qualquer programa que precise de imagens personalizados. Não é um
90 programa de desenho; é uma biblioteca.
93 Summary: Development part of the GD library
94 Summary(es.UTF-8): Archivos de inclusión y bibliotecas para desarrollar programas usando gd
95 Summary(pl.UTF-8): Część biblioteki GD przeznaczona dla developerów
96 Summary(pt_BR.UTF-8): Arquivos de inclusão e bibliotecas para desenvolver programas usando gd
97 Group: Development/Libraries
98 Requires: %{name} = %{version}-%{release}
99 Requires: fontconfig-devel
100 Requires: freetype-devel >= 1:2.1.10
101 %{?with_avif:Requires: libavif-devel >= 0.8.2}
102 %{?with_heif:Requires: libheif-devel >= 1.7.0}
103 %{?with_libimagequant:Requires: libimagequant-devel}
104 Requires: libjpeg-devel
105 Requires: libpng-devel
106 %{?with_raqm:Requires: libraqm-devel}
107 Requires: libtiff-devel >= 4
108 Requires: libwebp-devel >= 0.2.0
109 %{?with_xpm:Requires: xorg-lib-libXpm-devel}
111 Provides: gd-devel(gif) = %{version}-%{release}
112 Provides: gd-devel(imagerotate) = 5.2.0
115 This package contains the files needed for development of programs
118 %description devel -l es.UTF-8
119 Este paquete contiene los archivos de inclusión y las bibliotecas
120 necesarias para desarrollar programas usando gd.
122 %description devel -l pl.UTF-8
123 Pakiet ten zawiera pliki potrzebne do rozwoju programów korzystających
126 %description devel -l pt_BR.UTF-8
127 Este pacote contém os arquivos de inclusão e as bibliotecas
128 necessárias para desenvolver programas usando gd.
131 Summary: Static GD library
132 Summary(pl.UTF-8): Statyczna biblioteka GD
133 Summary(pt_BR.UTF-8): Bibliotecas estáticas para desenvolvimento com libgd
134 Group: Development/Libraries
135 Requires: %{name}-devel = %{version}-%{release}
136 Provides: gd-static(gif) = %{version}-%{release}
137 Provides: gd-static(imagerotate) = 5.2.0
140 This package contains static gd library.
142 %description static -l pl.UTF-8
143 Ten pakiet zawiera statyczną bibliotekę gd.
145 %description static -l pt_BR.UTF-8
146 Este pacote contem bibliotecas estáticas para desenvolvimento com
150 Summary: Utility programs that use libgd
151 Summary(es.UTF-8): Programas utilitarios libgd
152 Summary(pl.UTF-8): Narzędzia używające libgd
153 Summary(pt_BR.UTF-8): Programas utilitários libgd
154 Group: Applications/Graphics
155 Requires: %{name} = %{version}-%{release}
158 These are utility programs supplied with gd, the image manipulation
159 library. The libgd-progs package contains a group of scripts for
160 manipulating the graphics files in formats which are supported by the
163 %description progs -l pl.UTF-8
164 Ten pakiet zawiera programy używające biblioteki gd, służące do
165 obróbki plików graficznych w formatach obsługiwanych przez libgd.
167 %description progs -l pt_BR.UTF-8
168 Este pacote inclui vários utilitários para manipulação de arquivos gd
169 para uso pelos programas que usam a libgd.
172 %setup -q -n libgd-%{version}
185 CFLAGS="%{rpmcflags} -msse -mfpmath=sse"
189 --enable-gd-formats \
190 %{!?with_avif:--without-avif} \
191 %{!?with_fontconfig:--without-fontconfig} \
192 %{!?with_heif:--without-heif} \
193 %{!?with_libimagequant:--without-liq} \
194 %{!?with_raqm:--without-raqm} \
195 %{!?with_xpm:--without-xpm}
200 # https://github.com/libgd/libgd/issues/359
201 XFAIL_TESTS="$XFAIL_TESTS gdimagegrayscale/basic"
203 # 387 arithmetic is inexact, https://github.com/libgd/libgd/issues/242
204 XFAIL_TESTS="$XFAIL_TESTS gdimagecopyresampled/bug00201"
208 # https://github.com/libgd/libgd/issues/613
209 XFAIL_TESTS="$XFAIL_TESTS gdimagestringft/gdimagestringft_bbox"
216 rm -rf $RPM_BUILD_ROOT
219 DESTDIR=$RPM_BUILD_ROOT
221 # obsoleted by pkg-config
222 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgd.la
225 rm -rf $RPM_BUILD_ROOT
227 %post -p /sbin/ldconfig
228 %postun -p /sbin/ldconfig
231 %defattr(644,root,root,755)
232 %doc CONTRIBUTORS COPYING README.md
233 %attr(755,root,root) %{_libdir}/libgd.so.*.*.*
234 %attr(755,root,root) %ghost %{_libdir}/libgd.so.3
237 %defattr(644,root,root,755)
238 %attr(755,root,root) %{_libdir}/libgd.so
240 %{_pkgconfigdir}/gdlib.pc
243 %defattr(644,root,root,755)
247 %defattr(644,root,root,755)
248 %attr(755,root,root) %{_bindir}/annotate
249 %attr(755,root,root) %{_bindir}/bdftogd
250 %attr(755,root,root) %{_bindir}/gd2copypal
251 %attr(755,root,root) %{_bindir}/gd2togif
252 %attr(755,root,root) %{_bindir}/gd2topng
253 %attr(755,root,root) %{_bindir}/gdcmpgif
254 %attr(755,root,root) %{_bindir}/gdparttopng
255 %attr(755,root,root) %{_bindir}/gdtopng
256 %attr(755,root,root) %{_bindir}/giftogd2
257 %attr(755,root,root) %{_bindir}/pngtogd
258 %attr(755,root,root) %{_bindir}/pngtogd2
259 %attr(755,root,root) %{_bindir}/webpng