The DejaGnu package contains a framework for running test suites on GNU tools. It is written in expect, which itself uses Tcl (Tool Command Language).
Create the PKGBUILD for the DejaGNU package with the following commands:
mkdir /sources/dejagnu
cd /sources/dejagnu
cat > PKGBUILD << "REALEOF"
# Maintainer: Linux From Scratch <lfs-dev@lists.linuxfromscratch.org>
pkgname="dejagnu"
pkgver="1.6.3"
pkgrel="1"
pkgdesc="The DejaGnu package contains a framework for running test suites on GNU tools."
arch=('x86'
'x86_64')
url="https://www.gnu.org/software/dejagnu/"
license=('GPLv3')
groups=('core')
depends=('bash'
'expect')
makedepends=('coreutils'
'diffutils'
'gcc'
'grep'
'make'
'sed'
'texinfo')
source=('https://ftp.gnu.org/gnu/dejagnu/dejagnu-1.6.3.tar.gz')
md5sums=('68c5208c58236eba447d7d6d1326b821')
build() {
cd "${pkgname}-${pkgver}"
# Upstream recommends a dedicated build directory
mkdir -v build
cd build
../configure --prefix=/usr
makeinfo --html --no-split -o doc/dejagnu.html ../doc/dejagnu.texi
makeinfo --plaintext -o doc/dejagnu.txt ../doc/dejagnu.texi
}
check() {
cd "${pkgname}-${pkgver}/build"
make check
}
package() {
cd "${pkgname}-${pkgver}/build"
make DESTDIR="${pkgdir}" install
install -vdm755 "${pkgdir}/usr/share/doc/${pkgname}-${pkgver}"
install -vm644 doc/dejagnu.{html,txt} \
"${pkgdir}/usr/share/doc/${pkgname}-${pkgver}"
}
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 dejagnu-1.6.3-1-$(uname -m).pkg.tar.xz \
/srv/pacman/repos/LFS/
repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \
/srv/pacman/repos/LFS/dejagnu-1.6.3-1-$(uname -m).pkg.tar.xz
Update the local cache and install the DejaGNU package:
pacman -Syu pacman -S dejagnu --overwrite \* -dd --noconfirm
Finally, copy the source files into the source repository and clean up the build directory:
mkdir /srv/pacman/source/LFS/dejagnu cp PKGBUILD /srv/pacman/source/LFS/dejagnu cd /sources rm -rf dejagnu