# Get the tarball
cd
test -f installed/mpc-1.3.1.tar.gz &&
mv -f installed/mpc-1.3.1.tar.gz .
test ! -f mpc-1.3.1.tar.gz &&
wget https://ftpmirror.gnu.org/mpc/mpc-1.3.1.tar.gz
# Verify tarball w/ sha256sum:
# (this came from my gpg-verified tarball)
echo "ab642492f5cf882b74aa0cb730cd410a81edcdbec895183ce930e706c1c759\
b8 mpc-1.3.1.tar.gz" | sha256sum -c
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "mpc-*" exec rm -r {} \;
tar xzvf ~/mpc-1.3.1.tar.gz
cd mpc-1.3.1
test $UID = 0 && chown -R root:root .
# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
./configure --prefix=/usr --infodir=/usr/info --libdir=/usr/lib64
# Configure the build for anything else
test $(uname -m) != 'x86_64' &&
./configure --prefix=/usr --infodir=/usr/info
# Build it
make
# Become root to install it
su
# Before removing the Slackware package, or instead of removing the
# Slackware package, keep a copy of /usr/lib*/libmpc.so.* in case
# something breaks. If the new version is also symlinked with
# libmpc.so.3 like this one is, you should be fine. If not, you may
# need to put the older version back in there, or try a symlink:
# ( cd /usr/lib64
# ln -s libmpc.so libmpc.so.2
# ldconfig )
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg libmpc
# Install it
make install
ldconfig
# Become yourself again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/mpc-*.tar.*
mv -f mpc-1.3.1.tar.gz installed/
# If you ever want to uninstall MPC, this should do it:
cd
su
test -d src/mpc-* && ( cd src/mpc-* ; make uninstall )
find /usr/doc -maxdepth 1 -type d -name "libmpc-*" -exec rm -r {} \;
test -d /usr/doc/mpc && rm -r /usr/doc/mpc
( cd /usr/info ; rm -f mpc.info mpc.info.gz )
rm -f /usr/include/mpc.h /usr/lib*/libmpc.*
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "mpc-*" -exec rm -r {} \;
rm -f ~/installed/mpc-*.tar.*