libunistring is a library that provides functions for manipulating Unicode strings and for manipulating C strings according to the Unicode standard.
Create the PKGBUILD for the libunistring package with the following commands:
mkdir /sources/libunistring
cd /sources/libunistring
cat > PKGBUILD << "REALEOF"
# Maintainer: Linux From Scratch <lfs-dev@lists.linuxfromscratch.org>
pkgname="libunistring"
pkgver="1.3"
pkgrel="1"
pkgdesc="A library that provides functions for manipulating Unicode strings and for manipulating C strings according to the Unicode standard"
arch=('x86'
'x86_64')
url="https://www.gnu.org/software/libunistring/"
license=('GPLv3')
groups=('core')
depends=('glibc'
'rootfs')
makedepends=('bash'
'binutils'
'coreutils'
'diffutils'
'gawk'
'gcc'
'grep'
'make'
'sed')
source=('https://ftp.gnu.org/gnu/libunistring/libunistring-1.3.tar.xz')
md5sums=('57dfd9e4eba93913a564aa14eab8052e')
build(){
cd "${pkgname}-${pkgver}"
./configure --prefix=/usr \
--disable-static \
--docdir="/usr/share/doc/${pkgname}-${pkgver}"
make
}
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 libunistring-1.3-1-$(uname -m).pkg.tar.xz \
/srv/pacman/repos/LFS/
repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \
/srv/pacman/repos/LFS/libunistring-1.3-1-$(uname -m).pkg.tar.xz
Update the local cache and install the libunistring package:
pacman -Syu pacman -S libunistring --overwrite \* -dd --noconfirm
Finally, copy the source files into the source repository and clean up the build directory:
mkdir /srv/pacman/source/LFS/libunistring cp PKGBUILD /srv/pacman/source/LFS/libunistring cd /sources rm -rf libunistring