libtasn1 is a highly portable C library that encodes and decodes DER/BER data following an ASN.1 schema.
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