# If you used a different Ghostscript before this one, you may want
# to uninstall that one before proceeding here. If you have a configure'd
# source directory for the other one, "make uninstall" as root usually
# works.
# The espgs HOWTO has removal instructions at the bottom.
# Ghostscript has CUPS support, CUPS requires Ghostscript
# Ghostscript has HPLIP's HPIJS support, HPIJS requires Ghostscript
# ...so just keep building all three of them until everything is enabled :-)
# Get the Ghostscript tarball
cd
test -f installed/ghostscript-10.05.0.tar.xz &&
mv installed/ghostscript-10.05.0.tar.xz .
test ! -f ghostscript-10.05.0.tar.xz &&
wget https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/\
download/gs10050/ghostscript-10.05.0.tar.xz
# Extract it
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "ghostscript-*" -exec rm -r {} \;
tar xJvf ~/ghostscript-10.05.0.tar.xz
cd ghostscript-10.05.0
test $UID = 0 && chown -R root:root .
# If you only want to include drivers for certain things, specify
# yours with --with-drivers=LIST See 'configure --help'
# It would seem you can not do --with-system-libtiff and also have
# a system-wide libjpeg
# I had a build failure with 10.05.0 that mentioned tesseract
# I used --without-tesseract to continue
#
# If you have the same issue and do need tesseract OCR support,
# you might want to go to https://bugs.ghostscript.com/
# Configure it for 64-bit
test $(uname -m) = 'x86_64' &&
./configure --prefix=/usr --docdir=/usr/doc/ghostscript \
--libdir=/usr/lib64 --mandir=/usr/man
# Configure it for anything else
test $(uname -m) != 'x86_64' &&
./configure --prefix=/usr --docdir=/usr/doc/ghostscript --mandir=/usr/man
# Build it
make
# Become root to install it
su
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg ghostscript
# There is a ghostscript-fonts package too, but no need to remove that,
# they are used by many different pieces of software
# Install it
make install
# Each version will have files in /usr/share/ghostscript/x.xx, so
# you can zap the old ones to save space
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Become yourself again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/ghostscript-*.tar.*
mv ghostscript-10.05.0.tar.xz installed/
# If you ever want to uninstall Ghostscript, this should do it:
# [ espgs would put files in these, but we do not do that here
# /etc/cups/
# /usr/lib*/cups/filter/
# /usr/share/cups/model/ ]
cd
su
# Current programs
( cd /usr/bin
rm -f bdftops dvipdf eps2eps fixmswrd.pl gs gsbj gsdj gsdj500 gslj gslp \
gsnd lprsetup.sh pdf2dsc pdf2ps pf2afm pfbtopfa pj-gs.sh pphs printafm \
ps2ascii ps2epsi ps2pdf ps2pdf12 ps2pdf13 ps2pdf14 ps2pdfwr ps2ps ps2ps2 \
pv.sh sysvlp.sh unix-lpr.sh )
# Old ones
( cd /usr/bin ; rm -f dumphint font2c pdf2afm pdfopt wftopfa )
test -d /usr/doc/ghostscript && rm -r /usr/doc/ghostscript
find /usr/doc -maxdepth 1 -type d -name "ghostscript-*" -exec rm -r {} \;
test -d /usr/include/ghostscript && rm -r /usr/include/ghostscript
test -d /usr/include/ijs && rm -r /usr/include/ijs
test -d /usr/lib64 &&
( cd /usr/lib64
test -d ./ghostscript && rm -r ./ghostscript
rm -f libgs.* libijs.* libijs-0.* pkgconfig/ijs.pc )
( cd /usr/man/man1 ; rm -f dvipdf.1 eps2eps.1 font2c.1 gs.1 gslp.1 \
gsnd.1 pdf2dsc.1 pdf2ps.1 pdfopt.1 pf2afm.1 pfbtopfa.1 printafm.1 \
ps2ascii.1 ps2epsi.1 ps2pdf.1 ps2pdfwr.1 ps2ps.1 wftopfa.1 )
test -d /usr/share/ghostscript && rm -r /usr/share/ghostscript
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "ghostscript-*" -exec rm -r {} \;
rm -f ~/installed/ghostscript-*.tar.*