8.116. Gpgme-1.24.2

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.

Approximate build time: 1.5 SBU
Required disk space: 404 MB

8.116.1. Installation of GPGME

Create the PKGBUILD for the GPGME package with the following commands:

mkdir /sources/gpgme
cd /sources/gpgme
cat > PKGBUILD << "REALEOF"
# Maintainer: Linux From Scratch <lfs-dev@lists.linuxfromscratch.org>

pkgname="gpgme"
pkgver="1.24.2"
pkgrel="1"
pkgdesc="The GPGME package is a C library that allows cryptography support to be added to a program."
arch=('x86'
      'x86_64')
url="https://www.gnupg.org/gcrypt/gpgme/"
license=('GPL3')
groups=('core')
depends=('glibc'
         'gnupg'
         'libassuan'
         'python')
makedepends=('bash'
             'binutils'
             'coreutils'
             'gcc'
             'grep'
             'make')
optdepends=('clisp'
            'doxygen'
            'graphviz'
            'qt'
            'swig')
source=('https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-1.24.2.tar.bz2')
md5sums=('2e0cc1df9f3da8c2a7d7c9dc33b7f0bf')

build(){
  cd "${pkgname}-${pkgver}"
  ./configure --prefix=/usr --disable-gpg-test
  make
}

package(){
  cd "${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
}
REALEOF

Prepare the build directory for the pacman user and build the package:

chown -R root:pacman .
chmod 2775 .
chmod 664 PKGBUILD
su pacman -c 'makepkg -L --nodeps'

Add the newly created package to the central package repository:

cp gpgme-1.24.2-1-$(uname -m).pkg.tar.xz \
   /srv/pacman/repos/LFS/
repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \
         /srv/pacman/repos/LFS/gpgme-1.24.2-1-$(uname -m).pkg.tar.xz

Update the local cache and install the GPGME package:

pacman -Syu
pacman -S gpgme --overwrite \* -dd --noconfirm

Finally, copy the source files into the source repository and clean up the build directory:

mkdir /srv/pacman/source/LFS/gpgme
cp PKGBUILD /srv/pacman/source/LFS/gpgme
cd /sources
rm -rf gpgme

8.116.2. Command Explanations

--disable-gpg-test: if this parameter is not passed to configure, the test programs are built during make stage, which requires gnupg2.

8.116.3. Contents

Installed Program: gpgme-config, gpgme-json, and gpgme-tool
Installed Libraries: libgpgme, libgpgmepp.so, and libqgpgme.so
Installed Directory: /usr/include/{gpgme++,qgpgme,QGpgME}, /usr/lib/cmake/{Gpgmepp,QGpgme}. /usr/lib/python{2.7,3.7}/site-packages/gpg, and /usr/share/common-lisp/source/gpgme

Short Descriptions

gpgme-config

is used to obtain GPGME compilation and linking information.

gpgme-json

outputs GPGME commands in JSON format.

gpgme-tool

prints fingerprint and keyid 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.