#### Beyond Linux® From Scratch (System V Edition) - Version 12.3

### Chapter 12. System Utilities

- Prev

  Fcron-3.2.1

- Next

  Hdparm-9.65

- Up
- Home

# GPM-1.20.7

## Introduction to GPM

The GPM (General Purpose Mouse daemon) package contains a mouse server for the console and xterm. It not only provides cut and paste support generally, but its library component is used by various software such as Links to provide mouse support to the application. It is useful on desktops, especially if following (Beyond) Linux From Scratch instructions; it's often much easier (and less error prone) to cut and paste between two console windows than to type everything by hand!

This package is known to build and work properly using an LFS 12.3 platform.

### Package Information

- Download (HTTP): https://anduin.linuxfromscratch.org/BLFS/gpm/gpm-1.20.7.tar.bz2

- Download MD5 sum: bf84143905a6a903dbd4d4b911a2a2b8

- Download size: 820 KB

- Estimated disk space required: 7.4 MB

- Estimated build time: 0.1 SBU

### Additional Downloads

- Required patch: https://www.linuxfromscratch.org/patches/blfs/12.3/gpm-1.20.7-consolidated-1.patch

### GPM Dependencies

#### Optional

texlive-20240312 (for documentation)

## Kernel Configuration

Enable the following option in the kernel configuration and recompile the kernel if necessary:

    Device Drivers --->
      Input device support --->
        -*-   Generic input layer (needed for keyboard, mouse, ...)          [INPUT]
        <*/M>   Mouse interface                                     [INPUT_MOUSEDEV]

## Installation of GPM

Install GPM by running the following commands:

    patch -Np1 -i ../gpm-1.20.7-consolidated-1.patch                &&
    ./autogen.sh                                                    &&
    ./configure --prefix=/usr --sysconfdir=/etc ac_cv_path_emacs=no &&
    make

If texlive-20240312 is installed, build the GPM manual as dvi, ps, and pdf formats:

    make -C doc gpm.{dvi,ps} &&
    dvipdfm doc/gpm.dvi -o doc/gpm.pdf

This package does not come with a test suite.

Now, as the `root` user:

    make install                                          &&

    install-info --dir-file=/usr/share/info/dir           \
                 /usr/share/info/gpm.info                 &&

    rm -fv /usr/lib/libgpm.a                              &&
    ln -sfv libgpm.so.2.1.0 /usr/lib/libgpm.so            &&
    install -v -m644 conf/gpm-root.conf /etc              &&

    install -v -m755 -d /usr/share/doc/gpm-1.20.7/support &&
    install -v -m644    doc/support/*                     \
                        /usr/share/doc/gpm-1.20.7/support &&
    install -v -m644    doc/{FAQ,HACK_GPM,README*}        \
                        /usr/share/doc/gpm-1.20.7

If texlive-20240312 is installed and you've built GPM manual as dvi, ps, and pdf formats, install them as the `root` user:

    install -vm644 doc/gpm.{dvi,ps,pdf} /usr/share/doc/gpm-1.20.7

## Command Explanations

./autogen.sh: This command creates the missing configure script.

`ac_cv_path_emacs=no`: This variable works around an issue causing the package fail to build with Emacs-30.1 installed. It also suppresses the installations of some “Emacs support files” shipped with GPM. These files are quite outdated and they should be superseded with Emacs-30.1 built-in GPM support. If you need to use Emacs-30.1 in Linux console with mouse support, you should install (or reinstall) Emacs-30.1 after GPM.

install-info ...: This package installs a `.info` file, but does not update the system `dir` file. This command makes the update.

ln -v -sfn libgpm.so.2.1.0 /usr/lib/libgpm.so: This command is used to create (or update) the `.so` symlink to the library.

## Configuring GPM

### Boot Script

Install the `/etc/rc.d/init.d/gpm` init script included in the blfs-bootscripts-20250225 package.

    make install-gpm

### Config Files

`/etc/gpm-root.conf` and `~/.gpm-root`: The default and individual user gpm-root configuration files.

`/etc/sysconfig/mouse`: This file contains the name of your mouse device and the protocol it uses. To create this file, run the following as the `root` user:

    cat > /etc/sysconfig/mouse << "EOF"
    # Begin /etc/sysconfig/mouse

    MDEVICE="<yourdevice>"
    PROTOCOL="<yourprotocol>"
    GPMOPTS="<additional options>"

    # End /etc/sysconfig/mouse
    EOF

### Configuration Information

Examples of values to set `MDEVICE`, `PROTOCOL`, and `GPMOPTS` to are:

    MDEVICE="/dev/input/mice"
    PROTOCOL="imps2"
    GPMOPTS=""

A list of which protocol values are known can be found by running gpm -m `[device]` -t -help. The `MDEVICE` setting depends on which type of mouse you have. For example, `/dev/ttyS0` for a serial mouse (on Windows this is COM1), `/dev/input/mice` is often used for USB mice and `/dev/psaux` for PS2 mice. `GPMOPTS` is the 'catch all' for any additional options that are needed for your hardware.

## Contents

Installed Programs: disable-paste, display-buttons, display-coords, get-versions, gpm, gpm-root, hltest, mev, and mouse-test
Installed Library: libgpm.so
Installed Directory: /usr/share/doc/gpm-1.20.7

### Short Descriptions

disable-paste | is a security mechanism used to disable the paste buffer
display-buttons | is a simple program that reports the mouse buttons being pressed and released
display-coords | is a simple program that reports the mouse coordinates
get-versions | is used to report the GPM library and server versions
gpm | is a cut and paste utility and mouse server for virtual consoles
gpm-root | is a default handler for gpm. It is used to draw menus on the root window
hltest | is a simple sample application using the high-level library, meant to be read by programmers trying to use the high-level library
mev | is a program to report mouse events
mouse-test | is a tool for determining the mouse type and device it's attached to
`libgpm.so` | contains the API functions to access the GPM daemon

- Prev

  Fcron-3.2.1

- Next

  Hdparm-9.65

- Up
- Home