8.115. Gnupg-2.4.7

8.115.1. Introduction to GnuPG

The GnuPG package contains a public/private key encryptor. This is useful for signing files or emails as proof of identity and preventing tampering with the contents of the file or email. For a more enhanced version of GnuPG which supports S/MIME, see the gnupg2 package.

Approximate build time: 0.7 SBU
Required disk space: 135 MB

8.115.2. Installation of GnuPG

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

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

pkgname="gnupg"
pkgver="2.4.7"
pkgrel="1"
pkgdesc="The GnuPG package is GNU's tool for secure communication and data storage."
arch=('x86'
      'x86_64')
url="https://www.gnu.org/gnupg/"
license=('GPL3')
groups=('core')
depends=('curl'
         'glibc'
         'libassuan'
         'libgcrypt'
         'libksba'
         'libusb'
         'npth'
         'sqlite')
makedepends=('bash'
             'binutils'
             'coreutils'
             'gcc'
             'gettext'
             'grep'
             'make'
             'sed'
             'texinfo')
makedepends('fuse'
            'gnutls'
            'openldap'
            'tex')
source=('https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-2.4.7.tar.bz2')
md5sums=('59ec68633deefcd38a5012f39a9d9311')

build(){
  cd "${pkgname}-${pkgver}"
  ./configure --prefix=/usr --libexecdir=/usr/lib
  make
}

check(){
  cd "${pkgname}-${pkgver}"
  make check
}

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 gnupg-2.4.7-1-$(uname -m).pkg.tar.xz \
   /srv/pacman/repos/LFS/
repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \
         /srv/pacman/repos/LFS/gnupg-2.4.7-1-$(uname -m).pkg.tar.xz

Update the local cache and install the GnuPG package:

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

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

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

8.115.3. Command Explanations

--libexecdir=/usr/lib: This command creates a gnupg directory in /usr/lib instead of /usr/libexec.

8.115.4. Contents

Installed Programs: gpg, gpg-zip, gpgsplit, and gpgv
Installed Libraries: None
Installed Directories: /usr/lib/gnupg, /usr/share/gnupg and /usr/share/doc/gnupg-2.4.7

Short Descriptions

gpg

is the backend (command-line interface) for this OpenPGP implementation.

gpg-zip

shell script that implements a gpg-ized version of tar.

gpgsplit

separates key rings.

gpgv

is a verify only version of gpg.