--- /dev/null
+--- libgd-2.1.1/configure.ac.orig 2015-06-19 20:50:19.125019013 +0200
++++ libgd-2.1.1/configure.ac 2015-06-21 16:12:24.498467052 +0200
+@@ -154,6 +154,20 @@
+ fi
+ AM_CONDITIONAL([HAVE_LIBPNG], test "$with_png" = yes)
+
++dnl LIQ
++AC_ARG_WITH(libimagequant,dnl
++[ --with-libimagequant=DIR where to find the libimagequant library],
++ [if test -d "$withval"; then
++ LDFLAGS="$LDFLAGS -L$withval/lib"
++ CFLAGS="$CFLAGS -I$withval/include"
++ fi])
++
++if test "$with_libimagequant" != no; then
++ AC_CHECK_HEADER([libimagequant.h])
++ AC_CHECK_LIB(imagequant, liq_attr_create,
++ [LIBS="-limagequant $LIBS"])
++fi
++
+ dnl FreeType configure tests snarfed from libwmf ..
+ AC_ARG_WITH(freetype,dnl
+ [ --with-freetype=DIR where to find the freetype 2.x library]])
--- /dev/null
+--- libgd-2.1.1/config/getver.pl.orig 1970-01-01 01:00:00.000000000 +0100
++++ libgd-2.1.1/config/getver.pl 2015-06-19 20:37:05.518385651 +0200
+@@ -0,0 +1,42 @@
++#!/usr/bin/env perl
++
++# Simple script to extract the version number parts from src/gd.h. If
++# called with the middle word of the version macro, it prints the
++# value of that macro. If called with no argument, it outputs a
++# human-readable version string. This must be run in the project
++# root. It is used by configure.ac and docs/naturaldocs/run_docs.sh.
++
++use strict;
++
++my $key = shift;
++my @version_parts = ();
++
++open FH, "<src/gd.h" # old-style filehandle for max. portability
++ or die "Unable to open 'version.h' for reading.\n";
++
++while(<FH>) {
++ next unless m{version605b5d1778};
++ next unless /^#define\s+GD_([A-Z0-9]+)_VERSION+\s+(\S+)/;
++ my ($lk, $lv) = ($1, $2);
++ if ($lk eq $key) {
++ chomp $lv;
++ $lv =~ s/"//g;
++
++ print $lv; # no newline
++ exit(0); # success!
++ }
++
++ push @version_parts, $lv if (!$key);
++}
++
++close(FH);
++
++if (scalar @version_parts == 4) {
++ my $result = join(".", @version_parts[0..2]);
++ $result .= $version_parts[3];
++ $result =~ s/"//g;
++ print $result;
++ exit(0);
++}
++
++exit(1); # failure
--- /dev/null
+--- libgd-2.1.1/configure.ac.orig 2015-06-19 20:38:02.458383261 +0200
++++ libgd-2.1.1/configure.ac 2015-06-19 20:48:54.771689220 +0200
+@@ -27,6 +27,8 @@
+ GDLIB_REVISION=gd_REVISION
+ GDLIB_EXTRA=gd_EXTRA
+ GDLIB_VERSION=gd_PKG_VERSION
++AC_SUBST(GDLIB_MAJOR)
++AC_SUBST(GDLIB_MINOR)
+
+ # Dynamic library version information
+ # See http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info
#
# Conditional build:
%bcond_without fontconfig # fontconfig support
+%bcond_without libimagequant # LIQ quantization method support
%bcond_without xpm # XPM support (requires X11 libs)
%bcond_without tests # "make check"
#
Summary(pt_BR.UTF-8): Biblioteca para manipulação de imagens
Name: gd
Version: 2.1.1
-Release: 3
+Release: 4
License: BSD-like
Group: Libraries
#Source0Download: https://github.com/libgd/libgd/releases
Patch1: %{name}-2.0.33-BoxBound.patch
Patch2: %{name}-loop.patch
Patch3: libvpx2.patch
+Patch4: %{name}-missing.patch
+Patch5: %{name}-version.patch
+Patch6: %{name}-liq.patch
URL: http://www.libgd.org/
BuildRequires: autoconf >= 2.54
BuildRequires: automake
%{?with_fontconfig:BuildRequires: fontconfig-devel}
BuildRequires: freetype-devel >= 1:2.1.10
BuildRequires: gettext-tools
+%{?with_libimagequant:BuildRequires: libimagequant-devel}
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel >= 2:1.4.0
BuildRequires: libtiff-devel >= 4
Requires: %{name} = %{version}-%{release}
Requires: fontconfig-devel
Requires: freetype-devel >= 1:2.1.10
+%{?with_libimagequant:Requires: libimagequant-devel}
Requires: libjpeg-devel
Requires: libpng-devel
Requires: libtiff-devel >= 4
%patch1 -p1
%patch2 -p1
%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
# hack to avoid inclusion of -s in --ldflags
%{__sed} -i -e 's,@LDFLAGS@,,g' config/gdlib-config.in
%{__autoconf}
%configure \
%{!?with_fontconfig:--without-fontconfig} \
+ %{!?with_libimagequant:--without-libimagequant} \
%{!?with_xpm:--without-xpm}
%{__make}