#!/bin/bash DEPS=(glibc libtirpc audit libxcrypt) PKG_VER=1.5.2 SOURCE=https://github.com/linux-pam/linux-pam/releases/download/v$PKG_VER/Linux-PAM-$PKG_VER.tar.xz DESC="PAM (Pluggable Authentication Modules) library" prepare () { # prevent install of an uneeded systemd file sed -e /service_DATA/d \ -i modules/pam_namespace/Makefile.am && autoreconf } build () { ./configure --prefix=/usr \ --sbindir=/usr/sbin \ --sysconfdir=/etc \ --libdir=/usr/lib \ --enable-securedir=/usr/lib/security \ --docdir=/usr/share/doc/Linux-PAM-$PKG_VER && make } package () { make DESTDIR=$PKG_DEST install install -v -m755 -d $PKG_DEST/etc/pam.d && } postinstall () { install -vdm755 /etc/pam.d && cat > /etc/pam.d/system-account << "EOF" && # Begin /etc/pam.d/system-account account required pam_unix.so # End /etc/pam.d/system-account EOF cat > /etc/pam.d/system-auth << "EOF" && # Begin /etc/pam.d/system-auth auth required pam_unix.so # End /etc/pam.d/system-auth EOF cat > /etc/pam.d/system-session << "EOF" # Begin /etc/pam.d/system-session session required pam_unix.so # End /etc/pam.d/system-session EOF cat > /etc/pam.d/system-password << "EOF" # Begin /etc/pam.d/system-password # use sha512 hash for encryption, use shadow, and try to use any previously # defined authentication token (chosen password) set by any prior module password required pam_unix.so sha512 shadow try_first_pass # End /etc/pam.d/system-password EOF }