# Prerequisites:
# XFree86 or X (optional; for gxditview and xtotroff)
# lpr from CUPS or another to print
# Perl
# bison
# texinfo (to view the texinfo manual or convert it to dvi, pdf, or
# html format)
# iconv
# ghostscript (for grops)
# netpbm (if you want grohtml)
# Get it
cd
test -f installed/groff-1.22.2.tar.gz && mv installed/groff-1.22.2.tar.gz .
test ! -f groff-1.22.2.tar.gz &&
wget http://ftpmirror.gnu.org/groff/groff-1.22.2.tar.gz
# Verify tarball w/ md5sum:
# (this came from my gpg-verified tarball)
echo "9f4cd592a5efc7e36481d8d8d8af6d16 groff-1.22.2.tar.gz" | md5sum -c
# Verify tarball w/ sha1sum:
# (this also came from my gpg-verified tarball)
echo "37223941e25bb504bf54631daaabb01b147dc1d3 groff-1.22.2.tar.gz" | \
sha1sum -c
# Extract the source
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "groff-*" -exec rm -r {} \;
tar xzvf ~/groff-1.22.2.tar.gz
cd groff-1.22.2
test $UID = 0 && chown -R root:root .
# Put PAGE=letter at the beginning of your configure line to use letter
# instead of A4 as the default page size
# --libdir=/usr/lib64 should be specified if you think that the files that
# end up under /usr/lib/groff should be under /usr/lib64/groff instead. I'm
# not really sure about that one myself, but Slackware puts it there. There
# are no shared libraries or anything binary in there, so I'm not really sure
# if that is appropriate or not. I'm running 64-bit Slackware and /usr/lib is
# there and is not empty, with files installed by Slackware packages... It
# probably ends up there because .SlackBuild typically includes a check for
# 64-bit, so it's just a default. Usually.
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg groff
# Install the new version
make install
# Create g* symlinks and a z* one
( cd /usr/bin
for bin in eqn indxbib lookbib neqn nroff pic refer soelim tbl troff;
do
test -e g${bin} && rm -f g${bin}
ln -s $bin g${bin}
done
rm -f zsoelim
ln -s soelim zsoelim )
# Without this, 'man' output will have control codes in it as of groff 1.18.x
# Slackware replaces the files in /usr/share/groff/site-tmac/ to disable
# color ANSI output instead.
# If you use a very old Slackware without /etc/profile.d/, you can add the
# "export PAGER" line to /etc/profile
echo '#!/bin/sh' > /etc/profile.d/groff.sh
echo '# This fixes control codes that' >> /etc/profile.d/groff.sh
echo '# appear in "man" output' >> /etc/profile.d/groff.sh
echo 'export PAGER="less -R"' >> /etc/profile.d/groff.sh
chmod +x /etc/profile.d/groff.sh
. /etc/profile.d/groff.sh
# Try it out
man groff
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Become yourself again
exit
# Either source /etc/profile.d/groff.sh or log out and log back in so the
# settings take effect for your current (non-root) shell
test -r /etc/profile.d/groff.sh && . /etc/profile.d/groff.sh
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/groff-*.tar.*
mv groff-1.22.2.tar.gz installed/
# If you ever want to uninstall groff, this should do it:
cd
su
test -d src/groff-* && ( cd src/groff-* ; make uninstall )
( cd /usr/bin
rm -f addftinfo afmtodit chem eqn eqn2graph gdiffmk grap2graph grn grodvi \
groff groffer grog grolbp grolj4 grops grotty gxditview hpftodit indxbib \
lookbib mmroff neqn nroff pfbtops pic pic2graph post-grohtml pre-grohtml \
preconv refer soelim tbl tfmtodit troff xtotroff )
rm -f /etc/X11/app-defaults/GXditview /usr/info/groff.info
test -d /usr/lib/groff && rm -r /usr/lib/groff
test -d /usr/lib64/groff && rm -r /usr/lib64/groff
test -d /usr/share/groff && rm -r /usr/share/groff
exit
find ~/src -maxdepth 1 -type d -name "groff-*" -exec rm -r {} \;
rm -f ~/installed/groff-*.tar.*