8.75. Popt-1.19

The popt package contains the popt libraries which are used by some programs to parse command-line options.

Approximate build time: less than 0.1 SBU
Required disk space: 6.9 MB

8.75.1. Installation of Popt

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

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

pkgname="popt"
pkgver="1.19"
pkgrel="1"
pkgdesc="The popt package contains the popt libraries which are used by some programs to parse command-line options."
arch=('x86'
      'x86_64')
url="https://github.com/rpm-software-management/popt"
license=('custom'
         'MIT')
groups=('core')
depends=('glibc'
         'rootfs')
makedepends=('binutils'
             'coreutils'
             'gcc'
             'gettext'
             'grep'
             'make'
             'sed'
             'texinfo')
source=('https://ftp.osuosl.org/pub/rpm/popt/releases/popt-1.x/popt-1.19.tar.gz')
md5sums=('eaa2135fddb6eb03f2c87ee1823e5a78')
 
build(){
  cd "${pkgname}-${pkgver}"
  ./configure --prefix=/usr --disable-static
  make

  # If you have Doxygen installed, uncomment the following:
  # sed -i 's@\./@src/@' Doxyfile
  # doxygen
}

check(){
  cd "${pkgname}-${pkgver}"
  make check
}

package(){
  cd "${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install

  # Again, if Doxygen is installed:
  # install -vdm755 "${pkgdir}/usr/share/doc/popt-1.19"
  # install -v -m644 doxygen/html/* "${pkgdir}/usr/share/doc/popt-1.19"
}
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 popt-1.19-1-$(uname -m).pkg.tar.xz \
   /srv/pacman/repos/LFS/
repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \
         /srv/pacman/repos/LFS/popt-1.19-1-$(uname -m).pkg.tar.xz

Update the local cache and install the Popt package:

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

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

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

8.75.2. Contents of Popt

Installed library: libpopt.so

Short Descriptions

libpopt

Searches given directory trees for files matching the specified criteria