8.112. libpsl-0.21.5

The libpsl package provides a library for accessing and resolving information from the Public Suffix List (PSL). The PSL is a set of domain names beyond the standard suffixes, such as .com.

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

8.112.1. Installation of libpsl

Create the PKGBUILD for the libpsl package with the following commands:

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

pkgname="libpsl"
pkgver="0.21.5"
pkgrel="1"
pkgdesc="Provides a library for accessing and resolving information from the Public Suffix List (PSL)"
arch=('x86'
      'x86_64')
url="https://github.com/rockdaboot/libpsl/"
license=('MIT')
groups=('core')
depends=('libidn2'
         'libunistring'
         'glibc'
         'rootfs')
makedepends=('bash'
             'binutils'
             'coreutils'
             'gcc'
             'make'
             'sed')
optdepends=('gtk-doc'
            'icu'
            'libidn'
            'valgrind')
source=('https://github.com/rockdaboot/libpsl/releases/download/0.21.5/libpsl-0.21.5.tar.gz')
md5sums=('870a798ee9860b6e77896548428dba7b')

build(){
  cd "${pkgname}-${pkgver}"
  mkdir build
  cd    build
  meson setup --prefix=/usr --buildtype=release
  ninja
}

package(){
  cd "${pkgname}-${pkgver}"
  DESTDIR="${pkgdir}" ninja 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 libpsl-0.21.5-1-$(uname -m).pkg.tar.xz \
   /srv/pacman/repos/LFS/
repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \
         /srv/pacman/repos/LFS/libpsl-0.21.5-1-$(uname -m).pkg.tar.xz

Update the local cache and install the libpsl package:

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

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

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

8.112.2. Contents

Installed Program: psl
Installed Library: libpsl.so

Short Descriptions

psl

queries the Public Suffix List

libpsl

contains a library used to access the Public Suffix List