# Prerequisites:
# texinfo (makeinfo is used to build HTML documentation)
# iconv
# Bison
cd
test -f installed/sed-4.2.1.tar.bz2 && mv installed/sed-4.2.1.tar.bz2 .
test ! -f sed-4.2.1.tar.bz2 &&
wget http://ftpmirror.gnu.org/sed/sed-4.2.1.tar.bz2
# Verify tarball w/ md5sum:
# (this came from my gpg verified tarball)
echo "7d310fbd76e01a01115075c1fd3f455a sed-4.2.1.tar.bz2" | md5sum -c
# Verify tarball w/ sha1sum:
# (this also came from my gpg verified tarball)
echo "ace93d23eabc00d3a8187ecf07d3a02b1b297810 sed-4.2.1.tar.bz2" | sha1sum -c
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "sed-*" -exec rm -r {} \;
tar xjvf ~/sed-4.2.1.tar.bz2
cd sed-4.2.1
test $UID = 0 && chown -R root:root .
# If you don't have a sed binary installed (./configure uses it), do
# this first:
# (FYI - this did not work for me this time, but the regular build did)
sh ./bootstrap.sh
su -c "cp sed/sed /bin/"
cd ..
rm -r ./sed-4.2.1
tar xzvf ~/sed-4.2.1.tar.bz2
cd sed-4.2.1
test $UID = 0 && chown -R root:root .
./configure --prefix=/usr --bindir=/bin --infodir=/usr/info --mandir=/usr/man --disable-nls
make
# Become root to install it
su
# Remove old files that make cause issues
find /usr/doc -maxdepth 1 -type d -name "sed-*" -exec rm -r {} \;
rm -f /usr/info/sed.info* /usr/man/man1/sed.1*
find /usr/share/locale -type f -name "sed.mo" -exec rm {} \; 2> /dev/null
find /var/adm/packages -type f -name "sed*" -exec mv -f {} /var/log/removed_packages/ \;
find /var/adm/scripts -type f -name "sed*" -exec mv -f {} /var/log/removed_scripts/ \;
# Install the new version, the sed binary will be stripped
make install-strip
# Everything prior to Slackware 9.0, and this howto as well, put sed in
# /usr/bin. Slackware 9.0 puts sed in /bin and creates a symlink to it
# in /usr/bin. Makes sense, sed is important and if your /usr is actually
# a mount of a remote filesystem, sed might not exist early on during boot-up.
# So here we remove the old binary and create a symlink to the new one:
rm -f /usr/bin/sed
ln -sf /bin/sed /usr/bin/sed
# Slackware >= 9.0 has a 'sed' package, everything prior to it included sed
# in the 'bin' package. If you have < 9.0 and are really anal (like me),
# remove lines from the /var/adm/packages/bin* file that reference sed
# files that you just replaced:
# /usr/bin/sed
# /usr/doc/sed-*
# /usr/man/man1/sed.1.gz
# /usr/info/sed.info.gz
# Make sure your non-root user can remove the source later
chown -R root:root $USER .
chmod -R u+rw .