8.50.1. Installation of Inetutils
Create the PKGBUILD for the Inetutils package with the following
commands:
mkdir /sources/inetutils
cd /sources/inetutils
cat > PKGBUILD << "REALEOF"
# Maintainer: Linux From Scratch <lfs-dev@lists.linuxfromscratch.org>
pkgname="inetutils"
pkgver="2.6"
pkgrel="1"
pkgdesc="The Inetutils package contains programs for basic networking."
arch=('x86'
'x86_64')
url="https://www.gnu.org/software/inetutils/"
license=('GPLv3')
groups=('core')
depends=('gcc'
'glibc'
'ncurses'
'readline'
'rootfs')
makedepends=('bash'
'binutils'
'coreutils'
'grep'
'make'
'patch'
'sed'
'texinfo'
'zlib')
source=('https://ftp.gnu.org/gnu/inetutils/inetutils-2.6.tar.xz')
md5sums=('401d7d07682a193960bcdecafd03de94')
prepare(){
cd ${pkgname}-${pkgver}
# Fix a build issue with gcc-14.1 or later
sed -i 's/def HAVE_TERMCAP_TGETENT/ 1/' telnet/telnet.c
}
build(){
cd ${pkgname}-${pkgver}
./configure --prefix=/usr \
--bindir=/usr/bin \
--localstatedir=/var \
--disable-logger \
--disable-whois \
--disable-rcp \
--disable-rexec \
--disable-rlogin \
--disable-rsh \
--disable-servers
make
}
check(){
cd ${pkgname}-${pkgver}
make check
}
package(){
cd ${pkgname}-${pkgver}
make DESTDIR=${pkgdir} install
install -vdm755 ${pkgdir}/usr/sbin
mv -v ${pkgdir}/usr/{,s}bin/ifconfig
}
REALEOF
The meaning of the configure options:
-
--disable-logger
-
This option prevents Inetutils from installing the
logger program,
which is used by scripts to pass messages to the System Log
Daemon. Do not install it because Util-linux installs a more
recent version.
-
--disable-whois
-
This option disables the building of the Inetutils
whois client,
which is out of date. Instructions for a better whois client are in the
BLFS book.
-
--disable-r*
-
These parameters disable building obsolete programs that
should not be used due to security issues. The functions
provided by these programs can be provided by the
openssh package in the BLFS
book.
-
--disable-servers
-
This disables the installation of the various network servers
included as part of the Inetutils package. These servers are
deemed not appropriate in a basic LFS system. Some are
insecure by nature and are only considered safe on trusted
networks. Note that better replacements are available for
many of these servers.
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 inetutils-2.6-1-$(uname -m).pkg.tar.xz \ /srv/pacman/repos/LFS/ repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \ /srv/pacman/repos/LFS/inetutils-2.6-1-$(uname -m).pkg.tar.xz
Update the local cache and install the Inetutils package:
pacman -Syu
pacman -S inetutils --overwrite \* -dd --noconfirm
Finally, copy the source files into the source repository and clean
up the build directory:
mkdir /srv/pacman/source/LFS/inetutils
cp PKGBUILD /srv/pacman/source/LFS/inetutils
cd /sources
rm -rf inetutils