8.41.1. Installation of Psmisc
Create the PKGBUILD for the Psmisc package with the following
commands:
mkdir /sources/psmisc
cd /sources/psmisc
cat > PKGBUILD << "REALEOF"
# Maintainer: Linux From Scratch <lfs-dev@lists.linuxfromscratch.org>
pkgname="psmisc"
pkgver="23.7"
pkgrel="1"
pkgdesc="The Psmisc package contains programs for displaying information about running processes."
arch=('x86'
'x86_64')
url="https://gitlab.com/psmisc/psmisc"
license=('GPLv2')
groups=('core')
depends=('glibc'
'ncurses')
makedepends=('bash'
'binutils'
'coreutils'
'gcc'
'gettext'
'grep'
'make'
'sed')
source=('https://sourceforge.net/projects/psmisc/files/psmisc/psmisc-23.7.tar.xz')
md5sums=('53eae841735189a896d614cba440eb10')
build(){
cd "${pkgname}-${pkgver}"
./configure --prefix=/usr
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 psmisc-23.7-1-$(uname -m).pkg.tar.xz \
/srv/pacman/repos/LFS/
repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \
/srv/pacman/repos/LFS/psmisc-23.7-1-$(uname -m).pkg.tar.xz
Update the local cache and install the Psmisc package:
pacman -Syu
pacman -S psmisc --overwrite \* -dd --noconfirm
Finally, copy the source files into the source repository and clean
up the build directory:
mkdir /srv/pacman/source/LFS/psmisc
cp PKGBUILD /srv/pacman/source/LFS/psmisc
cd /sources
rm -rf psmisc