8.54. Intltool-0.51.0

The Intltool is an internationalization tool used for extracting translatable strings from source files.

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

8.54.1. Installation of Intltool

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

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

pkgname="intltool"
pkgver="0.51.0"
pkgrel="1"
pkgdesc="The Intltool is used for extracting translatable strings from source files."
arch=('x86'
      'x86_64')
url="https://freedesktop.org/wiki/Software/intltool"
license=('GPLv2')
groups=('core')
depends=('autoconf'
         'automake'
         'bash'
         'glibc'
         'grep'
         'perl'
         'sed'
         'rootfs')
makedepends=('gawk'
             'xml-parser')
checkdepends=('perl')
source=('https://launchpad.net/intltool/trunk/0.51.0/+download/intltool-0.51.0.tar.gz')
md5sums=('12e517cac2b57a0121cda351570f1e63')
    
prepare(){
  cd ${pkgname}-${pkgver}
  # Fix a warning that is caused by perl-5.22 and later
  sed -i 's:\\\${:\\\$\\{:' intltool-update.in
}

build(){
  cd ${pkgname}-${pkgver}
  ./configure --prefix=/usr
  make
}

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

package(){
  cd ${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install
  install -v -Dm644 doc/I18N-HOWTO ${pkgdir}/usr/share/doc/intltool-${pkgver}/I18N-HOWTO
}
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 intltool-0.51.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/intltool-0.51.0-1-$(uname -m).pkg.tar.xz

Update the local cache and install the Intltool package:

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

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

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

8.54.2. Contents of Intltool

Installed programs: intltool-extract, intltool-merge, intltool-prepare, intltool-update, and intltoolize
Installed directories: /usr/share/doc/intltool-0.51.0 and /usr/share/intltool

Short Descriptions

intltoolize

Prepares a package to use intltool

intltool-extract

Generates header files that can be read by gettext

intltool-merge

Merges translated strings into various file types

intltool-prepare

Updates pot files and merges them with translation files

intltool-update

Updates the po template files and merges them with the translations