# Below I use the default prefix of /usr/local
# If a Slackware package is added for libpaper in the future, I
# may change it to /usr
#
# ...actually, there seems to be a libpaper package in slackware64-current
# Get the source tarball
cd
test -f installed/libpaper-2.2.5.tar.gz &&
mv -f installed/libpaper-2.2.5.tar.gz .
test ! -f libpaper-2.2.5.tar.gz &&
wget https://github.com/rrthomas/libpaper/releases/download/v2.2.5/libpaper-2.2.5.tar.gz
# md5sum from me, which matches Linux from Scratch and SlackBuilds:
# 4b914c3ca6d8277260fce418e12bae6b
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "libpaper-*" -exec rm -r {} \;
tar xzvf ~/libpaper-2.2.5.tar.gz
cd libpaper-2.2.5
test $UID = 0 && chown -R root:root .
# --enable-relocatable is required for 'make check' to work
# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
./configure --disable-static --enable-relocatable \
--docdir=/usr/local/doc/libpaper-2.2.5 --libdir=/usr/local/lib64 \
--mandir=/usr/local/man
# Configure the build for anything else
test $(uname -m) != 'x86_64' &&
./configure --disable-static --enable-relocatable \
--docdir=/usr/local/doc/libpaper-2.2.5 --mandir=/usr/local/man
# Build it
make
# Check the build
make check
# Become root to install it
su
# Remove old docs from previous releases
test -d /usr/local/doc/libpaper && rm -r /usr/local/doc/libpaper
find /usr/local/doc -maxdepth 1 -type d -name "libpaper-*" -exec rm -r {} \;
# Install it
make install
ldconfig
# Run 'paper' to see what it thinks your default paper size is
# Run 'paper --all' to see a list (from /usr/local/etc/paperspecs)
# See 'man paper' for information about changing it
# There does not appear to be a man page for the deprecated 'paperconf'.
# Though usage is output if you use an invalid option (such as the typical
# '--help'), the options are listed, but not defined. Look in
# src/paperconf.c at the switch/case part around line 111 for an idea.
# Become your non-root user again
exit
# This is like 'make check' but using the installed libpaper
make installcheck
# Save the tarball for later
cd
mkdir -p -m 0700 installed
rm -f installed/libpaper-*.tar.*
mv libpaper-2.2.5.tar.gz installed/
# If you ever want to uninstall libpaper, this should do it:
# ('make uninstall' as root from the source directory should do it,
# the rest is if you don't have configured source any more)
cd
su
test -d src/libpaper-* && ( cd src/libpaper-* ; make uninstall )
for pfx in /usr /usr/local; do
( cd ${pfx}/bin ; rm -f paper paperconf )
find ${pfx}/doc -maxdepth 1 -type d -name "libpaper-*" -exec rm -r {} \;
test -d ${pfx}/doc/libpaper && rm -r ${pfx}/doc/libpaper
( cd ${pfx}/lib ; rm -f libpaper.* )
test -d ${pfx}/lib64 &&
( cd ${pfx}/lib64 ; rm -f libpaper.* )
test -d ${pfx}/share/libpaper && rm -r ${pfx}/share/libpaper
rm -f ${pfx}/etc/paperspecs ${pfx}/include/paper.h \
${pfx}/man/man1/paper.1 ${pfx}/man/man5/paperspecs.5
done
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "libpaper-*" -exec rm -r {} \;
rm -f ~/installed/libpaper-*.tar.*