8.118. Lzo-2.10

LZO is a data compression library which is suitable for data decompression and compression in real-time. This means it favors speed over compression ratio.

Approximate build time: 0.3 SBU
Required disk space: 12 MB

8.118.1. Installation of LZO

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

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

pkgname="lzo"
pkgver="2.10"
pkgrel="1"
pkgdesc="A data compression library which is suitable for data decompression and compression in real-time."
arch=('x86'
      'x86_64')
url="https://www.oberhumer.com/opensource/lzo/"
license=('GPLv2')
groups=('core')
depends=('glibc')
makedepends=('bash'
             'binutils'
             'coreutils'
             'diffutils'
             'gawk'
             'gcc'
             'grep'
             'make'
             'sed')
source=('http://www.oberhumer.com/opensource/lzo/download/lzo-2.10.tar.gz')
md5sums=('39d3f3f9c55c87b1e5d6888e1420f4b5')

build() {
  cd "${pkgname}-${pkgver}"
  ./configure --prefix=/usr    \
              --enable-shared  \
              --disable-static \
              --docdir="/usr/share/doc/${pkgname}-${pkgver}"
  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 lzo-2.10-1-$(uname -m).pkg.tar.xz \
   /srv/pacman/repos/LFS/
repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \
         /srv/pacman/repos/LFS/lzo-2.10-1-$(uname -m).pkg.tar.xz

Update the local cache and install the LZO package:

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

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

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

8.118.2. Contents

Installed Programs: None
Installed Libraries: liblzo2.so
Installed Directories: /usr/include/lzo and /usr/share/doc/lzo

Short Descriptions

liblzo2.so

is a data compression and decompression library.