# Get the tarball
cd
test -f installed/mpfr-4.2.1.tar.xz &&
mv -f installed/mpfr-4.2.1.tar.xz .
test ! -f mpfr-4.2.1.tar.xz &&
wget https://www.mpfr.org/mpfr-current/mpfr-4.2.1.tar.xz
# Verify tarball w/ sha256sum:
# (this came from my gpg-verified tarball and the release announcement)
echo "277807353a6726978996945af13e52829e3abd7a9a5b7fb2793894e18f1fcb\
b2 mpfr-4.2.1.tar.xz" | sha256sum -c
# Verify tarball w/ gpg:
# If not found on your configured keyserver, also available here
( gpg --list-keys 5831D11A0D4DB02A > /dev/null 2>&1 ||
gpg --recv-keys 5831D11A0D4DB02A ) &&
wget -nc https://www.mpfr.org/mpfr-current/mpfr-4.2.1.tar.xz.asc &&
gpg --verify mpfr-4.2.1.tar.xz.asc && rm mpfr-4.2.1.tar.xz.asc
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "mpfr-*" -exec rm -r {} \;
tar xJvf ~/mpfr-4.2.1.tar.xz
cd mpfr-4.2.1
test $UID = 0 && chown -R root:root .
# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
./configure --prefix=/usr --docdir=/usr/doc/mpfr --infodir=/usr/info \
--libdir=/usr/lib64
# Configure the build for anything else
test $(uname -m) != 'x86_64' &&
./configure --prefix=/usr --docdir=/usr/doc/mpfr --infodir=/usr/info
# Build it
make
# Generate documentation in various formats
# doc/mpfr.pdf doc/mpfr.dvi doc/mpfr.ps doc/mpfr.html/index.html
make pdf
make dvi
make ps
make html
# Check the build
make check
# Become root to install it
su
## Save a copy of whatever /usr/lib*/libmpfr.so.* that you have now before
## removing the Slackware package. You may find that things like this:
# ldd /usr/libexec/gcc/x86_64-slackware-linux/*/cc1
## ...are looking for libmpfr.so.4 but the new one installed here is
## libmpfr.so.6 So, either put the old one back in there, or try a symlink
# ( cd /usr/lib64
# test ! -L libmpfr.so.4 && ln -s libmpfr.so libmpfr.so.4
# ldconfig )
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg mpfr
# Install it
make install
ldconfig
# If you generated pdf, dvi, ps, html documentation, install it
# in to /usr/doc/mpfr/
make install-pdf
make install-dvi
make install-ps
make install-html
# 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/mpfr-*.tar.*
mv mpfr-4.2.1.tar.xz installed/
# If you ever want to uninstall MPFR, this should do it:
cd
su
test -d src/mpfr-* && ( cd src/mpfr-* ; make uninstall )
test -d /usr/doc/mpfr && rm -f /usr/doc/mpfr
( cd /usr/include ; rm -f mpfr.h mpf2mpfr.h )
rm -f /usr/info/mpfr.info /usr/lib*/libmpfr.* \
/usr/lib*/pkgconfig/mpfr.pc
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "mpfr-*" -exec rm -r {} \;
rm -f ~/installed/mpfr-*.tar.*