# S-nail 14.9.24 (2022-03-26)
# ==============
# nail became Heirloom mailx
# mailx development stopped
# S-nail development started
# S-nail may next be renamed S-mailx
# Get the tarball
cd
test -f installed/s-nail-14.9.24.tar.xz &&
mv -f installed/s-nail-14.9.24.tar.xz .
test ! -f s-nail-14.9.24.tar.xz &&
wget https://ftp.sdaoden.eu/s-nail-14.9.24.tar.xz
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "s-nail-*" -exec rm -r {} \;
tar xJvf ~/s-nail-14.9.24.tar.xz
cd s-nail-14.9.24
test $UID = 0 && chown -R root:root .
# Read ./README, ./INSTALL, and if this is an upgrade ./NEWS
# If you pass VAL_MAILX=mailx to it you can cause the binary to be named
# mailx, which is probably going to happen in the future. We leave it
# s-nail here and add a bunch of symlinks for nail/mail/Mail compatibility.
# Configure the build
make \
VAL_PREFIX=/usr \
VAL_SYSCONFDIR=/etc \
VAL_MANDIR=/usr/man \
VAL_MTA=/usr/sbin/sendmail \
config
# Build it
make build
# Test the build
make test
# Become root to install it
su
# Remove the Slackware package for s-nail and also nail and mailx
test -x /sbin/removepkg && /sbin/removepkg s-nail nail mailx
# You may still have an old /etc/nail.rc or /etc/mailx.rc from the Slackware
# package
test ! -d ~/backup && mkdir -p -m 0700 ~/backup
test -f /etc/nail.rc && mv /etc/nail.rc ~/backup/nail.rc-$(date +%Y%m%d)
test -f /etc/mailx.rc && mv /etc/mailx.rc ~/backup/mailx.rc-$(date +%Y%m%d)
# Install it
make install
# Remove symlinks and binaries that may cause confusion or symlinks pointing
# to the wrong place
( cd /bin ; rm -f nail Mail mail mailx )
( cd /usr/bin ; rm -f nail Mail mail mailx )
# Create symlinks
( cd /usr/bin
ln -s s-nail mailx
ln -s s-nail nail )
( cd /bin
ln -s /usr/bin/s-nail Mail
ln -s /usr/bin/s-nail mail
ln -s /usr/bin/s-nail mailx )
# If you mount /usr to a remote filesystem, may want to cp s-nail to /bin
# instead of using a symlink
# Become your non-root user again
exit
# Save the tarball for later
cd
mkdir -p -m 0700 installed
rm -f installed/s-nail-*.tar.*
mv s-nail-14.9.24.tar.xz installed/
# If you ever want to uninstall S-nail (?), this should do it:
cd
su
test -d src/s-nail-* && ( cd src/s-nail-* ; make uninstall )
test -x /usr/bin/s-nail-uninstall.sh && /usr/bin/s-nail-uninstall.sh
( cd /etc ; rm -f nail.rc s-nail.rc )
rm -f /usr/bin/s-nail /usr/man/man1/s-nail.1 /usr/libexec/s-nail-privsep \
/usr/bin/s-nail-uninstall.sh
# Look for broken symlinks in /bin and /usr/bin
exit
find ~/src -maxdepth 1 -type d -name "s-nail-*" -exec rm -r {} \;
rm -f ~/installed/s-nail-*.tar.*