pkgname=shadow pkgver=4.16.0 pkgdesc="Password and account management tool suite with support for shadow files and PAM" homepage="https://github.com/shadow-maint/shadow" license=(BSD-3-Clause) sources=("${pkgname}-${pkgver}.tar.xz" "useradd" ) urls=("https://github.com/shadow-maint/shadow/releases/download/${pkgver}/${sources[0]}" "https://gitea.phywyj.dynv6.net/wyj/LFS-PKGBUILDs/raw/branch/main/lfs/shadow-4.16.0/useradd" ) md5sums=("eb70bad3316d08f0d3bb3d4bbeccb3b4" "87ed6b2e7cdf479e05d4fe2510adb77f" ) src_prepare() { tar -xf ${DIST_DIR}/${pkgname}-${pkgver}/${sources[0]} --strip-components=1 sed -i 's/groups$(EXEEXT) //' src/Makefile.in find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \; find man -name Makefile.in -exec sed -i 's/getspnam\.3 / /' {} \; find man -name Makefile.in -exec sed -i 's/passwd\.5 / /' {} \; sed -e 's:#ENCRYPT_METHOD DES:ENCRYPT_METHOD YESCRYPT:' \ -e 's:/var/spool/mail:/var/mail:' \ -e '/PATH=/{s@/sbin:@@;s@/bin:@@}' \ -i etc/login.defs } src_build() { ./configure --sysconfdir=/etc \ --disable-static \ --with-{b,yes}crypt \ --without-libbsd \ --with-group-name-max-length=32 make } src_install() { make exec_prefix=/usr DESTDIR="${pkgdir}" install make DESTDIR="${pkgdir}" -C man install-man install -vDm 644 COPYING -t "$pkgdir/usr/share/licenses/$pkgname/" install -vDm 600 "${DIST_DIR}/${pkgname}-${pkgver}/useradd" -t "${pkgdir}/etc/default/" }