The Less package contains a text file viewer.
This patch fixes a bug in the configure script, so that sigset_t and sigprocmask are detected and used:
patch -Np1 -i ../less-394-signal_fix-1.patch
Add assert() to the source to remove the warnings from -D_FORTIFY_SOURCE=2:
sed -e 's/dup(inp)/assert(&)/' \
-e 's/system(p)/assert(&)/' \
-e 's/#include "position.h"/&\n#include <assert.h>/' \
-i.orig lsystem.c
sed -e 's/fwrite(.*)/assert(&)/' \
-e 's/#include "cmd.h"/&\n#include <assert.h>/' \
-i.orig lesskey.c
Some warning flags can be added too:
sed 's/^CFLAGS =.*/& -Wformat -Wformat-security -Werror -Wfatal-errors/' \
-i.orig Makefile.in
Prepare Less for compilation:
./configure --prefix=/usr --sysconfdir=/etc \
--with-secure
The meaning of the configure options:
This option tells the programs created by the package to look in /etc for the configuration files.
This optional switch will disable the "!" shell command, "|" pipe command, ":e" examine command, "v" editing command, "-o" log files, "-k" use of lesskey files, "-t" use of tags, metacharacters in filenames, and filename completion. This switch has the same effect as the LESSSECURE=1 environment variable, except that it is hard coded.
Compile the package:
make
This package does not come with a test suite.
Install the package:
make install