# Tests by default. No tests: rpm -ba --define 'dotests 0' *.spec %{!?dotests: %define dotests 1} %define _libdir64 %{_libdir}64 Summary: A graphics library for quick creation of PNG or JPEG images Name: libgd Version: 2.2.5 Release: 3 Group: System Environment/Libraries License: BSD-style URL: http://www.libgd.org/Main_Page Source0: http://www.libgd.org/releases/libgd-2.2.5.tar.gz Patch0: 0001-Fix-420-Potential-infinite-loop-in-gdImageCreateFrom.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: freetype2-devel >= 2.8, fontconfig-devel >= 2.5.0 BuildRequires: libjpeg-devel >= 9c-1, libpng-devel >= 1.6.27, zlib-devel >= 1.2.11, pkg-config BuildRequires: libwebp-devel >= 1.0.2 Requires: freetype2 >= 2.8, fontconfig >= 2.5.0 Requires: libjpeg >= 9c-1 Requires: libpng >= 1.6.27 Requires: zlib >= 1.2.11 Requires: libtiff >= 3.8.2 Requires: libiconv >= 1.14 Requires: libwebp >= 1.0.2 Requires: libgcc >= 6.3.0 %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. The library is available as 32-bit and 64-bit. %package progs Summary: Utility programs that use libgd Group: Applications/Multimedia BuildRequires: libwebp-devel >= 1.0.2 Requires: %{name} = %{version}-%{release} Requires: libwebp >= 1.0.2 Requires: libjpeg >= 9c-1 %description progs The gd-progs package includes utility programs supplied with gd, a graphics library for creating PNG and JPEG images. If you install these, you must also install gd. %package devel Summary: The development libraries and header files for gd Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: pkg-config, libjpeg-devel >= 9c-1 , freetype2-devel >= 2.3.5 Requires: libpng-devel >= 1.6.27, zlib-devel >= 1.2.11, fontconfig-devel >= 2.5.0 Requires: libwebp-devel >= 1.0.2 #Requires: libXpm-devel >= 3.5.7 %description devel The gd-devel package contains the development libraries and header files for gd, a graphics library for creating PNG and JPEG graphics. If you are compiling a 32-bit program, no special compiler options are needed. If you are compiling a 64-bit program, you have to compile and link your application with "cc -q64" or "gcc -maix64". %prep %setup -q %patch0 -p1 rm -rf /tmp/%{name}-%{version}-32bit cp -pr . /tmp/%{name}-%{version}-32bit rm -fr * mv /tmp/%{name}-%{version}-32bit 32bit cp -pr 32bit 64bit %build # setup environment for 32-bit and 64-bit builds export AR="/usr/bin/ar -X32_64" export NM="/usr/bin/nm -X32_64" # first build the 64-bit version cd 64bit export OBJECT_MODE=64 export CC="/opt/freeware/bin/gcc -maix64 -O2" export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -lpthread -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib" ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir64} \ --enable-static --enable-shared gmake %{?_smp_mflags} if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi cp ./src/.libs/libgd.so.3 . # build the 32-bit version cd ../32bit export OBJECT_MODE=32 export CC="/opt/freeware/bin/gcc -maix32 -O2 -D_LARGE_FILES" export LDFLAGS="-L/opt/freeware/lib -lpthread -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" ./configure \ --prefix=%{_prefix} \ --enable-static --enable-shared gmake %{?_smp_mflags} if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} # install on 64bit mode cd 64bit export OBJECT_MODE=64 make DESTDIR=${RPM_BUILD_ROOT} install /usr/bin/strip -X64 ${RPM_BUILD_ROOT}%{_bindir}/* || : ( cd ${RPM_BUILD_ROOT}/%{_prefix}/bin for fic in $(ls -1| grep -v -e _32 -e _64) do mv $fic "$fic"_64 done ) # install on 32bit mode cd ../32bit export OBJECT_MODE=32 make DESTDIR=${RPM_BUILD_ROOT} install /usr/bin/strip -X32 ${RPM_BUILD_ROOT}%{_bindir}/* || : ( cd ${RPM_BUILD_ROOT}/%{_prefix}/bin for fic in $(ls -1| grep -v -e _32 -e _64) do mv $fic "$fic"_32 ln -sf "$fic"_64 $fic done ) /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/libgd.a ../64bit/src/.libs/libgd.so.3 ( cd ${RPM_BUILD_ROOT} for dir in bin include lib do mkdir -p usr/${dir} cd usr/${dir} ln -sf ../..%{_prefix}/${dir}/* . cd - done ) %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) #%doc COPYING README-JPEG.TXT index.html entities.html %doc 32bit/COPYING %{_libdir}/*.a %{_libdir64}/*.a %files progs %defattr(-,root,system,-) %{_bindir}/bdftogd* %{_bindir}/gd2copypal* %{_bindir}/gd2togif* %{_bindir}/gd2topng* %{_bindir}/gdcmpgif* %{_bindir}/gdparttopng* %{_bindir}/gdtopng* %{_bindir}/giftogd2* %{_bindir}/pngtogd* #%{_bindir}/pngtogd2* %{_bindir}/webpng* %files devel %defattr(-,root,system,-) #%doc index.html %{_bindir}/gdlib-config* %{_includedir}/* %changelog * Mon Sep 09 2019 Reshma V Kumar - 2.2.5-3 - Build with 32bit support * Thu Jun 06 2019 Harshita Jain - 2.2.5-2 - Rebuild without libwebp support * Thu Feb 21 2019 Harshita Jain - 2.2.5-1 - Initial port to AIX toolbox * Tue Apr 27 2010 Michael Perzl - 2.0.35-5 - recompiled thread-safe with cc_r * Wed Apr 23 2008 Michael Perzl - 2.0.35-4 - some minor spec file fixes * Sat Mar 29 2008 Michael Perzl - 2.0.35-3 - changed to FreeType version 2 * Thu Jan 03 2008 Michael Perzl - 2.0.35-2 - included both 32-bit and 64-bit shared objects * Fri Sep 28 2007 Michael Perzl - 2.0.35-1 - first version for AIX V5.1 and higher