# Get it
cd
test -f installed/bison-3.8.2.tar.xz && mv installed/bison-3.8.2.tar.xz .
test ! -f bison-3.8.2.tar.xz &&
wget http://ftpmirror.gnu.org/bison/bison-3.8.2.tar.xz
# Verify tarball w/ sha1sum:
# (this came from the release announcement)
echo "da1522a00f8c23c1abf69dbd2e99078d2a484b96 bison-3.8.2.tar.xz" | sha1sum -c
# Verify tarball w/ sha256sum:
# (this came from my sha1sum and gpg-verified tarball)
echo "9bba0214ccf7f1079c5d59210045227bcf619519840ebfa80cd3849cff5a5b\
f2 bison-3.8.2.tar.xz" | sha256sum -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.8.2.tar.xz
cd bison-3.8.2
test $UID = 0 && chown -R root:root .
# Read README and if upgrading, NEWS for a brief summary or ChangeLog for a
# full list
# Configure the build, 64-bit
test $(uname -m) = "x86_64" &&
./configure --prefix=/usr --docdir=/usr/doc/bison --infodir=/usr/info \
--libdir=/usr/lib64 --mandir=/usr/man --disable-nls
# Configure the build, anything else
test $(uname -m) != "x86_64" &&
./configure --prefix=/usr --docdir=/usr/doc/bison --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.8.2.tar.xz installed/
# If you ever want to uninstall Bison, this should do it:
# ('make uninstall' as root from configured source is enough)
cd
su
test -d src/bison-* && ( cd src/bison-* ; make uninstall )
( cd /usr/bin ; rm -f bison yacc )
test -d /usr/doc/bison && rm -r /usr/doc/bison
rm -f /usr/lib*/liby.*
( cd /usr/man/man1 ; rm -f bison.1 yacc.1 )
test -d /usr/share/bison && rm -r /usr/share/bison
rm -f /usr/info/bison.info \
/usr/lib/liby.* /usr/lib64/liby.* \
/usr/share/aclocal/bison-i18n.m4 \
/usr/info/bison.info
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "bison-*" -exec rm -r {} \;
rm -f ~/installed/bison-*.tar.*