The GnuPG package contains a public/private key encryptor. This is useful for signing files or emails as proof of identity and preventing tampering with the contents of the file or email. For a more enhanced version of GnuPG which supports S/MIME, see the gnupg2 package.
Create the PKGBUILD for the GnuPG package with the following commands:
mkdir /sources/gnupg
cd /sources/gnupg
cat > PKGBUILD << "REALEOF"
# Maintainer: Linux From Scratch <lfs-dev@lists.linuxfromscratch.org>
pkgname="gnupg"
pkgver="2.4.7"
pkgrel="1"
pkgdesc="The GnuPG package is GNU's tool for secure communication and data storage."
arch=('x86'
'x86_64')
url="https://www.gnu.org/gnupg/"
license=('GPL3')
groups=('core')
depends=('curl'
'glibc'
'libassuan'
'libgcrypt'
'libksba'
'libusb'
'npth'
'sqlite')
makedepends=('bash'
'binutils'
'coreutils'
'gcc'
'gettext'
'grep'
'make'
'sed'
'texinfo')
makedepends('fuse'
'gnutls'
'openldap'
'tex')
source=('https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-2.4.7.tar.bz2')
md5sums=('59ec68633deefcd38a5012f39a9d9311')
build(){
cd "${pkgname}-${pkgver}"
./configure --prefix=/usr --libexecdir=/usr/lib
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 gnupg-2.4.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/gnupg-2.4.7-1-$(uname -m).pkg.tar.xz
Update the local cache and install the GnuPG package:
pacman -Syu pacman -S gnupg --overwrite \* -dd --noconfirm
Finally, copy the source files into the source repository and clean up the build directory:
mkdir /srv/pacman/source/LFS/gnupg cp PKGBUILD /srv/pacman/source/LFS/gnupg cd /sources rm -rf gnupg
--libexecdir=/usr/lib: This
command creates a gnupg directory in
/usr/lib instead of /usr/libexec.