#!/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}-build &&
-../${1}/configure \
- --libdir=/lib \
- --sysconfdir=/etc \
- --enable-shared \
- --without-selinux &&
# Disable the installation of the groups program and its man page, as
# Coreutils provides a better version.
-sed -i 's/groups$(EXEEXT) //' src/Makefile &&
-find man -name Makefile -exec sed -i '/groups/d' {} \; &&
-make -j ${MAKEJOBS} &&
-make install &&
-cp -f ../${1}/etc/{limits,login.access} /etc &&
-
-# Instead of using the default crypt method, we want to use the more secure
-# MD5 method of password encryption, which also allows passwords longer than
-# 8 characters. We also need to change the obsolete /var/spool/mail location
-# for user mailboxes that Shadow uses by default to the /var/mail location
-# used currently. We accomplish both these things by changing the relevant
-# configuration file while copying it to its destination.
-sed -e's@#MD5_CRYPT_ENAB.no@MD5_CRYPT_ENAB yes@' \
- -e 's@/var/spool/mail@/var/mail@' \
- ../${1}/etc/login.defs > /etc/login.defs
-
-var_add_shadow "ENV_SUPATH" /etc/login.defs "/usr/local/sbin:/usr/local/bin" &&
+sed -i 's/groups$(EXEEXT) //' src/Makefile.in
+find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \;
-# Move some misplaced symlinks/programs to their proper locations.
-mv /usr/bin/passwd /bin &&
+# Disable the installation of Chinese and Korean manual pages, since Man-DB
+# cannot format them properly:
+sed -i -e 's/ ko//' -e 's/ zh_CN zh_TW//' man/Makefile.in
+
+# Instead of using the default crypt method, use the more secure MD5 method
+# of password encryption, which also allows passwords longer than 8 characters.
+# It is also necessary to change the obsolete /var/spool/mail location for user
+# mailboxes that Shadow uses by default to the /var/mail location used currently:
+sed -i -e 's@#ENCRYPT_METHOD DES@ENCRYPT_METHOD MD5@' \
+ -e 's@/var/spool/mail@/var/mail@' etc/login.defs
-# Move Shadow's libraries to more appropriate locations.
-mv /lib/libshadow.*a /usr/lib &&
-rm /lib/libshadow.so &&
-ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so &&
+cd ${LFS_TMP}/${1}-build
+../${1}/configure \
+ --sysconfdir=/etc \
+ --without-selinux
+make -j ${MAKEJOBS}
+make install
+
+var_add_shadow "ENV_SUPATH" /etc/login.defs "/usr/local/sbin:/usr/local/bin"
+
+# Move some misplaced symlinks/programs to their proper locations.
+mv /usr/bin/passwd /bin
# The -D option of the useradd program requires this directory for it
# to work properly.
-mkdir -p /etc/default &&
+mkdir -p /etc/default
# To enable shadowed passwords:
-pwconv &&
+pwconv
# To enable shadowed group passwords:
grpconv
-# Return last error
exit $?