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