8.126. Pacman-contirb-1.11.0

The Pacman-contirb package contains scripts and tools for Pacman systems.

Approximate build time: 0.1 SBU
Required disk space: 2.3 MB

8.126.1. Installation of Pacman-contirb

Create the PKGBUILD for the Pacman-contrib package with the following commands:

mkdir /sources/pacman-contrib
cd /sources/pacman-contrib
cat > PKGBUILD << "REALEOF"
# Maintainer: Linux From Scratch <lfs-dev@lists.linuxfromscratch.org>

pkgname="pacman-contrib"
pkgver="1.11.0"
pkgrel="1"
pkgdesc="Contains utilities useful for working with pacman based packages"
arch=('x86'
      'x86_64')
url="https://sources.archlinux.org/"
license=('GPLv2')
groups=('core')
depends=('bash'
         'diffutils'
         'fakeroot'
         'findutils'
         'glibc'
         'pacman'
         'perl'
         'sudo'
         'vim')
makedepends=('gcc'
             'make')
source=('https://gitlab.archlinux.org/pacman/pacman-contrib/-/archive/v1.11.0/pacman-contrib-v1.11.0.tar.bz2')
md5sums=('c6215cec282ee72b5a27713350a2c41a')

prepare(){
  cd "${pkgname}-v${pkgver}"
  ./autogen.sh
}

build(){
  cd "${pkgname}-v${pkgver}"
  ./configure --prefix=/usr     \
              --disable-doc     \
              --sysconfdir=/etc \
              --localstatedir=/var
  make
{

package(){
  cd "${pkgname}-v${pkgver}"
  make DESTDIR="${pkgdir}" install
  rm -rf "${pkgdir}/usr/lib/systemd/"
}
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 pacman-contrib-1.11.0-1-$(uname -m).pkg.tar.xz \
   /srv/pacman/repos/LFS/
repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \
         /srv/pacman/repos/LFS/pacman-contrib-1.11.0-1-$(uname -m).pkg.tar.xz

Update the local cache and install the Pacman-contrib package:

pacman -Syu
pacman -S pacman-contrib --overwrite \* -dd --noconfirm

Finally, copy the source files into the source repository and clean up the build directory:

mkdir /srv/pacman/source/LFS/pacman-contrib
cp PKGBUILD /srv/pacman/source/LFS/pacman-contrib
cd /sources
rm -rf pacman-contrib

8.126.2. Contents of Pacman-contirb

Installed programs: checkupdates, paccache, pacdiff, paclist, paclog-pkglist, pacscripts, pacsearch, pacsort, pactree, rankmirrors, and updpkgsums

Short Descriptions

checkupdates

is a utility to safely prints a list of pending updates.

paccache

is a flexible pacman cache cleaning utility.

pacdiff

is a pacorig, pacnew and pacsave configuration file maintenance utility.

paclist

is a utility to list all installed packages from a given repo.

paclog-pkglist

is a utiltiy to parse a log file into a list of currently installed packages.

pacscripts

is a utiltiy to print the {pre,post}_{install,remove,upgrade} scripts of a given package.

pacsearch

is a utility to search using both the local and the sync databases.

pacsort

is a sort utility implementing alpm_pkg_vercmp.

pactree

is a package dependency tree viewer.

rankmirrors

is a utility to rank pacman mirrors by their connection and opening speed.

updpkgsums

is a utility to update the checksums of a PKGBUILD file.