## DT-Version in src/gd.h %global git_date 20241017 %global git_hash c2867fd5 %global git_ver 2.4.0 %global rel 1 %global src_name lib%{name}-%{git_date}-%{git_hash}.tar.xz %if 0%{?rhel} %bcond_with liq %bcond_with raqm %bcond_with avif %else # Enabled by default %bcond_without liq %bcond_without raqm %bcond_without avif %endif # Not available in Fedora, only in rpmfusion # Also see https://github.com/libgd/libgd/issues/678 segfault %bcond_with heif Summary: A graphics library for quick creation of PNG or JPEG images Name: gd Version: %{git_ver}^%{git_date}g%{git_hash} Release: %{rel}%{?dist} License: MIT URL: http://libgd.github.io/ Source0: %{url}/%{src_name} #Patch0: unused.patch BuildRequires: freetype-devel BuildRequires: fontconfig-devel BuildRequires: gettext-devel BuildRequires: libjpeg-devel BuildRequires: libpng-devel BuildRequires: libtiff-devel BuildRequires: libwebp-devel %if %{with liq} BuildRequires: libimagequant-devel %endif %if %{with raqm} BuildRequires: libraqm-devel %endif %if %{with avif} BuildRequires: libavif-devel %endif %if %{with heif} BuildRequires: libheif-devel %endif BuildRequires: libX11-devel BuildRequires: libXpm-devel BuildRequires: zlib-devel BuildRequires: pkgconfig BuildRequires: libtool BuildRequires: perl-interpreter BuildRequires: perl-generators BuildRequires: perl(FindBin) # for fontconfig/basic test BuildRequires: liberation-sans-fonts BuildRequires: make %description The gd graphics library allows your code to quickly draw images complete with lines, arcs, text, multiple colors, cut and paste from other images, and flood fills, and to write out the result as a PNG or JPEG file. This is particularly useful in Web applications, where PNG and JPEG are two of the formats accepted for inline images by most browsers. Note that gd is not a paint program. %package progs Requires: %{name}%{?_isa} = %{version}-%{release} Summary: Utility programs that use libgd %description progs The gd-progs package includes utility programs supplied with gd, a graphics library for creating PNG and JPEG images. %package devel Summary: The development libraries and header files for gd Requires: %{name}%{?_isa} = %{version}-%{release} Requires: freetype-devel%{?_isa} Requires: fontconfig-devel%{?_isa} Requires: libjpeg-devel%{?_isa} Requires: libpng-devel%{?_isa} Requires: libtiff-devel%{?_isa} Requires: libwebp-devel%{?_isa} Requires: libX11-devel%{?_isa} Requires: libXpm-devel%{?_isa} Requires: zlib-devel%{?_isa} %if %{with liq} Requires: libimagequant-devel%{?_isa} %endif %if %{with raqm} Requires: libraqm-devel %endif %if %{with avif} Requires: libavif-devel %endif %if %{with heif} Requires: libheif-devel %endif %description devel The gd-devel package contains the development libraries and header files for gd, a graphics library for creating PNG and JPEG graphics. %prep %autosetup -p1 -n libgd : $(perl config/getver.pl) : regenerate autotool stuff if [ -f configure ]; then libtoolize --copy --force autoreconf -vif else ./bootstrap.sh fi %build # Provide a correct default font search path CFLAGS="$RPM_OPT_FLAGS -DDEFAULT_FONTPATH='\"\ /usr/share/fonts/bitstream-vera:\ /usr/share/fonts/dejavu:\ /usr/share/fonts/default/Type1:\ /usr/share/X11/fonts/Type1:\ /usr/share/fonts/liberation\"'" %ifarch %{ix86} # see https://github.com/libgd/libgd/issues/242 CFLAGS="$CFLAGS -msse -mfpmath=sse" %endif %ifarch aarch64 ppc64 ppc64le s390 s390x # workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1359680 export CFLAGS="$CFLAGS -ffp-contract=off" %endif %configure \ --with-tiff=%{_prefix} \ --disable-rpath make %{?_smp_mflags} %install make install INSTALL='install -p' DESTDIR=$RPM_BUILD_ROOT rm -f $RPM_BUILD_ROOT/%{_libdir}/libgd.la rm -f $RPM_BUILD_ROOT/%{_libdir}/libgd.a %check # minor diff in size %if %{with raqm} XFAIL_TESTS="gdimagestringft/gdimagestringft_bbox" export XFAIL_TESTS %endif # Disable for now DT #: Upstream test suite #make check # : Check content of pkgconfig # grep %{version} $RPM_BUILD_ROOT%{_libdir}/pkgconfig/gdlib.pc %ldconfig_scriptlets %files %{!?_licensedir:%global license %%doc} %license COPYING %{_libdir}/*.so.* %files progs %{_bindir}/* %files devel %{_includedir}/* %{_libdir}/*.so %{_libdir}/pkgconfig/gdlib.pc %changelog %autochangelog