8.27.1. Installation of Attr
Create the PKGBUILD for the Attr package with the following
commands:
mkdir /sources/attr
cd /sources/attr
cat > PKGBUILD << "REALEOF"
# Maintainer: Linux From Scratch <lfs-dev@lists.linuxfromscratch.org>
pkgname="attr"
pkgver="2.5.2"
pkgrel="1"
pkgdesc="The Attr package contains utilities to administer the extended attributes of filesystem objects."
arch=('x86'
'x86_64')
url="https://savannah.nongnu.org/projects/attr"
license=('GPLv2'
'LGPLv2.1')
groups=('core')
depends=('glibc')
makedepends=('bash'
'binutils'
'coreutils'
'gcc'
'gettext'
'grep'
'm4'
'make'
'perl'
'sed'
'texinfo')
checkdepends=('automake'
'diffutils'
'findutils'
'libtool')
source=('https://download.savannah.gnu.org/releases/attr/attr-2.5.2.tar.gz')
md5sums=('227043ec2f6ca03c0948df5517f9c927')
build(){
cd ${pkgname}-${pkgver}
./configure --prefix=/usr \
--disable-static \
--sysconfdir=/etc \
--docdir=/usr/share/doc/attr-${pkgver}
make
}
# The tests must be run on a filesystem that supports extended attributes.
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 attr-2.5.2-1-$(uname -m).pkg.tar.xz \
/srv/pacman/repos/LFS/
repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \
/srv/pacman/repos/LFS/attr-2.5.2-1-$(uname -m).pkg.tar.xz
Update the local cache and install the Attr package:
pacman -Syu
pacman -S attr --overwrite \* -dd --noconfirm
Finally, copy the source files into the source repository and clean
up the build directory:
mkdir /srv/pacman/source/LFS/attr
cp PKGBUILD /srv/pacman/source/LFS/attr
cd /sources
rm -rf attr