<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../../general.ent">
  %general-entities;

  <!ENTITY espgs-download-http "http://ftp.funet.fi/pub/mirrors/ftp.easysw.com/pub/ghostscript/&espgs-version;/espgs-&espgs-version;-source.tar.bz2">
  <!ENTITY espgs-download-ftp  "ftp://ftp.easysw.com/pub/ghostscript/&espgs-version;/espgs-&espgs-version;-source.tar.bz2">
  <!ENTITY espgs-md5sum        "e74e0463e0bfb1cea3db245d8e71828c">
  <!ENTITY espgs-size          "8.7 MB">
  <!ENTITY espgs-buildsize     "108 MB (includes installing libgs.so and both font tarballs)">
  <!ENTITY espgs-time          "2.3 SBU (includes building and installing libgs.so)">

  <!ENTITY espgs-standard-fonts-download "ftp://ftp.imagemagick.org/pub/ImageMagick/delegates/ghostscript-fonts-std-8.11.tar.gz">
  <!ENTITY espgs-standard-fonts-md5sum   "6865682b095f8c4500c54b285ff05ef6">
  <!ENTITY espgs-standard-fonts-size     "3.7 MB">

  <!ENTITY espgs-other-fonts-download    "http://ftp.gnu.org/pub/gnu/ghostscript/gnu-gs-fonts-other-6.0.tar.gz">
  <!ENTITY espgs-other-fonts-md5sum      "33457d3f37de7ef03d2eea05a9e6aa4f">
  <!ENTITY espgs-other-fonts-size        "796 KB">
]>

<sect1 id="espgs" xreflabel="ESP Ghostscript-&espgs-version;">
  <?dbhtml filename="espgs.html"?>

  <sect1info>
    <othername>$LastChangedBy: bdubbs $</othername>
    <date>$Date: 2012-05-12 18:50:31 -0400 (Sat, 12 May 2012) $</date>
  </sect1info>

  <title>ESP Ghostscript-&espgs-version;</title>

  <indexterm zone="espgs">
    <primary sortas="a-ESP-Ghostscript">ESP Ghostscript</primary>
  </indexterm>

  <sect2 role="package">
    <title>Introduction to ESP Ghostscript</title>

    <para><application>ESP Ghostscript</application> is a versatile processor
    for PostScript data with the ability to render PostScript to different
    targets. <application>ESP Ghostscript</application> is a customized
    version of GNU Ghostscript that includes an enhanced configuration script,
    the <application>CUPS</application> raster driver to support
    <application>CUPS</application> raster printer drivers, and additional
    patches and drivers from various Linux distributors.</para>

    <bridgehead renderas="sect3">Package Information</bridgehead>
    <itemizedlist spacing="compact">
      <listitem>
        <para>Download (HTTP): <ulink url="&espgs-download-http;"/></para>
      </listitem>
      <listitem>
        <para>Download (FTP): <ulink url="&espgs-download-ftp;"/></para>
      </listitem>
      <listitem>
        <para>Download MD5 sum: &espgs-md5sum;</para>
      </listitem>
      <listitem>
        <para>Download size: &espgs-size;</para>
      </listitem>
      <listitem>
        <para>Estimated disk space required: &espgs-buildsize;</para>
      </listitem>
      <listitem>
        <para>Estimated build time: &espgs-time;</para>
      </listitem>
    </itemizedlist>

    <bridgehead renderas="sect3">Additional Downloads</bridgehead>

    <itemizedlist spacing='compact'>
      <title>Required Patch</title>
      <listitem>
        <para><ulink url="&patch-root;/espgs-&espgs-version;-bov_fix-1.patch"/></para>
      </listitem>
    </itemizedlist>

    <itemizedlist spacing='compact'>
      <title>Standard Fonts</title>
      <listitem>
        <para>Download (FTP): <ulink url="&espgs-standard-fonts-download;"/></para>
      </listitem>
      <listitem>
        <para>Download MD5 sum: &espgs-standard-fonts-md5sum;</para>
      </listitem>
      <listitem>
        <para>Download size: &espgs-standard-fonts-size;</para>
      </listitem>
    </itemizedlist>

    <itemizedlist spacing='compact'>
      <title>Other Fonts</title>
      <listitem>
        <para>Download (HTTP): <ulink url="&espgs-other-fonts-download;"/></para>
      </listitem>
      <listitem>
        <para>Download MD5 sum: &espgs-other-fonts-md5sum;</para>
      </listitem>
      <listitem>
        <para>Download size: &espgs-other-fonts-size;</para>
      </listitem>
    </itemizedlist>

    <bridgehead renderas="sect3">ESP Ghostscript Dependencies</bridgehead>

    <bridgehead renderas="sect4">Optional</bridgehead>
    <para role="optional"><xref linkend="cups"/>,
    <xref linkend="libjpeg"/>,
    <xref linkend="libpng"/>,
    <xref linkend="x-window-system"/>, and
    <xref linkend="gtk2"/> or <xref linkend="GTK"/></para>

    <para condition="html" role="usernotes">User Notes:
    <ulink url="&blfs-wiki;/espgs"/></para>

  </sect2>

  <sect2 role="installation">
    <title>Installation of ESP Ghostscript</title>

    <para>Install <application>ESP Ghostscript</application>
    by running the following commands:</para>

<screen><userinput>patch -Np1 -i ../espgs-&espgs-version;-bov_fix-1.patch &amp;&amp;
sed -i "s/bbox.dev$/x11.dev/" Makefile.in &amp;&amp;
./configure --prefix=/usr \
            --enable-threads \
            --without-omni &amp;&amp;
