%define gs_ver 8.71 %define gs_dot_ver 8.71 Summary: A PostScript(TM) interpreter and renderer. Name: ghostscript Version: %{gs_ver} Release: 2 License: AFPL (Aladdin Free Public License) URL: http://www.ghostscript.com/ Group: Applications/Publishing Source0: %{name}-%{gs_ver}.tar.bz2 Patch0: %{name}-%{version}-aix.patch Patch1: %{name}-scripts.patch Patch2: %{name}-runlibfileifexists.patch Patch3: %{name}-system-jasper.patch Patch4: %{name}-pksmraw.patch Patch7: %{name}-cups-filters.patch Patch9: %{name}-iname-segfault.patch Patch11: %{name}-CVE-2009-4270.patch Patch12: %{name}-vsnprintf.patch Patch13: %{name}-pdftoraster-exit.patch Patch15: %{name}-pdf2dsc.patch Patch16: %{name}-cups-realloc-color-depth.patch Patch17: %{name}-tif-fail-close.patch Patch18: %{name}-tiff-default-strip-size.patch Patch19: %{name}-tiff-fixes.patch Patch20: %{name}-CVE-2010-1628.patch Patch21: %{name}-jbig2-image-refcount.patch Patch22: %{name}-SEARCH_HERE_FIRST.patch Patch23: %{name}--P-.patch Patch24: %{name}-epstopdf-failure.patch Patch25: %{name}-bbox-close.patch Patch26: %{name}-gdevcups-ripcache.patch BuildRoot: %{_tmppath}/%{name}-%{gs_ver}-%{release}-root BuildRequires: make, patch BuildRequires: cairo-devel >= 1.10.0 BuildRequires: fontconfig-devel >= 2.8.0 BuildRequires: jasper-devel >= 1.900.1 BuildRequires: libiconv >= 1.14-2 BuildRequires: libjpeg-devel >= 6b BuildRequires: libpaper-devel >= 1.1.23-3 BuildRequires: libpng-devel >= 1.2.46 BuildRequires: libtiff-devel >= 3.9.4-2 BuildRequires: zlib-devel >= 1.2.3 Requires: cairo >= 1.10.0 Requires: fontconfig >= 2.8.0 Requires: jasper >= 1.900.1 Requires: libiconv >= 1.14-2 Requires: libjpeg >= 6b Requires: libpaper >= 1.1.23-3 Requires: libpng >= 1.2.46 Requires: libtiff >= 3.9.4-2 Requires: zlib >= 1.2.3 Requires: urw-fonts >= 2.4 Requires: ghostscript-fonts >= 8.11 %description Ghostscript is a set of software that provides a PostScript(TM) interpreter, a set of C procedures (the Ghostscript library, which implements the graphics capabilities in the PostScript language) and an interpreter for Portable Document Format (PDF) files. Ghostscript translates PostScript code into many common, bitmapped formats, like those understood by your printer or screen. Ghostscript is normally used to display PostScript files and to print PostScript files to non-PostScript printers. If you need to display PostScript files or print them to non-PostScript printers, you should install ghostscript. If you install ghostscript, you also need to install the ghostscript-fonts package. %package devel Summary: Files for developing applications that use %{name}. Requires: %{name} = %{version}-%{release} Group: Development/Libraries %description devel The header files for developing applications that use %{name}. %package doc Summary: Documentation for %{name}. Requires: %{name} = %{version}-%{release} Group: Documentation %description doc The documentation files that come with %{name}. %prep %setup -q rm -rf jasper jpeg libpng export PATH=/opt/freeware/bin:$PATH # necessary fix to successfully compile with XLC/C++ V7 on AIX %patch0 # fix some shell scripts %patch1 -p1 -b .scripts # define .runlibfileifexists. %patch2 -p1 # use the system jasper library %patch3 -p1 -b .system-jasper # fix pksmraw output (bug #308211). Still needed in 8.63. %patch4 -p1 -b .pksmraw # Install CUPS filter convs files in the correct place. %patch7 -p1 -b .cups-filters # Applied upstream patch to fix iname.c segfault (bug #465311). %patch9 -p1 -b .iname-segfault # Fix debugging output from gdevcups (bug #540760). %patch11 -p1 -b .CVE-2009-4270 # Harden ghostscript's debugging output functions (bug #540760). %patch12 -p1 -b .vsnprintf # Fixed pdftoraster so that it waits for its sub-process to exit. %patch13 -p1 -b .pdftoraster-exit # Fixed pdf2dsc.ps (bug #565935). %patch15 -p1 -b .pdf2dsc # Reallocate memory in gdevcups when color depth changes (bug #563313). %patch16 -p1 -b .cups-realloc-color-depth # Don't segfault closing tiffg3 device if opening failed (bug #571520). %patch17 -p1 -b .tif-fail-close # Restore the TIFF default strip size of 0 (bug #571520). %patch18 -p1 -b .tiff-default-strip-size # Backported some more TIFF fixes (bug #573970). %patch19 -p1 -b .tiff-fixes # Applied patch to fix CVE-2010-1628 (memory corruption at PS stack # overflow, bug #592492). %patch20 -p1 -b .CVE-2010-1628 # Avoid another NULL pointer dereference in jbig2 code (bug #621569). %patch21 -p1 -b .jbig2-image-refcount # Change SEARCH_HERE_FIRST default to make -P- default instead of -P # (bug #599564). %patch22 -p1 -b .SEARCH_HERE_FIRST # Use -P- and -dSAFER in scripts (bug #599564). %patch23 -p1 -b .-P- # Avoid epstopdf failure using upstream patch (bug #627390). %patch24 -p1 -b .epstopdf-failure # Applied patch to fix NULL dereference in bbox driver (bug #591624). %patch25 -p1 -b .bbox-close # Applied patch to let gdevcups use automatic memory allocation. Use # RIPCache=auto in /etc/cups/cupsd.conf to enable. %patch26 -p1 -b .gdevcups-ripcache %build export CC="gcc -D_LARGE_FILES" export CFLAGS="-DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include" export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" export FT_CFLAGS=$(pkg-config --cflags freetype2) ./configure \ --prefix=%{_prefix} \ --enable-fontconfig \ --disable-cups \ --enable-gtk \ --enable-cairo \ --with-libpaper \ --with-pdftoraster \ --with-ijs \ --with-jbig2dec \ --with-jasper \ --with-omni \ --with-x \ --with-system-libtiff \ --with-drivers=ALL gmake %{?_smp_mflags} # build IJS cd ijs ./autogen.sh ./configure \ --prefix=%{_prefix} \ --enable-shared --disable-static gmake %{?_smp_mflags} %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} gmake prefix=${RPM_BUILD_ROOT}%{_prefix} install cd ijs gmake prefix=${RPM_BUILD_ROOT}%{_prefix} install cd .. /usr/bin/strip ${RPM_BUILD_ROOT}%{_bindir}/* || : # install header files mkdir -p ${RPM_BUILD_ROOT}%{_includedir}/%{name} cp base/errors.h ${RPM_BUILD_ROOT}%{_includedir}/%{name} cp base/gdevdsp.h ${RPM_BUILD_ROOT}%{_includedir}/%{name} cp psi/iapi.h ${RPM_BUILD_ROOT}%{_includedir}/%{name} cp psi/ierrors.h ${RPM_BUILD_ROOT}%{_includedir}/%{name} chmod 644 ${RPM_BUILD_ROOT}%{_includedir}/%{name}/* mkdir -p ${RPM_BUILD_ROOT}%{_docdir}/%{name}-%{gs_dot_ver} mv ${RPM_BUILD_ROOT}%{_datadir}/%{name}/%{gs_dot_ver}/doc/* ${RPM_BUILD_ROOT}%{_docdir}/%{name}-%{gs_dot_ver} rmdir ${RPM_BUILD_ROOT}%{_datadir}/%{name}/%{gs_dot_ver}/doc/ mkdir -p ${RPM_BUILD_ROOT}%{_mandir} mv ${RPM_BUILD_ROOT}%{_datadir}/man/* ${RPM_BUILD_ROOT}%{_mandir} rm -rf ${RPM_BUILD_ROOT}%{_datadir}/man ( 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) %{_bindir}/* %{_libdir}/*.a %{_mandir}/man?/* %{_mandir}/??/man?/* %{_datadir}/%{name}/%{gs_dot_ver} /usr/bin/* /usr/lib/*.a %files devel %defattr(-,root,system) %{_includedir}/* %{_libdir}/*.la /usr/include/* /usr/lib/*.la %files doc %defattr(-,root,system) %doc %{_docdir}/%{name}-%{gs_dot_ver} %changelog * Fri Jan 18 2013 Michael Perzl - 8.71-2 - removed dependency on cups due to incompatibilities with various AIX versions * Sun Jan 06 2013 Michael Perzl - 8.71-1 - updated to version 8.71 * Sun Jan 06 2013 Michael Perzl - 8.70-2 - added a 'devel' and 'cups' package - enabled cairo and thus added a dependency on cairo - added a dependency on libiconv * Tue Sep 15 2009 Michael Perzl - 8.70-1 - updated to version 8.70 * Tue Sep 15 2009 Michael Perzl - 8.64-1 - updated to version 8.64 * Tue Sep 15 2009 Michael Perzl - 8.62-3 - fixed some minor spec file issues * Wed Apr 23 2008 Michael Perzl - 8.62-2 - some minor spec file fixes * Wed Mar 05 2008 Michael Perzl - 8.62-1 - updated to version 8.62 * Thu Feb 21 2008 Michael Perzl - 8.61-1 - updated to version 8.61 * Fri Sep 28 2007 Michael Perzl - 8.60-1 - first version for AIX V5.1 and higher