8.20. DejaGNU-1.6.3

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).

Approximate build time: less than 0.1 SBU
Required disk space: 6.9 MB

8.20.1. Installation of DejaGNU

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

8.20.2. Contents of DejaGNU

Installed program: dejagnu and runtest

Short Descriptions

dejagnu

DejaGNU auxiliary command launcher

runtest

A wrapper script that locates the proper expect shell and then runs DejaGNU