mirror of
https://github.com/dslm4515/BMLFS.git
synced 2025-08-20 14:31:47 +00:00
90 lines
3.3 KiB
Bash
90 lines
3.3 KiB
Bash
#! /bin/bash
|
|
|
|
# Linux-PAM
|
|
# Source: https://github.com/linux-pam/linux-pam/releases/download/v1.5.3/Linux-PAM-1.5.3.tar.xz
|
|
#
|
|
# $BUILD = Directory to temporarily install
|
|
# $PKGS = Directory to store built packages
|
|
#
|
|
# DEPS
|
|
# Required: None
|
|
# Optional: Berkeley DB, libnsl, libtirpc, libaudit, and Prelude
|
|
# Optional for docs: docbook-xml, docbook-xsl, fop, libxslt and either Lynx or W3m
|
|
|
|
# If optimizing, use these flags
|
|
export CFLAGS="-march=native -mtune=native -pipe "
|
|
export CFLAGS+="-O3 -ffat-lto-objects -flto=4 "
|
|
export CFLAGS+="-fstack-protector-strong -fzero-call-used-regs=used "
|
|
export LDFLAGS="-Wl,-O2 -Wl,--as-needed "
|
|
|
|
# Per, BLFS, first, prevent the installation of an unneeded systemd file:
|
|
sed -e /service_DATA/d \
|
|
-i modules/pam_namespace/Makefile.am
|
|
|
|
# For CMLFS, examples don't build
|
|
patch -Np1 -i ../patches/linux-pam-chimera/no-examples.patch
|
|
|
|
autoreconf -fvi &&
|
|
|
|
ac_cv_search_crypt=no \
|
|
./configure --prefix=/usr \
|
|
--sysconfdir=/etc \
|
|
--libdir=/usr/lib \
|
|
--enable-securedir=/lib/security \
|
|
--docdir=/usr/share/doc/Linux-PAM-1.5.3 \
|
|
--disable-nls \
|
|
--disable-audit $BUILDTUPLE &&
|
|
|
|
read -p "Compile? " && make -j2 &&
|
|
|
|
read -p "Press Enter to install" &&
|
|
# if not using a package manager:
|
|
# make install
|
|
|
|
# if using pkgtools from Slackware, then:
|
|
su -c "make DESTDIR=$BUILD install"
|
|
su -c "install -vdm755 ${BUILD}/etc/pam.d"
|
|
for f in other system-account system-auth system-password system-session
|
|
do
|
|
su -c "cp -v ../files/Linux-PAM-lfs/$f ${BUILD}/etc/pam.d/"
|
|
done
|
|
|
|
read -p "Press Enter to create pakage description."
|
|
cd $BUILD && su -c "mkdir -v install" &&
|
|
cat > /tmp/slack-desc << "EOF"
|
|
# HOW TO EDIT THIS FILE:
|
|
# The "handy ruler" below makes it easier to edit a package description. Line
|
|
# up the first '|' above the ':' following the base package name, and the '|' on
|
|
# the right side marks the last column you can put a character in. You must make
|
|
# exactly 11 lines for the formatting to be correct. It's also customary to
|
|
# leave one space after the ':'.
|
|
|
|
|-----handy-ruler------------------------------------------------------|
|
|
linux-pam: linux-pam (Pluggable Authentication Modules)
|
|
linux-pam:
|
|
linux-pam: Linux-PAM is a library that enables the local system administrator
|
|
linux-pam: to choose how individual applications authenticate users. The purpose
|
|
linux-pam: of the Linux-PAM project is to liberate the development of privilege
|
|
linux-pam: granting software from the development of secure and appropriate
|
|
linux-pam: authentication schemes.
|
|
linux-pam:
|
|
linux-pam: Homepage: https://github.com/linux-pam/linux-pam
|
|
linux-pam:
|
|
linux-pam:
|
|
EOF
|
|
su -c "mv /tmp/slack-desc install/" &&
|
|
|
|
read -p "Enter to build package" &&
|
|
su -c "makepkg -l y -c n $PKGS/linux-pam-1.5.3-$PSUFFIX" &&
|
|
|
|
cp -v install/doinst.sh /tmp/
|
|
cat >> /tmp/doinst.sh << "EOF"
|
|
chmod -v 4755 /sbin/unix_chkpwd
|
|
echo ">>Recommended to re-install shadow with PAM support.<<"
|
|
EOF
|
|
|
|
su -c "mv -v /tmp/doinst.sh install/"
|
|
|
|
su -c "makepkg -l y -c n $PKGS/linux-pam-1.5.3-$PSUFFIX" &&
|
|
su -c "rm -rf ${BUILD}/*"
|