# If you used a different Ghostscript before this one, you may want
# to uninstall that one before proceeding here. If you have the 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 it
cd
test -f installed/ghostscript-9.25.tar.xz &&
mv installed/ghostscript-9.25.tar.xz .
test ! -f ghostscript-9.25.tar.xz &&
wget https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/\
download/gs925/ghostscript-9.25.tar.xz
# Extract it
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "ghostscript-*" -exec rm -r {} \;
tar xJvf ~/ghostscript-9.25.tar.xz
cd ghostscript-9.25
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'
# Configure it for 64-bit
test $(uname -m) = 'x86_64' &&
./configure --prefix=/usr --libdir=/usr/lib64 --mandir=/usr/man
# Configure it for anything else
test $(uname -m) != 'x86_64' &&
./configure --prefix=/usr --mandir=/usr/man
# If you'd like to build libgs and gsc and gsx programs, run
# 'make so' instead of 'make' below
# Build it
make
# Become root to install it
su
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg ghostscript
# If you ran 'make so' above, run 'make soinstall' below instead.
# That will give you the 'gsx' program, which uses GTK+ (if you have it
# installed), and the 'gsc' program, which does not.
# Install it
make install
# If you have gsx/gsc, symlink one of them as /usr/bin/gs
test -x /usr/bin/gsc &&
( rm -f /usr/bin/gs
ln -s /usr/bin/gsc /usr/bin/gs )
# 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-9.25.tar.xz installed/
# If you ever want to uninstall Ghostscript, this should do it:
cd
su
rm -f /etc/cups/pstoraster.convs
( cd /usr/bin ; rm -f bdftops dumphint dvipdf eps2eps fixmswrd.pl font2c \
gs gsbj gsdj gsdj500 gslj gslp gsnd lprsetup.sh pdf2dsc pdf2ps pdfopt \
pf2afm pfbtopfa pj-gs.sh printafm ps2ascii ps2epsi ps2pdf ps2pdf12 \
ps2pdf13 ps2pdf14 ps2pdfwr ps2ps ps2ps2 pv.sh sysvlp.sh unix-lpr.sh \
wftopfa )
( cd /usr/lib/cups/filter ; rm -f pstopxl pstoraster )
( 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 )
( cd /usr/share/cups/model ; rm -f pxlcolor.ppd pxlmono.ppd )
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.*