1 # Maintainer: Dave Reisner <dreisner@archlinux.org>
2 # Maintainer: Aaron Griffin <aaron@archlinux.org>
7 pkgdesc="Password and account management tool suite with support for shadow files and PAM"
9 url='https://github.com/shadow-maint/shadow'
11 # libcap-ng needed by install scriptlet for 'filecap'
12 depends=('pam' 'acl' 'libacl.so' 'audit' 'libaudit.so' 'libcap-ng' 'libcap-ng.so'
13 'libxcrypt' 'libcrypt.so')
14 backup=(etc/login.defs
15 etc/pam.d/{chage,passwd,shadow,useradd,usermod,userdel}
16 etc/pam.d/{chpasswd,newusers,groupadd,groupdel,groupmod}
17 etc/pam.d/{chgpasswd,groupmems}
19 options=('!emptydirs')
20 validpgpkeys=('66D0387DB85D320F8408166DB175CFA98F192AF2') # Serge Hallyn
21 source=("https://github.com/shadow-maint/shadow/releases/download/v$pkgver/shadow-$pkgver.tar.xz"{,.asc}
29 shadow.{timer,service}
31 install=shadow.install
32 sha1sums=('9cb767b86ff2b46e880b428e817972aa07b3a67c'
34 '33a6cf1e44a1410e5c9726c89e5de68b78f5f922'
35 '4ad0e059406a305c8640ed30d93c2a1f62c2f4ad'
36 '12427b1ca92a9b85ca8202239f0d9f50198b818f'
37 '0e56fed7fc93572c6bf0d8f3b099166558bb46f1'
38 '81a02eadb5f605fef5c75b6d8a03713a7041864b'
39 '12427b1ca92a9b85ca8202239f0d9f50198b818f'
40 '611be25d91c3f8f307c7fe2485d5f781e5dee75f'
41 'a154a94b47a3d0c6c287253b98c0d10b861226d0'
42 'b5540736f5acbc23b568973eb5645604762db3dd'
43 'c173208c5cf34528602f9931468a67b7f68abad3')
53 --mandir=/usr/share/man \
55 --disable-account-tools-setuid \
57 --with-group-name-max-length=32 \
68 make DESTDIR="$pkgdir" install
69 make DESTDIR="$pkgdir" -C man install
72 install -Dm644 "$srcdir/LICENSE" "$pkgdir/usr/share/licenses/shadow/LICENSE"
75 install -Dm600 "$srcdir/useradd.defaults" "$pkgdir/etc/default/useradd"
78 install -D -m644 "$srcdir/shadow.timer" "$pkgdir/usr/lib/systemd/system/shadow.timer"
79 install -D -m644 "$srcdir/shadow.service" "$pkgdir/usr/lib/systemd/system/shadow.service"
80 install -d -m755 "$pkgdir/usr/lib/systemd/system/timers.target.wants"
81 ln -s ../shadow.timer "$pkgdir/usr/lib/systemd/system/timers.target.wants/shadow.timer"
84 install -Dm644 "$srcdir/login.defs" "$pkgdir/etc/login.defs"
87 rm "$pkgdir/etc/pam.d"/*
88 install -t "$pkgdir/etc/pam.d" -m644 "$srcdir"/{passwd,chgpasswd,chpasswd,newusers}
90 # PAM config - from tarball
91 install -Dm644 etc/pam.d/groupmems "$pkgdir/etc/pam.d/groupmems"
93 # we use the 'useradd' PAM file for other similar utilities
94 for file in chage groupadd groupdel groupmod shadow \
95 useradd usermod userdel; do
96 install -Dm644 "$srcdir/defaults.pam" "$pkgdir/etc/pam.d/$file"
99 # Remove evil/broken tools
100 rm "$pkgdir"/usr/sbin/logoutd
102 # Remove utilities provided by util-linux
104 "$pkgdir"/usr/bin/{login,chsh,chfn,sg,nologin} \
105 "$pkgdir"/usr/sbin/{vipw,vigr}
107 # but we keep newgrp, as sg is really an alias to it
108 mv "$pkgdir"/usr/bin/{newgrp,sg}
110 # ...and their many man pages
111 find "$pkgdir"/usr/share/man \
112 '(' -name 'chsh.1' -o \
115 -name 'logoutd.8' -o \
117 -name 'nologin.8' -o \
120 -name 'newgrp.1' ')' \
123 # move everything else to /usr/bin, because this isn't handled by ./configure
124 mv "$pkgdir"/usr/sbin/* "$pkgdir"/usr/bin
125 rmdir "$pkgdir/usr/sbin"