The Readline package is a set of libraries that offers command-line editing and history capabilities.
Upstream developers have fixed several issues since the initial release of Readline-5.1. Apply those fixes:
patch -Np1 -i ../readline-5.1-fixes-3.patch
Reinstalling Readline will cause the old libraries to be moved to <libraryname>.old. While this is normally not a problem, in some cases it can trigger a linking bug in ldconfig. This can be avoided by issuing the following two seds:
sed -i '/MV.*old/d' Makefile.in sed -i '/{OLDSUFF}/c:' support/shlib-install
Prepare Readline for compilation:
./configure --prefix=/usr --libdir=/lib
Compile the package:
make SHLIB_LIBS=-lncurses
The meaning of the make option:
This option forces Readline to link against the libncurses (really, libncursesw) library.
This package does not come with a test suite.
Install the package:
make install
Give Readline's dynamic libraries more appropriate permissions:
chmod -v 755 /lib/lib{readline,history}.so*
Now move the static libraries to a more appropriate location:
mv -v /lib/lib{readline,history}.a /usr/lib
Next, remove the .so files in /lib and relink them into /usr/lib:
rm -v /lib/lib{readline,history}.so ln -sfv ../../lib/libreadline.so.5 /usr/lib/libreadline.so ln -sfv ../../lib/libhistory.so.5 /usr/lib/libhistory.so