6.28. Less-394

The Less package contains a text file viewer.

6.28.1. Installation of Less

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:

--sysconfdir=/etc

This option tells the programs created by the package to look in /etc for the configuration files.

--with-secure

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

6.28.2. Contents of Less

Installed programs: less, lessecho, and lesskey

Short Descriptions

less

A file viewer or pager; it displays the contents of the given file, letting the user scroll, find strings, and jump to marks

lessecho

Needed to expand meta-characters, such as * and ?, in filenames on Unix systems

lesskey

Used to specify the key bindings for less