8.43.1. Installation of Bison
Create the PKGBUILD for the Bison package with the following
commands:
mkdir /sources/bison
cd /sources/bison
cat > PKGBUILD << "REALEOF"
# Maintainer: Linux From Scratch <lfs-dev@lists.linuxfromscratch.org>
pkgname="bison"
pkgver="3.8.2"
pkgrel="1"
pkgdesc="The Bison package contains a parser generator."
arch=('x86'
'x86_64')
url="https://www.gnu.org/software/bison/"
license=('GPLv3')
groups=('core')
depends=('glibc'
'rootfs')
makedepends=('bash'
'binutils'
'coreutils'
'gcc'
'gettext'
'grep'
'm4'
'make'
'perl'
'sed')
checkdepends=('diffutils'
'findutils'
'flex')
optdepends=('doxygen: to build additional documetation')
source=('https://ftp.gnu.org/gnu/bison/bison-3.8.2.tar.xz')
md5sums=('c28f119f405a2304ff0a7ccdcc629713')
build(){
cd ${pkgname}-${pkgver}
./configure --prefix=/usr --docdir=/usr/share/doc/${pkgname}-${pkgver}
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 bison-3.8.2-1-$(uname -m).pkg.tar.xz \
/srv/pacman/repos/LFS/
repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \
/srv/pacman/repos/LFS/bison-3.8.2-1-$(uname -m).pkg.tar.xz
Update the local cache and install the Bison package:
pacman -Syu
pacman -S bison --overwrite \* -dd --noconfirm
Finally, copy the source files into the source repository and clean
up the build directory:
mkdir /srv/pacman/source/LFS/bison
cp PKGBUILD /srv/pacman/source/LFS/bison
cd /sources
rm -rf bison