#!/bin/sh # First argument of this script is the package name # Reading system configuration informations, functions and package versions. source ../sysinfos source ../functions source ../packages-list # Applying patches (if any) apply_patches ${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" && # Move some misplaced symlinks/programs to their proper locations. mv /usr/bin/passwd /bin && # 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 && # The -D option of the useradd program requires this directory for it # to work properly. mkdir -p /etc/default && # To enable shadowed passwords: pwconv && # To enable shadowed group passwords: grpconv # Return last error exit $?