# Get it
cd
test -f installed/grep-2.12.tar.xz && mv installed/grep-2.12.tar.xz .
test ! -f grep-2.12.tar.xz &&
wget http://ftpmirror.gnu.org/grep/grep-2.12.tar.xz
# Verify tarball w/ md5sum:
# (this came from my gpg-verified tarball)
echo "8d2f0346d08b13c18afb81f0e8aa1e2f grep-2.12.tar.xz" | md5sum -c
# Verify tarball w/ sha1sum:
# (this also came from my gpg-verified tarball)
echo "0853e96b22050cc3ff11a60e5715ca0c9852a715 grep-2.12.tar.xz" | sha1sum -c
# Extract it
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "grep-*" -exec rm -r {} \;
tar xJvf ~/grep-2.12.tar.xz
cd grep-2.12
test $UID = 0 && chown -R root:root .
# Configure and build it
./configure --prefix=/usr --infodir=/usr/info --mandir=/usr/man --disable-nls
make
# Become root to install it
su
# Remove the Slackware package, if there is one, remove a few other
# miscellaneous old files
test -x /sbin/removepkg && /sbin/removepkg grep
rm -f /usr/bin/egrep /usr/bin/fgrep
find /usr/share/locale -name grep.mo -exec rm {} \;
# If you ever want to uninstall grep (why?), this should do it:
cd
su
test -d src/grep-* && ( cd src/grep-* ; make uninstall )
( cd /usr/bin ; rm -f grep egrep fgrep )
( cd /usr/share/man/man1 ; rm -f grep.1 fgrep.1 egrep.1 )
rm -f /usr/share/info/grep.info
exit
find ~/src -maxdepth 1 -type d -name "grep-*" -exec rm -r {} \;
rm -f ~/installed/grep-*.tar.*