# Get it
cd
test -f installed/gperf-3.1.tar.gz && mv -f installed/gperf-3.1.tar.gz .
test ! -f gperf-3.1.tar.gz &&
wget http://ftpmirror.gnu.org/gnu/gperf/gperf-3.1.tar.gz
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "gperf-*" -exec rm -r {} \;
tar xzvf ~/gperf-3.1.tar.gz
cd gperf-3.1
test $UID = 0 && chown -R root:root .
# Become root to install it
su
# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
./configure --prefix=/usr --docdir=/usr/doc/gperf-3.1 --infodir=/usr/info \
--libdir=/usr/lib64 --mandir=/usr/man
# Configure the build for anything else
test $(uname -m) != 'x86_64' &&
./configure --prefix=/usr --docdir=/usr/doc/gperf-3.1 --infodir=/usr/info \
--mandir=/usr/man
# Build it
make
# Become root to install it
su
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg gperf
# Install it
make install
# 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/gperf-*.tar.*
mv gperf-3.1.tar.gz installed/
# If you ever want to uninstall gperf, this should do it:
cd
su
test -d src/gperf-* && ( cd src/gperf-* ; make uninstall )
find /usr/doc -maxdepth 1 -type d -name "gperf-*" -exec rm -r {} \;
rm -f /usr/bin/gperf /usr/doc/gperf.html /usr/info/gperf.info \
/usr/man/man1/gperf.1
exit
find ~/src -maxdepth 1 -type d -name "gperf-*" -exec rm -r {} \;
rm -f ~/installed/gperf-*.tar.*