]>
Commit | Line | Data |
---|---|---|
0fe9ae1e | 1 | # |
f50b7aa0 | 2 | # Conditional build: |
96bb8f70 | 3 | %bcond_without fontconfig # fontconfig support |
35d1d5c8 JB |
4 | %bcond_with libimagequant # LIQ quantization method support (breaks transparency in TrueColor->palette conversion) |
5 | %bcond_with sse # SSE math on ix86 | |
96bb8f70 JB |
6 | %bcond_without xpm # XPM support (requires X11 libs) |
7 | %bcond_without tests # "make check" | |
0fe9ae1e | 8 | # |
35d1d5c8 | 9 | %ifarch pentium3 pentium4 |
03167d1a | 10 | %define with_sse 1 |
35d1d5c8 | 11 | %endif |
a8cb6661 | 12 | Summary: Library for PNG, JPEG creation |
276f8082 ER |
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 | |
bf525458 | 16 | Name: gd |
8688bbfb | 17 | Version: 2.2.5 |
75d12200 | 18 | Release: 5 |
f5fd6f82 | 19 | License: BSD-like |
bf525458 | 20 | Group: Libraries |
6d88d861 | 21 | #Source0Download: https://github.com/libgd/libgd/releases |
35d1d5c8 | 22 | Source0: https://github.com/libgd/libgd/releases/download/%{name}-%{version}/lib%{name}-%{version}.tar.xz |
8688bbfb | 23 | # Source0-md5: 8d8d6a6189513ecee6e893b1fb109bf8 |
f0e7dffb | 24 | Patch0: %{name}-fontpath.patch |
331e1f00 | 25 | Patch2: %{name}-loop.patch |
35d1d5c8 | 26 | Patch3: %{name}-liq.patch |
f510b224 AM |
27 | Patch4: 0004-Fix-OOB-read-due-to-crafted-GD-GD2-images.patch |
28 | Patch5: 0005-Fix-tiff_invalid_read-check.patch | |
29 | Patch6: bmp-check-return-value-in-gdImageBmpPtr.patch | |
805d039a AM |
30 | Patch7: gd-2.2.5-heap-based-buffer-overflow.patch |
31 | Patch8: gd-2.2.5-null-pointer.patch | |
32 | Patch9: gd-2.2.5-potential-double-free.patch | |
33 | Patch10: gd-2.2.5-upstream.patch | |
35d1d5c8 | 34 | URL: https://libgd.github.io/ |
91cfdb36 | 35 | BuildRequires: autoconf >= 2.54 |
b2f653fd | 36 | BuildRequires: automake |
2d7c1ea5 | 37 | %{?with_fontconfig:BuildRequires: fontconfig-devel} |
c07f68a0 | 38 | BuildRequires: freetype-devel >= 1:2.1.10 |
eb0980be | 39 | BuildRequires: gettext-tools |
010b44d6 | 40 | %{?with_libimagequant:BuildRequires: libimagequant-devel} |
c0a00bcf | 41 | BuildRequires: libjpeg-devel |
0f4482da | 42 | BuildRequires: libpng-devel >= 2:1.4.0 |
331e1f00 JB |
43 | BuildRequires: libtiff-devel >= 4 |
44 | BuildRequires: libtool >= 2:2 | |
35d1d5c8 | 45 | BuildRequires: libwebp-devel |
331e1f00 JB |
46 | BuildRequires: pkgconfig |
47 | BuildRequires: sed >= 4 | |
48 | BuildRequires: tar >= 1:1.22 | |
ab0e31ee | 49 | %{?with_xpm:BuildRequires: xorg-lib-libXpm-devel} |
331e1f00 | 50 | BuildRequires: xz |
96d1fc3c | 51 | BuildRequires: zlib-devel |
c07f68a0 | 52 | Requires: freetype >= 1:2.1.10 |
f0e7dffb | 53 | Provides: gd(gif) = %{version}-%{release} |
04a4831a JB |
54 | # versioned by php version rotate_from_php code comes from |
55 | Provides: gd(imagerotate) = 5.2.0 | |
60d61c9a | 56 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
64f72052 | 57 | |
cb954d5c | 58 | %description |
0fe9ae1e JB |
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 | |
f0e7dffb JB |
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). | |
cb954d5c | 67 | |
0a1333ac JR |
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 | |
b2f4bbcd | 72 | programa de dibujo; es una biblioteca. |
73 | ||
0a1333ac JR |
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 | |
f0e7dffb | 79 | formatach PNG, JPEG, GIF i WBMP. PNG jest zwartym formatem z |
0a1333ac JR |
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). | |
10511b86 | 84 | |
0a1333ac JR |
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. | |
b2f4bbcd | 90 | |
cb954d5c | 91 | %package devel |
bf525458 | 92 | Summary: Development part of the GD library |
276f8082 ER |
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 | |
bf525458 | 96 | Group: Development/Libraries |
f50b7aa0 | 97 | Requires: %{name} = %{version}-%{release} |
5dc4c1e0 | 98 | Requires: fontconfig-devel |
c07f68a0 | 99 | Requires: freetype-devel >= 1:2.1.10 |
010b44d6 | 100 | %{?with_libimagequant:Requires: libimagequant-devel} |
0fe9ae1e | 101 | Requires: libjpeg-devel |
bd2f5b37 | 102 | Requires: libpng-devel |
331e1f00 | 103 | Requires: libtiff-devel >= 4 |
35d1d5c8 | 104 | Requires: libwebp-devel |
ab0e31ee | 105 | %{?with_xpm:Requires: xorg-lib-libXpm-devel} |
bd2f5b37 | 106 | Requires: zlib-devel |
f0e7dffb | 107 | Provides: gd-devel(gif) = %{version}-%{release} |
04a4831a | 108 | Provides: gd-devel(imagerotate) = 5.2.0 |
cb954d5c | 109 | |
110 | %description devel | |
ad076400 | 111 | This package contains the files needed for development of programs |
112 | linked against GD. | |
cb954d5c | 113 | |
0a1333ac JR |
114 | %description devel -l es.UTF-8 |
115 | Este paquete contiene los archivos de inclusión y las bibliotecas | |
b2f4bbcd | 116 | necesarias para desarrollar programas usando gd. |
117 | ||
0a1333ac JR |
118 | %description devel -l pl.UTF-8 |
119 | Pakiet ten zawiera pliki potrzebne do rozwoju programów korzystających | |
76d4466d | 120 | z biblioteki GD. |
10511b86 | 121 | |
0a1333ac JR |
122 | %description devel -l pt_BR.UTF-8 |
123 | Este pacote contém os arquivos de inclusão e as bibliotecas | |
124 | necessárias para desenvolver programas usando gd. | |
b2f4bbcd | 125 | |
e4dcaf92 | 126 | %package static |
76d4466d | 127 | Summary: Static GD library |
276f8082 ER |
128 | Summary(pl.UTF-8): Statyczna biblioteka GD |
129 | Summary(pt_BR.UTF-8): Bibliotecas estáticas para desenvolvimento com libgd | |
76d4466d | 130 | Group: Development/Libraries |
f50b7aa0 | 131 | Requires: %{name}-devel = %{version}-%{release} |
f0e7dffb | 132 | Provides: gd-static(gif) = %{version}-%{release} |
04a4831a | 133 | Provides: gd-static(imagerotate) = 5.2.0 |
cb954d5c | 134 | |
777cca0f | 135 | %description static |
0fe9ae1e | 136 | This package contains static gd library. |
b2f4bbcd | 137 | |
0a1333ac JR |
138 | %description static -l pl.UTF-8 |
139 | Ten pakiet zawiera statyczną bibliotekę gd. | |
e4dcaf92 | 140 | |
0a1333ac JR |
141 | %description static -l pt_BR.UTF-8 |
142 | Este pacote contem bibliotecas estáticas para desenvolvimento com | |
b2f4bbcd | 143 | libgd. |
144 | ||
e81f3f85 | 145 | %package progs |
146 | Summary: Utility programs that use libgd | |
276f8082 ER |
147 | Summary(es.UTF-8): Programas utilitarios libgd |
148 | Summary(pl.UTF-8): Narzędzia używające libgd | |
149 | Summary(pt_BR.UTF-8): Programas utilitários libgd | |
e81f3f85 | 150 | Group: Applications/Graphics |
f50b7aa0 | 151 | Requires: %{name} = %{version}-%{release} |
e81f3f85 | 152 | |
153 | %description progs | |
0fe9ae1e | 154 | These are utility programs supplied with gd, the image manipulation |
26e69c10 | 155 | library. The libgd-progs package contains a group of scripts for |
156 | manipulating the graphics files in formats which are supported by the | |
157 | libgd library. | |
b2f4bbcd | 158 | |
0a1333ac JR |
159 | %description progs -l pl.UTF-8 |
160 | Ten pakiet zawiera programy używające biblioteki gd, służące do | |
161 | obróbki plików graficznych w formatach obsługiwanych przez libgd. | |
e81f3f85 | 162 | |
0a1333ac JR |
163 | %description progs -l pt_BR.UTF-8 |
164 | Este pacote inclui vários utilitários para manipulação de arquivos gd | |
b2f4bbcd | 165 | para uso pelos programas que usam a libgd. |
166 | ||
e4dcaf92 | 167 | %prep |
331e1f00 | 168 | %setup -q -n libgd-%{version} |
f0e7dffb | 169 | %patch0 -p1 |
0f4482da | 170 | %patch2 -p1 |
6d49f979 | 171 | %patch3 -p1 |
f510b224 AM |
172 | %patch4 -p1 |
173 | %patch5 -p1 | |
174 | %patch6 -p1 | |
175 | %patch7 -p1 | |
75d12200 AM |
176 | %patch8 -p1 |
177 | %patch9 -p1 | |
178 | %patch10 -p1 | |
11a3aa5c | 179 | |
6eb2ae1b | 180 | # hack to avoid inclusion of -s in --ldflags |
331e1f00 JB |
181 | %{__sed} -i -e 's,@LDFLAGS@,,g' config/gdlib-config.in |
182 | # disable error caused by subdir-objects warning in automake 1.14 | |
183 | %{__sed} -i -e '/AM_INIT_AUTOMAKE/s/-Werror//' configure.ac | |
76b282ae | 184 | |
e4dcaf92 | 185 | %build |
dfe01bee | 186 | %{__libtoolize} |
6de95af7 | 187 | %{__aclocal} |
1b927a19 | 188 | %{__automake} |
f0e7dffb | 189 | %{__autoheader} |
1b927a19 | 190 | %{__autoconf} |
35d1d5c8 JB |
191 | %ifarch %{ix86} |
192 | %if %{with sse} | |
193 | CFLAGS="%{rpmcflags} -msse -mfpmath=sse" | |
194 | %endif | |
195 | %endif | |
2d7c1ea5 JB |
196 | %configure \ |
197 | %{!?with_fontconfig:--without-fontconfig} \ | |
35d1d5c8 | 198 | %{!?with_libimagequant:--without-liq} \ |
2d7c1ea5 | 199 | %{!?with_xpm:--without-xpm} |
b7b66453 | 200 | %{__make} |
1bb411e9 | 201 | |
ed2c47fe | 202 | %if %{with tests} |
35d1d5c8 | 203 | %ifarch %{ix86} |
7f9a7b01 JB |
204 | # https://github.com/libgd/libgd/issues/359 |
205 | XFAIL_TESTS="$XFAIL_TESTS gdimagegrayscale/basic" | |
03167d1a | 206 | %if %{without sse} |
35d1d5c8 JB |
207 | # 387 arithmetic is inexact, https://github.com/libgd/libgd/issues/242 |
208 | XFAIL_TESTS="$XFAIL_TESTS gdimagecopyresampled/bug00201 gdimagerotate/bug00067" | |
209 | %endif | |
210 | %endif | |
35d1d5c8 | 211 | export XFAIL_TESTS |
ed2c47fe AM |
212 | %{__make} check |
213 | %endif | |
6f5b880e | 214 | |
cb954d5c | 215 | %install |
b7b66453 | 216 | rm -rf $RPM_BUILD_ROOT |
ad076400 | 217 | |
2260ee2f | 218 | %{__make} install \ |
e87e503b | 219 | DESTDIR=$RPM_BUILD_ROOT |
ad076400 | 220 | |
cb954d5c | 221 | %clean |
d2ddf380 | 222 | rm -rf $RPM_BUILD_ROOT |
cb954d5c | 223 | |
e87e503b | 224 | %post -p /sbin/ldconfig |
cb954d5c | 225 | %postun -p /sbin/ldconfig |
226 | ||
227 | %files | |
e4dcaf92 | 228 | %defattr(644,root,root,755) |
7f9a7b01 | 229 | %doc CONTRIBUTORS COPYING README.md |
04a4831a | 230 | %attr(755,root,root) %{_libdir}/libgd.so.*.*.* |
331e1f00 | 231 | %attr(755,root,root) %ghost %{_libdir}/libgd.so.3 |
cb954d5c | 232 | |
233 | %files devel | |
bf525458 | 234 | %defattr(644,root,root,755) |
bd13356b | 235 | %attr(755,root,root) %{_bindir}/gdlib-config |
04a4831a JB |
236 | %attr(755,root,root) %{_libdir}/libgd.so |
237 | %{_libdir}/libgd.la | |
45d93025 JB |
238 | %{_includedir}/entities.h |
239 | %{_includedir}/gd*.h | |
331e1f00 | 240 | %{_pkgconfigdir}/gdlib.pc |
e4dcaf92 | 241 | |
b2f653fd | 242 | %files static |
243 | %defattr(644,root,root,755) | |
04a4831a | 244 | %{_libdir}/libgd.a |
e81f3f85 | 245 | |
246 | %files progs | |
247 | %defattr(644,root,root,755) | |
45d93025 JB |
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 |