2024-04-29 19:28:48 +08:00
|
|
|
# This is an example PKGBUILD file. Use this as a start to creating your own,
|
|
|
|
# and remove these comments. For more information, see 'man PKGBUILD'.
|
|
|
|
# NOTE: Please fill out the license field for your package! If it is unknown,
|
|
|
|
# then please put 'unknown'.
|
|
|
|
|
|
|
|
# Maintainer: Future Linux Team <future_linux@163.com>
|
|
|
|
pkgname=shadow
|
2024-10-14 18:51:50 +08:00
|
|
|
pkgver=4.16.0
|
2024-10-25 00:16:49 +08:00
|
|
|
pkgrel=2
|
2024-04-29 19:28:48 +08:00
|
|
|
pkgdesc="Password and account management tool suite with support for shadow files and PAM"
|
|
|
|
arch=('x86_64')
|
|
|
|
url="https://github.com/shadow-maint/shadow/"
|
|
|
|
license=('BSD-3-Clause')
|
|
|
|
groups=('base')
|
|
|
|
depends=('glibc' 'attr' 'acl' 'libxcrypt' 'linux-pam'
|
|
|
|
'cracklib' 'libpwquality' 'libcap')
|
|
|
|
backup=(etc/default/useradd
|
|
|
|
etc/pam.d/login
|
|
|
|
etc/pam.d/passwd
|
|
|
|
etc/pam.d/su
|
|
|
|
etc/pam.d/chpasswd
|
|
|
|
etc/pam.d/newusers
|
|
|
|
etc/pam.d/chage)
|
|
|
|
options=('!emptydirs')
|
|
|
|
install=${pkgname}.install
|
|
|
|
source=(https://github.com/shadow-maint/shadow/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.xz
|
|
|
|
chage
|
|
|
|
chpasswd
|
|
|
|
login
|
|
|
|
passwd
|
|
|
|
su)
|
2024-10-14 18:51:50 +08:00
|
|
|
sha256sums=(b78e3921a95d53282a38e90628880624736bf6235e36eea50c50835f59a3530b
|
2024-04-29 19:28:48 +08:00
|
|
|
656fc19e0e36740399f9d10773ac30254b48d5327aaddd89f47127acf99ccfb5
|
|
|
|
fbaed8b9d2bad9278da32f6747491ef291b332d0f977009aadb993436b2084c9
|
|
|
|
216eb2abc095566afa0ed5394f5b32765d3e3b63295c0e972ecd8ebda1a734d2
|
|
|
|
586820a13a54e92023ad3aa5dbf2ee4e2cfe470996ebb9ee5433e60abd5d8c01
|
|
|
|
f0182f4cf929c6adb5e13e8691787a8778828f5ea18911b7b7febb3e1b138c54)
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
cd ${pkgname}-${pkgver}
|
|
|
|
|
|
|
|
sed -i 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' etc/login.defs
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd ${pkgname}-${pkgver}
|
|
|
|
|
|
|
|
export CFLAGS="${CFLAGS} -DEXTRA_CHECK_HOME_DIR"
|
|
|
|
|
2024-10-14 18:51:50 +08:00
|
|
|
${CONFIGURE} \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--bindir=/usr/bin \
|
|
|
|
--sbindir=/usr/sbin \
|
|
|
|
--disable-static \
|
|
|
|
--without-libbsd \
|
|
|
|
--with-libpam \
|
|
|
|
--with-libcrack \
|
|
|
|
--with-{b,yes}crypt \
|
|
|
|
--with-group-name-max-length=32
|
2024-04-29 19:28:48 +08:00
|
|
|
|
|
|
|
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
|
|
|
|
make
|
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
cd ${pkgname}-${pkgver}
|
|
|
|
|
2024-10-25 00:16:49 +08:00
|
|
|
#make DESTDIR=${pkgdir} pamddir= install
|
|
|
|
make DESTDIR=${pkgdir} install
|
2024-04-29 19:28:48 +08:00
|
|
|
make -C man DESTDIR=${pkgdir} install-man
|
|
|
|
|
|
|
|
install -vdm755 ${pkgdir}/etc/default
|
|
|
|
cat > ${pkgdir}/etc/default/useradd << EOF
|
|
|
|
# useradd defaults file
|
|
|
|
GROUP=999
|
|
|
|
GROUPS=
|
|
|
|
HOME=/home
|
|
|
|
INACTIVE=-1
|
|
|
|
EXPIRE=
|
|
|
|
SHELL=/bin/bash
|
|
|
|
SKEL=/etc/skel
|
|
|
|
USRSKEL=/usr/etc/skel
|
|
|
|
CREATE_MAIL_SPOOL=yes
|
|
|
|
LOG_INIT=yes
|
|
|
|
EOF
|
|
|
|
|
|
|
|
install -v -m644 ${pkgdir}/etc/login.defs ${pkgdir}/etc/login.defs.orig
|
2024-10-14 18:51:50 +08:00
|
|
|
for FUNCTION in FAIL_DELAY \
|
2024-04-29 19:28:48 +08:00
|
|
|
FAILLOG_ENAB \
|
|
|
|
LASTLOG_ENAB \
|
|
|
|
MAIL_CHECK_ENAB \
|
|
|
|
LASTLOG_ENAB \
|
|
|
|
MAIL_CHECK_ENAB \
|
|
|
|
OBSCURE_CHECKS_ENAB \
|
|
|
|
PORTTIME_CHECKS_ENAB \
|
|
|
|
QUOTAS_ENAB \
|
|
|
|
OBSCURE_CHECKS_ENAB \
|
|
|
|
PORTTIME_CHECKS_ENAB \
|
|
|
|
QUOTAS_ENAB \
|
|
|
|
CONSOLE MOTD_FILE \
|
|
|
|
FTMP_FILE NOLOGINS_FILE \
|
|
|
|
ENV_HZ PASS_MIN_LEN \
|
|
|
|
SU_WHEEL_ONLY \
|
|
|
|
CRACKLIB_DICTPATH \
|
|
|
|
PASS_CHANGE_TRIES \
|
|
|
|
PASS_ALWAYS_WARN \
|
|
|
|
CHFN_AUTH ENCRYPT_METHOD \
|
|
|
|
ENVIRON_FILE
|
|
|
|
do
|
|
|
|
sed -i "s/^${FUNCTION}/# &/" ${pkgdir}/etc/login.defs
|
|
|
|
done
|
|
|
|
|
|
|
|
install -vdm755 ${pkgdir}/etc/pam.d
|
|
|
|
for F in chage chpasswd login passwd su
|
|
|
|
do
|
|
|
|
install -vm644 ${srcdir}/${F} ${pkgdir}/etc/pam.d/
|
|
|
|
done
|
|
|
|
|
|
|
|
sed -e s/chpasswd/newusers/ ${pkgdir}/etc/pam.d/chpasswd >${pkgdir}/etc/pam.d/newusers
|
|
|
|
|
|
|
|
for PROGRAM in chfn chgpasswd chsh groupadd groupdel \
|
|
|
|
groupmems groupmod useradd userdel usermod
|
|
|
|
do
|
|
|
|
install -v -m644 ${pkgdir}/etc/pam.d/chage ${pkgdir}/etc/pam.d/${PROGRAM}
|
|
|
|
sed -i "s/chage/$PROGRAM/" ${pkgdir}/etc/pam.d/${PROGRAM}
|
|
|
|
done
|
|
|
|
}
|