#!/bin/sh
+set -o errexit
+
# First argument of this script is the package name
# Reading system configuration informations, functions and package versions.
source ../packages-list
# Applying patches (if any)
-apply_patches ${1} &&
+apply_patches ${1}
-cd ${LFS_TMP}/${1} &&
+cd ${LFS_TMP}/${1}
-# The installation of two manual pages is broken and results in
-# dangling symlinks. Fix this with the following command:
-sed -i -e '/tc-bfifo.8/d' -e '/tc-pfifo.8/s/pbfifo/bfifo/' Makefile &&
+# The arpd binary included in this package is dependent on Berkeley DB.
+# Because arpd is not a very common requirement on a base Linux system,
+# remove the dependency on Berkeley DB by applying the sed command below
+sed -i '/^TARGETS/s@arpd@@g' misc/Makefile
-make SBINDIR=/sbin -j ${MAKEJOBS} &&
-make SBINDIR=/sbin install &&
+make DESTDIR=
-# The arpd binary links against the Berkeley DB libraries that reside
-# in /usr and uses a database in /var/lib/arpd/arpd.db. Thus,
-# according to the FHS, it must be in /usr/sbin. Move it there:
-mv -v /sbin/arpd /usr/sbin
+make DESTDIR= SBINDIR=/sbin MANDIR=/usr/share/man \
+ DOCDIR=/usr/share/doc/${1} install
-# Return last error
exit $?