#!/bin/sh
-# First argument of this script is the package name
+set -o errexit
+
+# First argument of this script is the package name.
+# Remaining arguments are additional configure options.
# Reading system configuration informations, functions and package versions.
source ../sysinfos
source ../functions
source ../packages-list
-# This is only a basic installation (no servers) of inetutils.
+PACKAGE=${1}
+shift
+CONFIGURE_OPTS=${*}
# Applying patches (if any)
-apply_patches ${1} &&
+apply_patches ${PACKAGE}
-cd ${LFS_TMP}/${1}-build &&
-../${1}/configure \
+# This is only a basic installation (no servers) of inetutils.
+
+cd ${LFS_TMP}/${PACKAGE}-build
+../${PACKAGE}/configure \
--prefix=/usr \
- --libexecdir=/usr/sbin \
--sysconfdir=/etc \
- --localstatedir=/var \
- --disable-logger \
- --disable-syslogd \
- --disable-whois \
- --disable-servers &&
-make -j ${MAKEJOBS} &&
-make install &&
+ ${CONFIGURE_OPTS}
+make
+make install
+
+# Move some programs to their FHS-compliant place:
+mv -v /usr/bin/{hostname,ping,ping6} /bin
+mv -v /usr/bin/traceroute /sbin
-mv -fv /usr/bin/ping /bin
+ldconfig
-# Return last error
exit $?