8.104. Libtasn1-4.20.0

libtasn1 is a highly portable C library that encodes and decodes DER/BER data following an ASN.1 schema.

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

8.104.1. Installation of libtasn1

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

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

pkgname="libtasn1"
pkgver="4.20.0"
pkgrel="1"
pkgdesc="Libtasn1 is a highly portable C library that encodes and decodes DER/BER data following an ASN.1 schema."
arch=('x86'
      'x86_64')
url="https://www.gnu.org/libtasn/"
license=('GPL3')
groups=('core')
depends=('libgpg-error'
         'npth')
makedepends=('bash'                                                                                                                  'binutils'                                                                                                              'coreutils'                                                                                                             'gcc'                                                                                                                   'gettext'                                                                                                               'make'                                                                                                                  'texinfo')
optdepends=('gtk-doc'
            'valgrind)
source=('https://ftp.gnu.org/gnu/libtasn1/libtasn1-4.20.0.tar.gz')
md5sums=('930f71d788cf37505a0327c1b84741be')
 
build(){
  cd "${pkgname}-${pkgver}"
  ./configure --prefix=/usr --disable-static
  make
}

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

package(){
  cd "${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
  make DESTDIR="${pkgdir}" -C doc/reference install-data-local
}
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 libtasn1-4.20.0-1-$(uname -m).pkg.tar.xz \
   /srv/pacman/repos/LFS/
repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \
         /srv/pacman/repos/LFS/libtasn1-4.20.0-1-$(uname -m).pkg.tar.xz

Update the local cache and install the Libtasn1 package:

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

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

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

8.104.2. Contents

Installed Programs: asn1Coding, asn1Decoding and asn1Parser
Installed Library: libtasn1.so
Installed Directory: /usr/share/gtk-doc/html/libtasn1

Short Descriptions

asn1Coding

is an ASN.1 DER encoder.

asn1Decoding

is an ASN.1 DER decoder.

asn1Parser

is an ASN.1 syntax tree generator for libtasn1.

libtasn1.so

is a library for Abstract Syntax Notation One (ASN.1) and Distinguish Encoding Rules (DER) manipulation.