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

### Chapter 4. Security

- Prev

  GnuTLS-3.8.9

- Next

  iptables-1.8.11

- Up
- Home

# GPGME-1.24.2

## Introduction to GPGME

The GPGME package is a C library that allows cryptography support to be added to a program. It is designed to make access to public key crypto engines like GnuPG or GpgSM easier for applications. GPGME provides a high-level crypto API for encryption, decryption, signing, signature verification and key management.

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

### Package Information

- Download (HTTP): https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-1.24.2.tar.bz2

- Download MD5 sum: 2e0cc1df9f3da8c2a7d7c9dc33b7f0bf

- Download size: 1.8 MB

- Estimated disk space required: 404 MB (with tests)

- Estimated build time: 1.5 SBU (with all bindings and tests; with parallelism=4)

### GPGME Dependencies

#### Required

libassuan-3.0.2

#### Optional

Doxygen-1.13.2 and Graphviz-12.2.1 (for API documentation), GnuPG-2.4.7 (required if Qt or SWIG are installed; used during the test suite), Clisp-2.49, and SWIG-4.3.0 (for language bindings)

## Installation of GPGME

Install GPGME by running the following commands:

    mkdir build &&
    cd    build &&

    ../configure --prefix=/usr --disable-gpg-test &&
    make PYTHONS=

If SWIG-4.3.0 is installed, build the Python 3 binding as a wheel:

    if swig -version > /dev/null; then
      srcdir=$PWD/../lang/python \
      top_builddir=$PWD          \
      pip3 wheel -w dist --no-build-isolation --no-deps --no-cache-dir $PWD/lang/python
    fi

To test the results, you should have GnuPG-2.4.7 installed and remove the `--disable-gpg-test` above. Issue:

    if swig -version > /dev/null; then
      python3 -m venv testenv                                              &&
      testenv/bin/pip3 install --no-index --find-links=dist --no-cache-dir \
                               gpg                                         &&
      sed '/PYTHON/s#run-tests.py#& --python-libdir=/dev/null#'            \
          -i lang/python/tests/Makefile
    fi &&

    make -k check PYTHONS= PYTHON=$PWD/testenv/bin/python3

Now, as the `root` user:

    make install PYTHONS=

If SWIG-4.3.0 is installed, still as the `root` user, install the Python 3 binding:

    if swig -version > /dev/null; then
      pip3 install --no-index --find-links dist --no-user gpg
    fi

## Command Explanations

`--disable-gpg-test`: if this parameter is not passed to configure, the test programs are built during make stage, which requires GnuPG-2.4.7. This parameter is not needed if GnuPG-2.4.7 is installed.

`PYTHONS=`: Disable building Python binding using the deprecated python3 setup.py build command. The explicit instruction to build the Python 3 binding with the pip3 wheel command is provided.

## Contents

Installed Program: gpgme-json, and gpgme-tool
Installed Libraries: libgpgme.so, libgpgmepp.so, and libqgpgme.so
Installed Directory: /usr/include/{gpgme++,qgpgme,QGpgME}, /usr/lib/cmake/{Gpgmepp,QGpgme}. /usr/lib/python3.13/site-packages/gpg{,-1.24.2.dist-info}, and /usr/share/common-lisp/source/gpgme

### Short Descriptions

gpgme-json | outputs GPGME commands in JSON format
gpgme-tool | is an assuan server exposing GPGME operations, such as printing fingerprints and keyids with keyservers
`libgpgme.so` | contains the GPGME API functions
`libgpgmepp.so` | contains the C++ GPGME API functions
`libqgpgme.so` | contains API functions for handling GPG operations in Qt applications

- Prev

  GnuTLS-3.8.9

- Next

  iptables-1.8.11

- Up
- Home