8.103. Libksba-1.6.7

The Libksba package contains a library used to make X.509 certificates as well as making the CMS (Cryptographic Message Syntax) easily accessible by other applications. Both specifications are building blocks of S/MIME and TLS. The library does not rely on another cryptographic library but provides hooks for easy integration with Libgcrypt.

Approximate build time: 0.1 SBU
Required disk space: 9.4 MB

8.103.1. Installation of Libksba

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

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

pkgname="libksba"
pkgver="1.6.7"
pkgrel="1"
pkgdesc="${pkgname} ${pkgver}"
arch=('x86'
      x86_64')
license=('GPLv2'
         'GPLv3'
         'LGPLv3')
url="https://www.gnupg.org/gcrypt/"
groups=('core')
depends=('glibc'
         'libgcrypt'
         'rootfs')
makedepends=('bash'
             'binutils'
             'coreutils'
             'gcc'
             'grep'
             'make'
             'sed')
source=('https://www.gnupg.org/ftp/gcrypt/libksba/libksba-1.6.7.tar.bz2')
md5sums=('7e736de467b67c7ea88de746c31ea12f')

build(){
  cd "${pkgname}-${pkgver}"
  ./configure --prefix=/usr
  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 libksba-1.6.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/libksba-1.6.7-1-$(uname -m).pkg.tar.xz

Update the local cache and install the Libksba package:

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

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

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

8.103.2. Contents

Installed Program: ksba-config
Installed Library: libksba.so
Installed Directory: None

Short Descriptions

ksba-config

is a utility used to configure and build applications based on the libksba(3) 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 libksba(3) library.

libksba.{so,a}

contains the cryptographic API functions.