# GNU Ncurses 6.2 (ncurses = new curses)
# ===============
# Slackware 13.37, 14.0, 14.1, 14.2: ncurses 5.9
# Many other pieces of software can be removed before you install a new
# version with little to no ill-effects, 'make uninstall' the old one, 'make
# install' the new one. ncurses is so widely used that you may not be able
# to get away with that, without breaking a bunch of things. Below we blow
# away files that may be left over from old source-installed versions of
# ncurses, ass|u|me'ing that you still have libncurses in /lib or /lib64
# from Slackware's aaa_elflibs|aaa_libraries package to keep things working
# that use it. If you are not comfortable with that, skip the cleanup part
# before 'make install' below, then either leave it all there and hope for
# the best, or manually clean up files after the new version is installed -
# look for a date that is other than today.
#
# Loads of console programs like dialog, lynx, mc, mutt, ncftp, joe, vim,
# etc. use ncurses and even things like the Dropbox daemon do, so running
# something like:
# lsof /lib*/libncurses.* /usr/lib*/libncurses.*
# is not a bad idea, to find out what running programs are using it.
# Due to the number of patches, create a directory for the ncurses tarball
# and patches, move the tarball and patches into it (if you previously had
# any of them):
mkdir -p -m 0700 ~/installed/ncurses
( cd ~/installed
mv -f ncurses-6.2.tar.gz ncurses-*.patch.gz \
ncurses-*-patch.sh.bz2 ncurses/ 2> /dev/null )
# Get it
cd
test -f installed/ncurses/ncurses-6.2.tar.gz &&
mv installed/ncurses/ncurses-6.2.tar.gz .
test ! -f ncurses-6.2.tar.gz &&
wget http://ftpmirror.gnu.org/ncurses/ncurses-6.2.tar.gz
# Verify tarball w/ sha256sum:
# (this came from my gpg-verified tarball)
echo "30306e0c76e0f9f1f0de987cf1c82a5c21e1ce6568b9227f7da5b71cbea86c\
9d ncurses-6.2.tar.gz" | sha256sum -c
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "ncurses-*" -exec rm -r {} \;
tar xzvf ~/ncurses-6.2.tar.gz
cd ncurses-6.2
test $UID = 0 && chown -R root:root .
# gpg-verify, then apply patches that have come out since the full release
# if there is one, the latest rollout patch:
# [ Note: When I did this, one patch to ANNOUNCEMENT was .rej, changing it
# from a 6.1 version to 6.2, but that is just a text doc file, so just
# ignored that ]
gpg --list-keys F7E48EDB > /dev/null 2>&1 || gpg --recv-keys F7E48EDB
mv -f ~/installed/ncurses/ncurses-6.2-*.patch.gz .
rm -f ~/installed/ncurses/ncurses-*.patch.gz
wget -N https://invisible-mirror.net/archives/ncurses/6.2/dev-patches.zip
unzip -n dev-patches.zip
chmod u+w ncurses-6.2-*.patch.gz*
for file in ncurses-6.2-*.patch.gz;
do
test -f ${file}.asc && gpg --verify ${file}.asc && rm ${file}.asc
zcat $file | patch -p1 -N && mv -f $file ~/installed/ncurses/
echo "Hit enter to continue"
read
done
# Become root to clean up old files and to install it
su
# As I write this, Slackware-current no longer includes a libtermcap
# package, and ncurses includes a /usr/include/termcap.h ...
text -x /sbin/removepkg && /sbin/removepkg libtermcap
# Remove Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg ncurses
# Remove files from old source-installed versions.
# We do not mess with Slackware package libncurses or aaa_elflibs /lib*/
# files here.
( cd /usr/bin ; rm -f clear infocmp ncurses5-config ncursesw5-config \
ncurses6-config ncursesw6-config tabs tic toe tput tset )
find /usr/doc -maxdepth 1 -type d -name "ncurses-*" -exec rm -r {} \;
find /usr/include -type l -ilname "ncurses/*" -exec rm -r {} \;
test -d /usr/include/ncurses && rm -r /usr/include/ncurses
for lib in libform libformw libmenu libmenuw libncurses++ libncurses++w \
libncurses libncursesw libpanel libpanelw;
do
( cd /usr/lib ; rm -f "${lib}.*" )
test -d /usr/lib64 && ( cd /usr/lib64 ; rm -f "${lib}.*" )
done
test -L /usr/include/ncursesw &&
rm -f /usr/include/ncursesw
# If you have a termcap.h from the libtermcap package and you want to move
# it out of the way for the one from ncurses:
grep -q usr/include/termcap.h /var/adm/packages/libtermcap* &&
test ! -L /usr/include/termcap.h &&
mv -f /usr/include/termcap.h /usr/include/termcap.h.orig
# Install the new version
make install
# Create symlinks from the *.h files in /usr/include/ncurses/
# to /usr/include
( cd /usr/include
for file in ncurses/*.h ; do ln -sf $file . ; done )
# Install the 'w' version of everything
# It will just install the same man pages, /usr/share/terminfo files...
make install
# If you're really low on drive space, I'm pretty sure you could zap
# /usr/include/ncursesw and symlink from /usr/include/ncurses to that
# Move libncurses library files into /lib*/, fix up symlinks to make sure
# all is well
test $(uname -m) = 'x86_64' && LIBDIR=lib64
test $(uname -m) != 'x86_64' && LIBDIR=lib
# If you want things looking for -lcurses (no "n") to work
echo "INPUT(-lncurses)" > /usr/${LIBDIR}/libcurses.so
echo "INPUT(-lncursesw)" > /usr/${LIBDIR}/libcursesw.so
# Make sure the linker can see the libraries
ldconfig
# Unset the temporary lib or lib64
unset LIBDIR
# ncurses has a 'clear' and the textutils package has a 'clear'. The latter
# is a shell script that runs 'tput clear'. textutils, fileutils, and
# sh-utils became coreutils, and there was no clear in Slackware's coreutils
# last time I checked.
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# Become yourself again
exit
# Save the tarball for later
cd
mkdir -p -m 0700 installed
rm -f installed/ncurses-*.tar.* installed/ncurses/ncurses-*.tar.*
mv ncurses-6.2.tar.gz installed/ncurses/