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