# mandoc 1.14.6
# =============
# If you run Slackware, you probably don't need this
# Slackware <= 14.2 includes the 'man' package
# Slackware >= 15.0 includes the 'man-db' package (http://www.nongnu.org/man-db/)
# Get the source
cd
test -f installed/mandoc-1.14.6.tar.gz && mv -f mandoc-1.14.6.tar.gz .
test ! -f mandoc-1.14.6.tar.gz &&
wget https://mandoc.bsd.lv/snapshots/mandoc-1.14.6.tar.gz
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "mandoc-*" -exec rm -r {} \;
tar xzvf ~/mandoc-1.14.6.tar.gz
cd mandoc-1.14.6
test $UID = 0 && chown -R root:root .
# Read ./INSTALL
# If upgrading, read https://mandoc.bsd.lv/NEWS
## See configure.local.example for examples of what can go in configure.local
# If you want man.cgi - CGI program to search and display manual pages
# Read through comments in ./INSTALL, and 'man ./man.cgi.8'
echo BUILD_CGI=1 >> configure.local
cp cgi.h.example cgi.h
# If you want catman - formats all manual pages below a directory
# Read through comments in ,/INSTALL, and 'man ./catman.8'
echo "BUILD_CATMAN=1" >> configure.local
# If you already have a catman, name this one mcatman
echo "BINM_CATMAN=mcatman" >> configure.local
# Define a default MANPATH_DEFAULT
echo "MANPATH_DEFAULT=\"/usr/man:/usr/X11R6/man:/usr/local/man\"" >> configure.local
# Define a default MANPATH_BASE
echo "MANPATH_DEFAULT=\"/usr/man:/usr/X11R6/man\"" >> configure.local
# Rather than using man.conf
MANM_MANCONF="mandoc.conf" >> configure.local
# Rename the man pages to avoid conflicts with other packages
echo "MANM_MAN=mandoc_man" >> configure.local
echo "MANM_MDOC=mandoc_mdoc" >> configure.local
echo "MANM_ROFF=mandoc_roff" >> configure.local
echo "MANM_EQN=mandoc_eqn" >> configure.local
echo "MANM_TBL=mandoc_tbl" >> configure.local
# Define that these programs should have a 'm' prepended in the filename
# (and makewhatis -> mandocdb) to avoid naming them the same as the ones
# in the 'man' Slackware package
echo "BINM_MAN=mman" >> configure.local
echo "BINM_APROPOS=mapropos" >> configure.local
echo "BINM_WHATIS=mwhatis" >> configure.local
echo "BINM_MAKEWHATIS=mandocdb" >> configure.local
echo "BINM_SOELIM=msoelim" >> configure.local
# If you enable any libraries, you may need
echo "LIBDIR=/usr/local/lib64" >> configure.local
# Configure the build based on what configure finds and what is set in
# configure.local
./configure
# Build it
make
# Install it
su -c "make install"
# Save the source for later
cd
mkdir -p -m 0700 ~/installed
rm -f installed/mandoc-*.tar.*
mv -f mandoc-1.14.6.tar.gz installed/
# If you ever want to uninstall mandoc, this should do it:
# ('make uninstall' as root should be enough, the rest is just in case)
cd
su
test -d src/mandoc-* && ( cd src/mandoc-* ; make uninstall )
( cd /usr/local/bin
rm -f demandoc mandoc mapropos mman msoelim mwhatis )
( cd /usr/local/man/man1
rm -f demandoc.1 mandoc.1 mapropos.1 mman.1 msoelim.1 mwhatis.1 )
( cd /usr/local/man/man3
rm -f mandoc.3 mandoc_*.3 mansearch.3 mchars_alloc.3 tbl.3 )
( cd /usr/local/man/man5
rm -f man.conf.5 mandoc.db.5 )
( cd /usr/local/man/man8
rm -f mandocdb.8 mcatman.8 )
( cd /usr/local/sbin
rm -f mandocd mandocdb mcatman
rm -f /usr/local/lib64/libmandoc.a /usr/local/man/man7/mandoc_*.7 \
/var/www/cgi-bin/man.cgi /var/www/htdocs/mandoc.css
test -d /usr/local/include/mandoc && rm -r /usr/local/include/mandoc
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "mandoc-*" -exec rm -r {} \;
rm -f ~/installed/mandoc-*.tar.*