The GDBM package contains the GNU Database Manager. It is a library of database functions that uses extensible hashing and works like the standard UNIX dbm. The library provides primitives for storing key/data pairs, searching and retrieving the data by its key and deleting a key along with its data.
Create the PKGBUILD for the GDBM package with the following commands:
mkdir /sources/gdbm
cd /sources/gdbm
cat > PKGBUILD << "REALEOF"
# Maintainer: Linux From Scratch <lfs-dev@lists.linuxfromscratch.org>
pkgname="gdbm"
pkgver="1.24"
pkgrel="1"
pkgdesc="The GDBM package contains the GNU Database Manager."
arch=('x86'
'x86_64')
url="https://www.gnu.org/software/gdbm/"
license=('GPLv3')
groups=('core')
depends=('bash'
'glibc'
'readline'
'rootfs')
makedepends=('binutils'
'coreutils'
'diffutils'
'gcc'
'grep'
'make'
'sed')
source=('https://ftp.gnu.org/gnu/gdbm/gdbm-1.24.tar.gz')
md5sums=('c780815649e52317be48331c1773e987')
build(){
cd ${pkgname}-${pkgver}
./configure --prefix=/usr \
--disable-static \
--enable-libgdbm-compat
make
}
check(){
cd ${pkgname}-${pkgver}
make check
}
package(){
cd ${pkgname}-${pkgver}
make DESTDIR=${pkgdir} install
}
REALEOF
The meaning of the configure option:
--enable-libgdbm-compat
This switch enables building the libgdbm compatibility library. Some packages outside of LFS may require the older DBM routines it provides.
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 gdbm-1.24-1-$(uname -m).pkg.tar.xz \
/srv/pacman/repos/LFS/
repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \
/srv/pacman/repos/LFS/gdbm-1.24-1-$(uname -m).pkg.tar.xz
Update the local cache and install the GDBM package:
pacman -Syu pacman -S gdbm --overwrite \* -dd --noconfirm
Finally, copy the source files into the source repository and clean up the build directory:
mkdir /srv/pacman/source/LFS/gdbm cp PKGBUILD /srv/pacman/source/LFS/gdbm cd /sources rm -rf gdbm