Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

236.2. gnupg-2.5.24

GNU Privacy Guard — OpenPGP encryption and signing

Version 2.5.24, release 2
Shelf security — Security applications: GnuPG and front-ends, password and secret managers, certificates, scanners, forensics and audit
Phase 43_toolkits (Toolkits), 43 of 344 in build order
Licence GPL-3.0-or-later
Homepage https://gnupg.org/
Build time 2.3 SBU
Installed size 9.4 MiB in 110 files
Recipe ports/core/security/gnupg/kpkgbuild

About

GnuPG is the GNU implementation of OpenPGP, and of S/MIME through its X.509 support: gpg encrypts and signs, gpg-agent holds the secret keys and asks for passphrases through pinentry, dirmngr fetches keys and certificate revocation lists, and scdaemon talks to smart cards. In KDOS it is the engine behind gpgme, and so behind Kleopatra, notmuch and podman’s image signatures; pass runs gpg directly.

Sources

Dependencies

Depends on: libassuan, libgcrypt, libgpg-error, libksba, npth, pinentry, gnutls, sqlite, zlib, bzip2, readline, libusb, tpm2-tss, openldap.

Required by (12): gpgme, kgpg, kleopatra, kmail, libkleo, mailcommon, messagelib, notmuch, pass, qca, qca-qt5, volume_key.

Patches

build.sh applies these; kpkg applies nothing by itself.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/43_toolkits/phase.env && kpkg install gnupg'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/security/gnupg.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/security/gnupg
echo 'bf149d01a2b9fcc0e4589b8ae8697d3d5c557ea48ed95a3fa55dd3b1187e6039  gnupg-2.5.24.tar.bz2' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/gnupg
SRC=$SRC_ROOT/gnupg-2.5.24
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf gnupg-2.5.24.tar.bz2 -C "$SRC" --strip-components=1

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

patch -p1 -i "$PORT_SRC/import-ecdh-key.patch"
./configure \
	--prefix=/usr \
	--sysconfdir=/etc \
	--localstatedir=/var \
	--libexecdir=/usr/lib/$name \
	--enable-card-support \
	--enable-ccid-driver \
	--enable-sqlite \
	--enable-gnutls \
	--disable-ntbtls \
	--with-tss=intel \
	--with-readline \
	--with-zlib \
	--with-bzip2 \
	--enable-ldap \
	--disable-nls \
	--disable-tests
grep -q '^#define USE_LDAP 1' config.h ||
	{ echo "gnupg: OpenLDAP not found at configure" >&2; exit 1; }
make
make DESTDIR=$PKG install

The switches, and why each is set:

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/gnupg, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf gnupg-2.5.24-2.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/gnupg, and runs the triggers its paths call for.

Contents

Installed programs: addgnupghome, applygnupgdefaults, dirmngr, dirmngr-client, gpg, gpg-agent, gpg-authcode-sign.sh, gpg-card, gpg-connect-agent, gpg-mail-tube, gpg-wks-client, gpg-wks-server, gpgconf, gpgparsemail, gpgsm, gpgsplit, gpgtar, gpgv, kbxutil, watchgnupg.

Installed directories: /usr/lib/gnupg, /usr/share/doc/gnupg, /usr/share/gnupg, /usr/share/licenses/gnupg.

Short descriptions

addgnupghome Create .gnupg home directories
applygnupgdefaults Run gpgconf --apply-defaults for all users.
dirmngr GnuPG's network access daemon
dirmngr-client Tool to access the Dirmngr services
gpg OpenPGP encryption and signing tool
gpg-agent Secret key management for GnuPG
gpg-card Administrate Smart Cards
gpg-connect-agent Communicate with a running agent
gpg-mail-tube Encrypt rfc822 formatted mail in a pipeline
gpg-wks-client Client for the Web Key Service
gpg-wks-server Server providing the Web Key Service
gpgconf Modify .gnupg home directories
gpgparsemail Parse a mail message into an annotated format
gpgsm CMS encryption and signing tool
gpgtar Encrypt or sign files into an archive
gpgv Verify OpenPGP signatures
watchgnupg Read and print logs from a socket

Notes

import-ecdh-key.patch is upstream’s own fix, taken from GnuPG’s repository with its commit header. Without it, importing an unprotected ECDH key builds its private key from the wrong public parameter, so a Curve25519 encryption subkey is stored under a keygrip nothing asks for, and every decryption with that subkey fails with “No secret key”.

pinentry’s dialog is Qt, so gnupg builds in 43_toolkits, and so does everything that reaches it through gpgme; see Build phases are named, banded and closed.