8.99. Libgpg-error-1.51

The Libgpg-error package contains a library that defines common error values for all GnuPG components.

Approximate build time: 0.3 SBU
Required disk space: 11 MB

8.99.1. Installation of Libgpg-error

Create the PKGBUILD for the Libgpg-error package with the following commands:

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

pkgname="libgpg-error"
pkgver="1.51"
pkgrel="1"
pkgdesc="Libgpg-error contains a library that defines common error values for GnuPG components."
arch=('x86'
      'x86_64')
url="https://www.gnupg.org/ftp/gcrypt"
license=('GPLv2'
         'LGPLv2.1')
groups=('core')
depends=('glibc')
makedepends=('bash'
             'binutils'
             'coreutils'
             'gawk'
             'gcc'
             'gettext'
             'grep'
             'inetutils'
             'make'
             'readline'
             'sed')
source=('https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.51.tar.bz2')
md5sums=('74b73ea044685ce9fd6043a8cc885eac')

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

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

package(){
  cd "${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
  install -vDm644 README "${pkgdir}/usr/share/doc/libgpg-error-${pkgver}/README"
}
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 libgp-error-1.51-1-$(uname -m).pkg.tar.xz \
   /srv/pacman/repos/LFS/
repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \
         /srv/pacman/repos/LFS/libgp-error-1.51-1-$(uname -m).pkg.tar.xz

Update the local cache and install the Libgpg-error package:

pacman -Syu
pacman -S libgpg-error --overwrite \* -dd --noconfirm

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

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

8.99.2. Contents

Installed Programs: gpg-error, gpg-error-config, gpgrt-config, and yat2m
Installed Library: libgpg-error.so
Installed Directories: /usr/share/common-lisp/source/gpg-error, /usr/share/libgpg-error, and /usr/share/doc/libgpg-error-1.51

Short Descriptions

gpg-error

is used to determine libgpg-error error codes.

gpg-error-config

is a utility used to configure and build applications based on the libgpg-error library. It can be used to query the C compiler and linker flags which are required to correctly compile and link the application against the libgpg-error library.

gpgrt-config

is the same script as gpg-error-config.

yat2m

extracts man pages from a Texinfo source.

libgpg-error.so

contains the libgpg-error API functions.