sed - GNU stream editor ChangeLog

HOWTO


# GNU sed 4.9
# ===========
# Slackware 14.0: sed 4.2.1
# Slackware 14.1, 14.2: sed 4.2.2
# Slackware 15.0: sed 4.8

# I have not tried it, but there is another sed called super-sed:
# http://sed.sourceforge.net/grabbag/ssed/

# info-gnu: sed-4.9 released [stable]
# sed manual
# sed Sourceforge project
# Mailing list info-gnu
# Mailing list sed-devel
# Mailing list bug-sed

# Git repository aceesible via:
# a href="https://git.savannah.gnu.org/cgit/sed.git">cgit
# a href="https://git.savannah.gnu.org/gitweb/?p=sed.git">gitweb

# Prerequisites:
# texinfo (makeinfo is used to build HTML documentation)
# glibc's iconv or libiconv
# Bison

# If the download URL does not work below, download alternatives:
# http://ftpirror.gnu.org/sed/ (automatic redirect)
# https://ftp.gnu.org/gnu/sed/
# https://www.gnu.org/prep/ftp.html (GNU mirrors)

# Get the tarball
cd
test -f installed/sed-4.9.tar.xz && mv installed/sed-4.9.tar.xz .
test ! -f sed-4.9.tar.xz &&
wget http://ftpmirror.gnu.org/sed/sed-4.9.tar.xz

# Verify tarball w/ sha256sum:
# (this came from the info-gnu/Savannah release announcement)
# Either requires cksum from coreutils >= 9.2 or you have to do some
# extra handling because the checksum is base64 encoded
# biJrcy4c1zlGStaGK9Ghq6QteYKSLaelNRljHSSXUYE=
# ->
# sha256sum -b sed-4.9.tar.xz | xxd -r -p | base64
# -or-
# shasum -a 256 -b sed-4.9.tar.xz | xxd -r -p | base64
# -or-
# openssl sha256 -binary sed-4.9.tar.xz | openssl base64
# ->
echo "6e226b732e1cd739464ad6862bd1a1aba42d7982922da7a53519631d249751\
81  sed-4.9.tar.xz" | sha256sum -c

# Verify tarball w/ gpg:
( gpg --recv-keys 7FD9FCCB000BEEEE > /dev/null 2>&1 ||
  gpg --list-keys 7FD9FCCB000BEEEE ) &&
wget -nc http://ftpmirror.gnu.org/sed/sed-4.9.tar.xz.sig &&
  gpg --verify sed-4.9.tar.xz.sig && rm sed-4.9.tar.xz.sig

# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "sed-*" -exec rm -r {} \;
tar xJvf ~/sed-4.9.tar.xz
cd sed-4.9
test $UID = 0 && chown -R root:root .

# If you don't have a sed binary installed (./configure uses it), do
# this first:
./bootstrap
./configure --disable-xattr
make
su -c "cp sed/sed /bin/"
chmod -R u+w .
cd ..
rm -r ./sed-4.9
tar xJvf ~/sed-4.9.tar.xz
cd sed-4.9
test $UID = 0 && chown -R root:root .

# Configure the build
./configure --prefix=/usr --bindir=/bin --infodir=/usr/info \
--mandir=/usr/man --disable-nls

# Build it
make

# Become root to install it
su

# Probably a good idea to copy your existing /bin/sed just in case
# cp -a /bin/sed /root/

# Remove old files that may cause issues
find /usr/doc -maxdepth 1 -type d -name "sed-*" -exec rm -r {} \;
test -d /usr/doc/sed && rm -r /usr/doc/sed
rm -f /usr/info/sed.info* /usr/man/man1/sed.1*
find /usr/share/locale -type f -name "sed.mo" -exec rm {} \;

# Move the sed package to removed packages, because running removepkg
# may run sed...
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

# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+rw .

# Become yourself again
exit

# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/sed-*.tar.*
mv sed-4.9.tar.xz installed/

List of HOWTOs

Web page itself last updated: 2023-12-20 8:06pm (EDT -0400)
HOWTO last updated: 2024-02-26 8:03pm
Copyright © 2001-2024 Jason Englander. All Rights reserved.
[HTML5]