8.45.1. Installation of Bash
Create the PKGBUILD for the Bash package with the following
commands:
mkdir /sources/bash
cd /sources/bash
cat > PKGBUILD << "REALEOF"
# Maintainer: Linux From Scratch <lfs-dev@lists.linuxfromscratch.org>
pkgname="bash"
pkgver="5.2.37"
pkgrel="1"
pkgdesc="The Bash package contains the Bourne-Again SHell."
arch=('x86'
'x86_64')
url="https://www.gnu.org/software/bash/"
license=('GPLv3')
groups=('core')
depends=('glibc'
'ncurses'
'readline'
'rootfs')
makedepends=('bash'
'binutils'
'bison'
'coreutils'
'diffutils'
'gawk'
'gcc'
'grep'
'make'
'patch'
'sed'
'texinfo')
checkdepends=('expect'
'shadow')
optdepends=('xorg')
source=('https://ftp.gnu.org/gnu/bash/bash-5.2.37.tar.gz')
md5sums=('9c28f21ff65de72ca329c1779684a972')
build(){
cd ${pkgname}-${pkgver}
./configure --prefix=/usr \
--without-bash-malloc \
--with-installed-readline \
--docdir=/usr/share/doc/bash-${version}
make
}
check(){
cd ${pkgname}-${pkgver}
make -k check || true
}
package(){
cd ${pkgname}-${pkgver}
make DESTDIR=${pkgdir} install
}
REALEOF
The meaning of the new configure option:
-
--with-installed-readline
-
This option tells Bash to use the readline library that is already installed
on the system rather than using its own readline version.
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 bash-5.2.37-1-$(uname -m).pkg.tar.xz \
/srv/pacman/repos/LFS/
repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \
/srv/pacman/repos/LFS/bash-5.2.37-1-$(uname -m).pkg.tar.xz
Update the local cache and install the Bash package:
pacman -Syu
pacman -S bash --overwrite \* -dd --noconfirm
Finally, copy the source files into the source repository and clean
up the build directory:
mkdir /srv/pacman/source/LFS/bash
cp PKGBUILD /srv/pacman/source/LFS/bash
cd /sources
rm -rf bash
Run the newly compiled bash program (replacing the one
that is currently being executed):
exec /usr/bin/bash --login