# Get it
cd
test -f installed/bison-3.0.4.tar.xz && mv installed/bison-3.0.4.tar.xz .
test ! -f bison-3.0.4.tar.xz &&
wget http://ftpmirror.gnu.org/bison/bison-3.0.4.tar.xz
# Verify tarball w/ md5sum:
# (this came from my gpg-verified tarball)
echo "146be9ff9fbd27497f0bf2286a5a2082 bison-3.0.4.tar.xz" | md5sum -c
# Verify tarball w/ sha1sum:
# (this also came from my gpg-verified tarball)
echo "aeb1e3544007124009e5203afe86a5676580d444 bison-3.0.4.tar.xz" | sha1sum -c
# Extract the source
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "bison-*" -exec rm -r {} \;
tar xJvf ~/bison-3.0.4.tar.xz
cd bison-3.0.4
test $UID = 0 && chown -R root:root .
# Configure the build, 64-bit
test $(uname -m) = "x86_64" &&
./configure --prefix=/usr --infodir=/usr/info --libdir=/usr/lib64 --mandir=/usr/man --disable-nls
# Configure the build, anything else
test $(uname -m) != "x86_64" &&
./configure --prefix=/usr --infodir=/usr/info --mandir=/usr/man --disable-nls
# Build it
make
# Test the build
make check
# Become root to install it
su
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg bison
# Install the new one
find /usr/share/locale -type f -name "bison.mo" -exec rm {} \;
make install
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Do this if you have Berkeley yacc installed and you want to replace it
# with a script that runs bison in a way that imitates yacc, run this below.
# If you don't have byacc installed, bison will have already installed the
# script for you.
test -x /sbin/removepkg && /sbin/removepkg byacc
echo '#!/bin/sh' > /usr/bin/yacc
echo 'exec /usr/bin/bison -y "$@"' >> /usr/bin/yacc
chown root:root /usr/bin/yacc
chmod 755 /usr/bin/yacc
# Become yourself again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/bison-*.tar.*
mv bison-3.0.4.tar.xz installed/
# If you ever want to uninstall Bison, this should do it:
cd
su
test -d src/bison-* && ( cd src/bison-* ; make uninstall )
( cd /usr/bin ; rm -f bison yacc )
( cd /usr/man/man1 ; rm -f bison.1 yacc.1 )
test -d /usr/share/bison && rm -r /usr/share/bison
( cd /usr/share/man/man1 ; rm -f bison.1 yacc.1 )
rm -f /usr/info/bison.info /usr/lib/liby.* /usr/lib64/liby.* /usr/share/aclocal/bison-i18n.m4 /usr/share/info/bison.info
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "bison-*" -exec rm -r {} \;
rm -f ~/installed/bison-*.tar.*