make</userinput></screen>

    <para>To build the shared
    <filename class='libraryfile'>libgs.so</filename> library you must have
    <application>GTK+</application> installed and issue the following
    command:</para>

<screen><userinput>make so</userinput></screen>

    <para>This package does not come with a test suite. However, you may test
    the operation of the newly built <command>gs</command> program by issuing
    the following command (issue from an X Windows terminal):</para>

<screen><userinput>bin/gs -Ilib -dBATCH examples/tiger.eps</userinput></screen>

    <para>Now, as the <systemitem class="username">root</systemitem> user:</para>

<screen role="root"><userinput>make install &amp;&amp;
install -d /usr/share/doc/espgs-&espgs-version;
ln -v -s ../../ghostscript/8.15/doc /usr/share/doc/espgs-&espgs-version; &amp;&amp;
for INSTFILE in `ls doc`
do
  if [ ! -f /usr/share/doc/espgs-&espgs-version;/$INSTFILE ]; then
    install -v -m644 doc/$INSTFILE /usr/share/doc/espgs-&espgs-version;/
  fi
done</userinput></screen>

    <para>If you built the shared library, install it and the associated
    programs by issuing the following commands as the
    <systemitem class="username">root</systemitem> user:</para>

<screen role="root"><userinput>make soinstall &amp;&amp;
install -v -d -m755 /usr/include/ps &amp;&amp;
install -v -m644 src/*.h /usr/include/ps &amp;&amp;
ln -v -s ps /usr/include/ghostscript</userinput></screen>

    <para>To finish the installation, unpack all fonts you've downloaded to
    <filename class="directory">/usr/share/ghostscript</filename> and ensure
    the ownerships of the files are
    <systemitem class="username">root</systemitem>:<systemitem class="groupname">root</systemitem>.
    Substitute <replaceable>&lt;font-tarball&gt;</replaceable> appropriately in
    the command below for the fonts you wish to install:</para>

<screen role="root"><userinput>tar -xvf ../<replaceable>&lt;font-tarball&gt;</replaceable> -C /usr/share/ghostscript &amp;&amp;
chown -v root:root /usr/share/ghostscript/fonts/*</userinput></screen>

  </sect2>

  <sect2 role="commands">
    <title>Command Explanations</title>

    <para><command>sed -i "s/bbox.dev$/x11.dev/" Makefile.in</command>:
    This command changes the default <command>gs</command> output device from
    the bbox driver to the x11 (screen) driver.</para>

    <para><parameter>--enable-threads</parameter>: This parameter enables
    threaded output.</para>

    <para><parameter>--without-omni</parameter>: This switch disables the
    omni driver support.</para>

    <para><option>--without-ijs</option>: This switch disables the
    IJS driver support.</para>

    <para><command>install -v -m644 src/*.h /usr/include/ps</command>: Some
    packages (<application>ImageMagick</application> is one) need the
    <application>Ghostscript</application> interface headers in place to link
    to the shared library. These commands install the headers.</para>

    <para><command>ln -v -s ps /usr/include/ghostscript</command>: Some
    packages expect to find the interface headers in an alternate
    location.</para>

    <para><command>for INSTFILE in `ls doc` ...</command>: This
    <quote>for</quote> loop installs some documentation files that were not
    installed during the installation process.</para>

  </sect2>

  <sect2 role="content">
    <title>Contents</title>

    <segmentedlist>
      <segtitle>Installed Programs</segtitle>
      <segtitle>Installed Library</segtitle>
      <segtitle>Installed Directories</segtitle>

      <seglistitem>
        <seg>bdftops, dvipdf, eps2eps, fixmswrd.pl, font2c, gs, gsbj, gsc, gsdj,
        gsdj500, gslj, gslp, gsnd, gsx, lprsetup.sh, pdf2dsc, pdf2ps, pdfopt,
        pf2afm, pfbtopfa, printafm, ps2ascii, ps2epsi, ps2pdf,ps2pdf12,
        ps2pdf13, ps2pdf14, ps2pdfwr, ps2ps, pv.sh, unix-lpr.sh, and
        wftopfa</seg>
        <seg>libgs.so </seg>
        <seg>/usr/include/ps and /usr/share/ghostscript</seg>
      </seglistitem>
    </segmentedlist>

    <variablelist>
      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
      <?dbfo list-presentation="list"?>
      <?dbhtml list-presentation="table"?>

      <varlistentry id="gs-prog-gs">
        <term><command>gs</command></term>
        <listitem>
          <para>invokes <application>Ghostscript</application>, an interpreter
          of Adobe Systems' PostScript(tm) and Portable Document Format
          (PDF) languages.</para>
          <indexterm zone="espgs gs-prog-gs">
            <primary sortas="b-gs">gs</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="pstoraster">
        <term><filename>pstoraster</filename></term>
        <listitem>
          <para>is a filter used by <application>CUPS</application> to convert
          PostScript to a generic raster image format that is acceptable as an
          input to drivers for non-PostScript printers (e.g., from
          <xref linkend="gutenprint"/>). It is built and installed only if
          <xref linkend="cups"/> is found.</para>
          <indexterm zone="espgs pstoraster">
            <primary sortas="g-pstoraster">pstoraster</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

    <para><application>ESP Ghostscript</application> provides many different
    scripts used to render PostScript/PDF files back and forth. Please refer
    to the HTML documentation or try <command>man gs</command> for information
    about the capabilities provided by the package.</para>

  </sect2>

</sect1>
